in reply to Writing many lines to a file

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