Linux Commands Helper
💬 Your AI-powered Linux assistant
tail Command - View End of File
The tail command displays the last part of files. It is often used to monitor log files in real-time.
Syntax
tail [options] [file...]
Examples
tail /var/log/syslog
Display the last 10 lines of /var/log/syslog.
tail -n 20 /var/log/syslog
Display the last 20 lines of /var/log/syslog.
tail -f /var/log/syslog
Continuously monitor /var/log/syslog for new lines.
Notes
- The
-f
option is commonly used for real-time log monitoring. - You can combine options such as
-n
and-f
(e.g.,tail -n 20 -f file
).