Answers for "search for text in files linux grep"

3

grep text in files

grep -rnw '/path/to/somewhere/' -e 'pattern'

-r or -R is recursive,
-n is line number, and
-w stands for match the whole word.
-l (lower-case L) can be added to just give the file name of matching files.
-e is the pattern used during the search
Posted by: Guest on November-01-2021
8

find text in any file linux

grep -rnw '/path/to/somewhere/' -e 'pattern'
Posted by: Guest on January-23-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language