Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

find is a command line utility to search for files in a directory hierarchy

find is a utility to search a directory tree for files matching certain criteria (name, type, date, …) and print their names or execute commands on them.

Common idioms

List all the regular files in the current directory and its subdirectories:

find . -type f

Same, but do not recurse into directories called .svn:

find . -type d -name .svn -prune -o -type f -print

Recode all *.txt files in the current directory and its subdirectories from latin1 to utf8 (two equivalent commands):

find . -type f -name '*.txt' -exec recode latin1..utf8 {} +
find . -type f -name '*.txt' -print0 | xargs -0 recode latin1..utf8

Further reading

history | excerpt history