http://www.perlmonks.org?node_id=982083


in reply to Writing many lines to a file

perl -ne 'print if $. <= 100' infile.txt > outfile.txt