[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] grep -P



-laugh-

I didn't know GNU grep has a command line switch for "Perl regular expressions"...

Grab all the lines from myfile.txt that start with chr3 and then a tab:
grep -P "^chr3\t" filename.txt

Or, you could just use Perl:
perl -ne 'print if (/^chr3\t/)' filename.txt

:)

j