Finding Files in Linux

There are two ways I now how to find files, I like to use updatedb/locate the best, but the find command is more commonly installed.

updatedb / locate

updatedb

locate testfilename.txt

find

find -name testfilename.txt

updatedb /locate is much faster because it uses a database to cache all the files on your system, but it needs to constantly be updated either manually or by cron. Where as find is much slower but also is up to date.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s