Finding Files and Directories

Although navigating your disk's directories and listing directory contents can be helpful for finding needed files, Linux comes with several search utilities that will work much faster. The following sections demonstrate how to use several of these commands to quickly and efficiently find files or directories.

Finding Files with the find Command

The find command is used to search all mounted file systems for the name or partial name of a file or directory. This powerful command can be used to do much more than simply find files. To search for files or directories, specify a search path and search pattern on the command line, like so:

$ find  /usr -name *emacs -xdev

As shown in the following, this search of the /usr ...

Get Practical Linux 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.