Bash and grep

From I Will Fear No Evil
Revision as of 14:57, 25 April 2024 by Chubbard (talk | contribs)
Jump to navigation Jump to search

Common grep switches

Show line number of match

grep -n <string> <file(s)>

Insensitive match

grep -i <string> <file(s)>

Before and after # lines from match

grep -A# -B# <string> <file(s)>