tail: output the last part of files
tail [-n N] [-f] [file]...
Options you will use
-n N- Print the last N lines (default 10). -n +N starts AT line N.
-f, --follow- Keep the file open and print new lines as they are appended. Ctrl+C to stop.
-F- Like -f but retry if the file is rotated or does not exist yet.
Examples
$ tail -f /var/log/nginx/error.logwatch a log live
$ tail -n +2 file.csvskip the header row
Taught in
- 13.26 Logging drivers, and the log file that fills the disk
- 24.30 Operating Vault: health, audit devices, snapshots, the seal, upgrades, OpenBao
- 27.1 What an SRE owns in PostgreSQL
- 27.2 Install: clusters, files, the service and settings
- 27.7 Roles, privileges and pg_hba.conf
- 27.47 WAL, archiving and point-in-time recovery
- 27.52 Replication and failover
- 34.14 Roles and STS: trust policies, assume-role and temporary credentials
On the blog
Try tail in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.