Linux Find Command Tutorial (With Examples)

When it comes to locating files or directories on your system, the find command on Linux is unparalleled. It's simple to use, yet has a lot of different options that allow you to fine-tune your search for files.

Read on to see examples of how you can wield this command to find anything on your system. Every file is only a few keystrokes away once you know how to use the find command in Linux.

Beware of This find Command Gotcha

find is a useful basic command that Linux users run all the time. The command searches a file system from a given starting location and returns all matches based on input filters that you provide as arguments.

The Gotcha

The gotcha is when you try to narrow the search by pruning a sub-directory from the search (including the directory itself and everything under it). For instance, suppose you want to find all files under the directory /data that are owned by root, excluding the sub-directory /data/keepit and all files underneath.