Using the find Command

The find command is a powerful, flexible way to create a list of files based on filename or part of a name, size, owner, or many other characteristics and combinations of characteristics. The find command not only searches the requested directory, but it also searches all subdirectories. The basic syntax is as follows:

find starting-dir(s) options

See Table 7.5 for other standard properties of the find command:

Table 7.5. Other Properties of the find Command
PropertySee page
Allows output to be piped or redirected116
For the starting directory: 
Allows relative and absolute pathname arguments70
Allows a list of filenames and filename wildcards292

Finding All the Directories That Contain a Given Filename

Start with a simple, ...

Get Practical UNIX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.