What command is used to find files by name in a directory hierarchy?

The story behind the answer

What command is used to find files by name in a directory hierarchy? The answer is `find`.

The Unix and Linux `find` command starts at one or more directories, traverses their descendants recursively, and selects entries that match expressions such as `-name`. For example, `find . -name 'report.txt'` searches from the current directory downward for entries with that name. It can also filter by type, permissions, ownership, timestamps, and more.

`find` first appeared in Version 5 Unix as part of the Programmer’s Workbench project. It was designed alongside `cpio`, and later implementations—especially GNU `find`—added extensive actions such as `-exec`, which can run another command on each match. This makes `find` both a search tool and a powerful file-management component.

`locate` is the main mix-up: it searches a prebuilt filename database and is often faster, but results can be outdated. `which` usually finds an executable in the shell’s `PATH`, while `whereis` searches conventional locations for binaries, source, and manual pages. Neither is the general recursive directory-hierarchy searcher represented by `find`.

Source: Wikipedia · fact-checked Sept. 2026

Add question to a list

Choose a list to keep this question in: