1. locateHow to use:
Will return this:
/etc/X11/xorg.conf /usr/share/man/man5/xorg.conf.5.gz /var/lib/x11/xorg.conf.md5sum
Searching for an exacte match:
locate -r '/xorg.conf$'
locate -i 'file_Name'
Please note: locate relies on slocate database to function, which is cached. To manually update the slocate database, run:
2. whichThis command tells you where a command lives.
For instance, running
This command will not only tell you where the executable file is located at, but it will also locate the source, man page, and other associated directories as well.
Will return something like this:
firefox: /usr/bin/firefox /usr/lib/firefox /usr/lib64/firefox /usr/share/firefox
find can basically do everything: from search for files based on last modified times, owners and groups, permissions, type (file, directory, symbolic link, etc), whether the file is readable/writable/executable by the current user, file size, whether the file or directory is empty, and much more. You can also search for matches by regular expression. Runing find with the xargs command, you can do amazing things from within a terminal.
There are many ways of using the find command so for more info, see these pages:
Example uses of the Linux Command find
Unix/Linux “find” Command Tutorial
Using the find command