Linux: Search/Find Command
Find Command Location
Show full path of a command, useful for checking if a program is installed.
whichcommand search for the command in
$PATHenvironment variable. If it returns nothing, it means the command is not in the
$PATH, yet it may be installed somewhere.
echo $PATH. It is a list of dir paths. They are searched in order.
Find a file by name using locate
Find a file by name (using the database see
man updatedb). This is similar to
find dir_paths -name "*fname*"but much faster.
Update the database used by
locate. (this is done automatically. Useful only if you just installed bunch of new commands.)
Show Type of Command
Show if cmd is a shell built-in or standalone program. For example,
type kill. The command
typeis a built-in bash command, not a standalone shell util. Try
Excutable files must have executable bits on. That is, the “x”. For example, type
ls -l /usr/bin to see them. [see Linux: File Permission System]