unix – cual / donde hay diferencias

Pregunta:

¿Cuál es la diferencia entre which y whereis ?

Respuesta:

¿Qué hay de aprender acerca de whereis y which el uso de whatis ?

$  whatis which
which                (1)  - shows the full path of (shell) commands

$  whatis whereis
whereis              (1)  - locate the binary, source, and manual page files for a command

Básicamente, whereis busca archivos "posiblemente útiles", mientras which sólo busca archivos ejecutables.

Rara vez uso whereis . Por otro lado, lo which es muy útil, especialmente en scripts. which es la respuesta para la siguiente pregunta: ¿De dónde viene este comando?

$  which ls
/bin/ls

$  whereis ls
ls: /bin/ls /usr/share/man/man1p/ls.1p.bz2 /usr/share/man/man1/ls.1.bz2

Leave a Comment

Your email address will not be published. Required fields are marked *

web tasarım