Global Regular Expression Print
Jump to navigation
Jump to search
grep
Print lines from text that match patterns, basic regex is used by default
Use
grep /etc/ssh/sshd_config pattern match pattern in /etc/sshd_config, case sensitive
Useful Flags
-E use extended regex
-i case insensitive
-A x print x lines after matched pattern
-B x print x lines before matched pattern
-C x print x lines before and after matched pattern, results separated by "--"
-n print line number from file
-o only print matched pattern
-R search all files in given folder
-v inverse match
-w match whole words only