Skip to content

Find Search Locate

Find file in specific location

Change location /opt/ Change what you are searching for, file name "go.d.plugin”

sudo find -O3 -L /opt/ -name "go.d.plugin”

Using grep to find txt in files

Search for word in file

For case insensitive use -i

grep WORD file.txt

Search case insensitive Word in file type

grep -i WORD *.txt

Search case insensitive Word in ANY file type

grep -i WORD *

RECURSION

-r, --recursive
        Read all files under each directory, recursively, following symbolic  links only if they are on the command line.
        Note that if no file operand is given, grep searches the working directory.  This is equivalent to the -d recurse option.

-R, --dereference-recursive
        Read  all  files under each directory, recursively. Follow all symbolic links, unlike -r.
Search recursively for word starting current directory
grep -r Word .
For case insensitive
grep -ir Word .
Search recursively for word starting in a specific directory
grep -r Word /path..
For case insensitive
grep -ir Word /path..
Search recursively for word starting current directory and in a specific file type
grep -ir --include="*.txt" Word .
Search recursively for sentence starting current directory
grep -ri "Word after word" .

Using Locate

Run the update before using locate to make sure you get accurate results

locate file_name
updatedb