martedì 22 ottobre 2013

Ricerche ricorsive su Linux

Ricerca di un file

inizia dalla root

find . -name "*.xxx" -print    

da una cartella 
find path_cartella -name "*.xxx" -print    



Ricerca dentro un file

grep "cosaricercare" /directorydovecercare

The following is a modification of the above example that uses the star wildcard (i.e., an asterisk), which represents any character or sequence of characters, to search all text files in the current directory 

grep 'Linux is' *

grep -r .... se la si uole ricorsiva

You can force grep to ignore word case i.e match boo, Boo, BOO and all other combination with the -i option:

$ grep -i "boo" /etc/passwd 

Nessun commento:

Posta un commento