Search a string inside files
Command
grep -ir "string_pattern" 'directories'
Common used parameters
- -i, --ignore-case ignore case distinctions
- -R, -r, --recursive equivalent to --directories=recurse
- -n, --line-number print line number with output lines
- -E, --extended-regexp PATTERN is an extended regular expression (ERE)
- -L, --files-without-match print only names of FILEs containing no match
-l, --files-with-matches print only names of FILEs containing matches
--include=FILEPATTERN search only files that match FILEPATTERN
--exclude=FILEPATTERN skip files and directories matching FILEPATTERN
Type "grep --help" for more information!
Written by tkloong
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Related Tags
#shell
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#