perl -ne "print "$.\t$_" if m/whatever/" file.txt