O'Reilly logo

Linux: Phrasebook by Scott Granneman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. 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 things with find that aren’t possible with locate.

Throughout this chapter, we look for files on an external hard drive that contains music mounted at /media/music. You can see that find allows us to slice and dice the files in a variety of ways.

Find Files by Name

find -name

find

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required