O'Reilly logo

Linux® Desk Reference, Second Edition by Scott Hawkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Commands

find

[path…][expression]

The find command searches the directory tree specified by the path argument for the pattern(s) indicated in the expression argument.

The expression consists of options, tests, and actions. Options affect overall operation rather than the processing of a specific file. Tests return a true or false value based on evaluation of some condition. Actions have side effects and return a true or false value.

Example: To search the entire system for a file named “abcd.txt”, use

find / -name abcd.txt -print

Example: To search all the files in the directory tree of user “someguy” for the string “blah”, use:

find /home/someguy -type f -print |xargs grep -n “blah”

A common mistake with the find command is assuming that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required