head -n file.txt

Display only the first line of a text file:

head -1 file.txt

Display the 3 first lines of a text file:

head -3 file.txt