in reply to Simple search and output

perl -ne 'print if /regex/' testfile

See perlrun for the switches, perlre for regex info, and print for printing.