O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

which — stdin  stdout  - file  -- opt  --help  --version

Synopsis

which file

The which command locates an executable file in your shell’s search path. If you’ve been invoking a program by typing its name:

$ who

the which command tells you where this command is located:

$ which who
/usr/bin/who

You can even find the which program itself:

$ which which
/usr/bin/which

If several programs in your search path have the same name (for example, /usr/bin/who and /usr/local/bin/who), which reports only the first.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required