improving grep skills
Found myself needing to search a large directory for a string, not knowing or caring about the capitalization of the string. Of course there’s a flag for that: -i
As a review the -r
does a recursive search of a directory and -n
prints the line number.
The i
for case-insensitive is common in RegEx pattern matching:
This is a JavaScript sample that does a global (aka all occurrences), case-insensitive replacement of t
to T
in the target string.