Viewing Content

tail

Shows the last lines of a file or follows new output.

tail is commonly used for logs because the newest entries are usually at the end.

Syntax
tail [options] [file]

Arguments explained

  • file is optional; without it, tail reads standard input.
  • -n chooses the number of lines.
  • -f follows appended output.
  • -F follows by filename across rotations.

Common examples

Watch a log
tail -f /var/log/syslog

Prints new lines as they are written.

Show recent entries
tail -n 50 app.log

Shows the last 50 lines.

tail Command
FieldDetails
Commandtail
CategoryViewing Content
Primary useShows the last lines of a file or follows new output.
Syntaxtail [options] [file]