Skip to content

Busqueda

Archivos con find/locate, texto con grep, ejecutables con which/type.


ComandoQué haceEjemplo
find / -name "f"Por nombre.find / -name "archivo.txt"
find … -inameSin importar mayúsculas.find /home -iname "foto.png"
find … -type d/fSolo dirs / archivos.find /home -type d -name "Documentos"
find … -size +10MPor tamaño.find / -type f -size +10M
find … -exec … \;Comando sobre cada match.find /tmp -name "*.log" -exec rm {} \;

ComandoQué haceEjemplo
grep pat fileBusca en un archivo.grep "error" archivo.log
grep -rRecursivo.grep -r "usuario" /etc/
grep -nCon número de línea.grep -n "config" settings.conf
grep -iIgnora mayúsculas.grep -i "Warning" log
grep -lSolo nombres de archivo.grep -l "root" /etc/*
grep -rniRecursivo + línea + case-insensitive.grep -rni "palabra" .

Terminal window
locate archivo.txt
sudo updatedb # actualizar índice de locate
which python3
whereis bash
type ls
history | grep "ssh"
ps aux | grep firefox
tar -tzf archivo.tar.gz | grep "config"
strings archivo.bin | grep "password"
ComandoQué hace
locateBúsqueda rápida por índice (hay que updatedb).
which / whereis / typeRuta o tipo de un comando.
history | grepComandos usados.
ps aux | grepProcesos.
strings | grepTexto legible en binarios.

Más sobre which: Which. Docs: man find, man grep.