perl -ne 'print if /ab/' file.txt