terminal.cab

All commands

head

Topic: Text

Program: head

Shows the start of files.

Package: text

Usage

head [OPTION]... [FILE]...

Description

Show the start of each FILE, 10 lines unless told otherwise. A FILE named -, or no FILE, means the keyboard or pipe. -NUM as the first argument is the same as -n NUM.

Options in the simulator

4 more options of the real program, not in the simulator yet
  • -q, --quiet, --silent not in the simulator yet

    Explanation to come

  • -v, --verbose not in the simulator yet

    Explanation to come

  • -z, --zero-terminated not in the simulator yet

    Explanation to come

  • --version not in the simulator yet

    On a real system it prints the version of the program.

Examples

From the lesson Looking into files: cat, less, head and tail
head -n 3 projects/website/server.log
08:00 server started
08:01 GET /index.html 200
08:02 GET /style.css 200

Try it in the terminal

From the command of the day: head -n
head -n 3 Documents/notes.txt
Buy milk
Call the landlord
Water the plants

Try it in the terminal

Where you learn it

Lessons

Command of the day

All commands