About

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 | show excerpt | excerpt history