grep Hacks

When searching for IPs use ‘grep -w‘ to get the exact IP match only; otherwise grepping ‘12.4.55.6’ will also give you 12.4.55.66, etc.

When exctracting strings with grep use ‘grep -o‘ option to get ONLY the matching pattern, not the rest of the line.

Use ‘grep -c‘ to get match count in each file.

Advertisements

Comments are closed.

%d bloggers like this: