May 25, 2012
tom

How to find all filenames with given extension

Question

I need to find all .pem files on my system. Would the following do this?

sudo find / -type f -name *.pem

If not, how would I write a find command to find every file of the sort?

Asked by David542

Answer

You’re on the right track — you just need to quote the pattern so that it gets interpreted by find and not by your shell:

sudo find / -type f -name '*.pem'
Answered by mgorven

Related posts:

  1. find files without any extension
  2. can not find a directory with find command
  3. How to bulk rename files to remove an extraneous space from before the extension
  4. How do I find the UUID of a partition
  5. Find and delete all but N largest files in 100s of directories

Leave a comment