perl -ne '$count++ while /seek/ig; print $count,"\n" if eof;' file.txt