Os comandos "which" e "whereis"
Dica publicada em Linux / Comandos
Os comandos "which" e "whereis"
Os comandos which e whereis são usados para
realizar a busca de arquivos no sistema de forma muito rápida.
Mas Você sabe a diferença entre os 2?
Veja:
# whereis named.conf
named: /usr/sbin/named /etc/named.conf /usr/share/man/man8/named.8.gz
# whereis httpd
httpd: /usr/sbin/httpd /etc/httpd /usr/share/man/man8/httpd.8.gz
# which httpd
/usr/sbin/httpd
# which X /usr/bin/X11/X
Espero ter ajudado vocês!
- whereis - busca por arquivos executáveis, man pages, arquivos de configuração e fontes.
- which - busca por executáveis nos PATHs exportados.
# whereis named.conf
named: /usr/sbin/named /etc/named.conf /usr/share/man/man8/named.8.gz
# whereis httpd
httpd: /usr/sbin/httpd /etc/httpd /usr/share/man/man8/httpd.8.gz
# which httpd
/usr/sbin/httpd
# which X /usr/bin/X11/X
Espero ter ajudado vocês!