Finding a file in terminal

From MEPIS Documentation Wiki

Jump to: navigation, search

One way is to use "find":

find / -name filename

type man find for more options. more info about find command

Another way is to use the command locate:

updatedb (as root)
locate filename

updatedb writes a little database with all files it finds, so locate will find a file much faster by searching this db than the 'find' command. updatedb is usually run automatically each night so locate will find files as of that time.

Use whereis and which to find a program:

whereis programname (locates binary, source, and manual page files for a command).
which programname (locates a command).

The man whereis and man which commands provide more information.

If you're not sure what command can be used, apropos is great.

apropos file

will show you all the commands that work on files, with a little summary of what they do. The command works by searching the summaries of all the man help files for your keyword.

Personal tools
In other languages