Skip to content

Which

Muestra la ruta del ejecutable que se usará según $PATH.

ComandoQué haceEjemplo
which cmdPrimera ruta de cmd en $PATH.which python
which -a cmdTodas las coincidencias (orden de prioridad).which -a python
/usr/bin/python
which python
which -a python
# /usr/bin/python
# /usr/local/bin/python
which pepe
# pepe not found

Alternativas: command -v python o type -a python (built-in del shell; a menudo más fiables).

Docs: man which.