Busca rápida por arquivos no Linux
Dica publicada em Linux / Introdução
Busca rápida por arquivos no Linux
Os comandos "which" e "whereis" realizam a busca de arquivos no sistema de forma bem rápida, onde cada um apresenta uma forma de busca diferente:
# 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
- 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