If you just want to find files with a certain name, use find
The man page can be found HERE or by typing man find
at the terminal prompt.
Basically, find will recursively look for a file meeting criteria you specify. The easiest example:
find . -name file_name -print
That will search for a file named "file_name" starting in the current directory and searching below and print the files with that name.
find ~ -name ".DS_Store" -delete
That will find all the .DS_Store files and delete them.
You can search by name, regex, date. You can act on the file in any Unix way with the -exec
predicate.
You can also use find as the start of a more complex pipeline of actions. Example:
find . -type f -print | egrep -i '\.m4a$|\.mp3$'
Will find all the files with extensions .m4a or .mp3
find . -type f -print | egrep -i '\.m4a$|\.mp3$' | wc -l
Will give you a count of those files.
possible duplicate of Search through text files in Mac OS X
– Chealion – 2010-08-18T15:18:21.750I'm interested in searching through all types of files; Not necessarily excluding text files but not only text files. – JFW – 2010-08-19T03:44:56.657