Version 1/7
-
Next » -
Current version
Guillermo Gómez, 12/03/2011 06:15 am
which¶
which muestra la ruta completa (shell) de los comandos.
which [options] [--] programname [...]
which toma uno o más argumentos. Para cada uno de estos argumento imprime en stdout la ruta completa de los ejecutable que serían ejecutados cuando dicho argumento se ingresado en la línea de comandos shell. Lo hace por medio de la búsqueda de un ejecutable en los directorios listados en la variable de entorno PATH utilizando el mismo algoritmo de bash(1).
Opciones¶
- --all, -a : Imprime todos los ejecutables encontrados en PATH, no sólo el primero.
--read-alias, -i : Lee los alias desde stdin, reportando los encontrados en stdout. Esto es útil en combinación con el uso de un alias para el mismo *wich*. Por ejemplo:
alias which=´alias | which -i´.
--skip-alias
Ignore option `--read-alias´, if any. This is useful to explicity search for normal binaries, while using the `--read-alias´ option in an alias
or function for which.
--read-functions
Read shell function definitions from stdin, reporting matching ones on stdout. This is useful in combination with using a shell function for
which itself. For example:
which() { declare -f | which --read-functions $@ }
export -f which
--skip-functions
Ignore option `--read-functions´, if any. This is useful to explicity search for normal binaries, while using the `--read-functions´ option in
an alias or function for which.
--skip-dot
Skip directories in PATH that start with a dot.
--skip-tilde
Skip directories in PATH that start with a tilde and executables which reside in the HOME directory.
h2. Algunos ejemplos
<pre>
$ which rpm
/bin/rpm
</pre>
