head
head
is a simple utility that displays the first n lines of a file, or input. By default, it prints the first 10 lines. To control the number of lines printed, use the -n
flag.
head myfile.txt
Output
line1 line2 line3 line4 line5 line6 line7 line8 line9 line10
head -n 3 myfile.txt
Output
line1 line2 line3