Tail

From LQWiki
Jump to navigation Jump to search

The tail program is a tool used to view the last few lines of a file.

For a cool graphical version, see root-tail.

Examples

It's frequently useful to see only the last 20 or so lines of a log file (which would have the most recent 20 entries), for example if there's something that just went wrong with my computer.

  • See only the last 20 lines of the file /var/log/messages
$ tail -20 /var/log/messages
  • To continously monitor the file /var/log/messages
$ tail -f /var/log/messages

Provided by

Most (all?) Linux distributions incorporate this from the GNU Coreutils: and use its man page

See Also

External links