Sofia
Bulgaria 1000
8835.1001289.0363
sales@linuxssdvps.com
support@linuxssdvps.com

[Tutorial] How to find files in Linux?

The whereis command can quickly find files, and it also shows you where the file’s binary, source, and manual pages reside. For example, the following command shows that the find command is in the /usr/bin directory, and its man page is in the /usr/man/man1 directory:

# whereis find

find: /usr/bin/find /usr/man/man1/find.1

You can also use whereis to find only the binary version of the program with

# whereis -b find

find: /usr/bin/find

If whereis cannot find your request, you’ll get an empty return string, for example:

# whereis foo

foo:

Part of the problem could also be that the file is not in any of the directories the whereis command searches. The directories whereis looks in are hard-coded into the program. Although this may seem like a drawback, limiting searches to known directories such as /usr/ man, /usr/bin, or /usr/sbin can speed up the task of finding files. Although whereis is faster than using find to locate programs or manual pages, there’s an even faster search utility you can use, called locate, discussed in the next section.


Leave a Reply

Your email address will not be published.

Themetf