[Omaha.pm] grep -P

Jay Hannah jay at jays.net
Mon Jul 16 10:41:23 PDT 2007


-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



More information about the Omaha-pm mailing list