which Linux Commands

What is Linux which Command?

Explanation

which COMMAND:

which command is used to show the full path of the given executable command.

SYNTAX :


which [options] [--] program_name [...]

OPTIONS:


--all, -a Print all matching executables in PATH, not just the first./td>
--read-alias, -i Read aliases from stdin, reporting matching ones on stdout.
--skip-alias Read shell function definitions from stdin, reporting matching ones on stdout.
--skip-functions Ignore option `--read-functions', if any. This is useful to explicity search for normal binaries, while using the `--read-functions' option in an alias or function for which.
--skip-dot causes Skip directories in PATH that start with a dot.
--skip-tilde Skip directories in PATH that start with a tilde and executables which reside in the HOME directory.
-<number> causes a2p to assume that input will always have that many fields. in this category.
--tty-only Stop processing options on the right if not on tty.
--version,-v,-V Print version information on standard output then exit successfully.

EXAMPLE:


  1. which killall
    Output:
    /usr/bin/killall
  2. In the above example, the which cmd displays the location of the executable command 'killall'.

Ask Questions

Ask Question