The head command reads the first few lines of any text given to it as an input and writes them to standard output.

# To output the first few lines of a file:
head -n count_of_lines filename

# To output the first few bytes of a file:
head -c size_in_bytes filename

# To output everything but the last few lines of a file:
head -n -count_of_lines filename

# To output everything but the last few bytes of a file:
head -c -size_in_bytes filename