Locating files on linux using find

A very powerful tool on linux systems is the find command. It is used to locate file in the system across directories.

example:

amit@texens:~$ find

It takes in the location to be searched, and the criteria. It can search using criteria such as file name, owner, group, file permission, last edit time etc. It is recursive in nature, that is it looks into the folders recursively.

example:

amit@texens:~$ find . -name foobar

will list all the files with the name foobar.

See manpage for find for more information.

Note: grep is different from find in the way that grep looks for content inside the files wheras find locates files itself and not the content inside them.

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