Mar

8

Search under Linux

By admin

- To search something in all of the disk :
locate "file or folder"
- To search something with path (word in all files) :
find /path/to/dir/ | xargs grep --color "1234" -n
find ../../ -name "*.c" | xargs grep --color "long"
or
grep -r "1234" *

NB: for find : “-L” to follow the symbolic link; for grep “-r” <= recursive; "-n" <= display line number

- To search where is installed an executable on disk :
which “software_name”
$> which nautilus
/usr/bin/nautilus