11. The find Command

In the last chapter, we covered commands that let you search for files (locate) and data within files (grep). The third command in the powerful triumvirate is find. While locate searches a database for files, which makes it fast but dependent upon a constantly updated database, find searches for files on the fly using criteria that you specify. Since find has to parse through your file structure, it’s much slower than locate, but you can do lots of things with find that aren’t possible with locate.

Throughout this chapter, we’re going to work on an external hard drive that contains music and related files and is mounted at /media/music. Also notice that there are spaces in the filenames, which explains the quotation marks ...

Get Linux Phrasebook, Second Edition 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.