Back to the command reference

which

HelpBeginner In simulator In real Linux

Locate a command

Name: which

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

which searches PATH and prints the full path of the program that would run. It only finds executables and can't see aliases, functions or builtins; use type for the full picture.

Syntax

which COMMAND...

Common options

-aPrint every match in PATH

Examples

  • $ which ls

    Show the path of ls

    Explain
  • $ which python3

    Check whether a program is installed

    Explain

Related