Search

The which command

Tells the path of the program that runs when you type a command.

Syntax

which <comando>

Copy-ready examples

$ which lsWhere is ls?
$ which grepAnd grep?

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • If it prints nothing, the command is not in the PATH.

Related commands

FAQ

Are which and whereis the same?

Similar: which gives the executable; whereis adds the manual and sources.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course