Finding files by specific extension
suggest changeTo 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"
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents