On unix the command is find
, which takes a mini-language on the command line for defining what to find.
The short version of how to use it is:
$ find [where in the file tree to start]+ [how to filter files]+ [actions]+
and a common usage would be
$ find . ~ -name '*.mp3' -print
which means start in this directory (.
) and my home directory (~
), select only files with names ending in .mp3
(the -name
filter), and print the path (using the -print
action).
There are many more selection operators, and a modest set of actions. To do something complicated with the files you've found you either use -exec
or print their names and pipe to xargs
.