Display the last part of files and follow updates in real time.
tail shows the last lines of a file, typically used for logs. It can also follow files as they grow, making it essential for monitoring live output.
# Last 10 lines tail file.txt # Last 20 lines tail -n 20 file.txt # Follow file updates tail -f logfile
# Follow multiple logs tail -f /var/log/syslog /var/log/auth.log # Show last 100 lines tail -n 100 app.log # Follow with retry (for rotating logs) tail -F app.log # Combine with grep tail -f app.log | grep ERROR
-f follows a file as it grows-F handles log rotation better