which

Locate a program file in the user's path

Syntax
      which [-as] program ...

Key
   -a   List all instances of executables found (instead of just the first one of each).

   -s   No output, just return 0 if any of the executables are found,
        or 1 if none are found.

Displays the command that will be executed by the shell after substitutions, path searching, etc.

Use the type command to be sure the file is the type of program you are expecting.

Some shells may provide a builtin which command which is similar or identical to this utility.

"God shows his contempt for wealth by the kind of person he selects to receive it" ~ Austin O'Malley

Related:

type - Describe a command.
find - Search for files that meet a desired criteria
grep - Search file(s) for lines that match a given pattern
ls - List information about file(s)
locate - Find files
where - Report all known instances of a command


© Copyright SS64.com 1999-2014
Some rights reserved