head

Linux · Text · available in the simulator

What it does

Output the first part of files.

Syntax

head [-n líneas] [-c bytes] [archivo...]

Options and parameters

  • -n N

    First N lines.

  • -c N

    First N bytes.

  • -n

    Print the specified number of lines; defaults to 10.

    head -n 20 archivo.log
  • -c

    Print the specified number of bytes.

  • -q

    Never print headers with file names.

Usage examples

  • head archivo.txt
  • head -n 20 archivo.txt
  • head -c 100 archivo.txt
  • head -c 100 archivo.bin
  • head -n 20 archivo.log
Practise head

Related commands