Comandos “which” e “whereis”

August 24, 2009 by thiago
Filed under: Live Linux 

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?

  • whereis – busca por arquivos executáveis, man pages, arquivos de configuração e fontes.
  • which – busca por executáveis nos PATHs exportados.

Exemplos:

# 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

Ótima dica para quem se ve perdido no linux.

[]‘s

Comentários

Deixe seu comentário