Skip to content
Search

Which

lastmod 2022-11-11created 2016-03-216 edits

(whereis, whence, and where all link here)

How to use

With the which command, you can easily find out where on the disk an executable file is located. That is, it searches the <cod>PATH</code> environment variable to find the location of the executable.

$ which ls

If you enter this,

/usr/bin/ls

you get this result. It means the file ls is under the /usr/bin/ directory (folder).

This is the case for the usual bash shell; in C shell and others, the whereis or whence command is used. On Windows, the where command is used.

command vs which vs alias vs type

See Command#command vs which vs alias vs type for details.

See also

Favorite site

author Zer0 sitemap