Finding files by specific extension

suggest change

To find all the files of a certain extension within a directory, you can use the following find syntax. With the pattern quoted, Bash does not expand it; find’s -name test matches it as a glob.

find /directory/to/search -maxdepth 1 -type f -name "*.extension"

To find all files of type .txt from the current directory alone, do

find . -maxdepth 1 -type f -name "*.txt"

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents