Name
find — stdin stdout - file -- opt --help --version
Synopsis
find [directories] [expression]
The find command searches
one or more directories (and their subdirectories recursively) for
files matching certain criteria. It is very powerful, with over 50
options and, unfortunately, a rather unusual syntax. Here are some
simple examples that search the entire filesystem from the root
directory:
Find a particular file named myfile:
$ find / -type f -name myfile -print
Print all directory names:
$ find / -type d -print
Print filenames ending in “.txt” (notice how the wildcard is escaped so the shell ignores it):
$ find / -type f -name \*.txt -print
Useful options
|
The name ( |
|
The |
|
|
The path (relative to the directory tree being searched) must match the given regular expression. |
|
|
Locate only files of
type |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access