terminal.cab

All commands

tail

Topic: Text

Program: tail

Shows the end of files.

Package: text

Usage

tail [OPTION]... [FILE]...

Description

Show the end 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

11 more options of the real program, not in the simulator yet
  • -f not in the simulator yet

    On a real system tail -f keeps waiting for new lines until you press Ctrl+C. The simulator can't wait.

  • --follow value optional not in the simulator yet

    On a real system tail -f keeps waiting for new lines until you press Ctrl+C. The simulator can't wait.

  • -F not in the simulator yet

    On a real system tail -f keeps waiting for new lines until you press Ctrl+C. The simulator can't wait.

  • --max-unchanged-stats needs a value not in the simulator yet

    Explanation to come

  • --pid needs a value not in the simulator yet

    Explanation to come

  • -q, --quiet, --silent not in the simulator yet

    Explanation to come

  • --retry not in the simulator yet

    Explanation to come

  • -s, --sleep-interval needs a value 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
tail -n 3 projects/website/server.log
08:27 GET /favicon.ico 404
08:29 GET /index.html 200
08:30 server stopped

Try it in the terminal

From the lesson Reading logs without drowning
tail -n 3 logs/app.log
09:41:02 INFO  request served in 84ms
09:41:09 ERROR db timeout after 5000ms
09:41:10 INFO  retry ok
head -n 2 logs/app.log
09:12:04 INFO  worker 1 started
09:12:04 INFO  worker 2 started

Try it in the terminal

From the command of the day: tail -n
tail -n 2 logs/app.log
WARN slow response
ERROR payment failed

Try it in the terminal

Where you learn it

Lessons

Command of the day

All commands