Commands.app

tail

Text Processing

Display the last lines of a file

Options & Flags
Available options for this command
-n NUM

Print last NUM lines (default 10)

-f

Follow file, showing new lines as they are added

-F

Follow file, retry if file is renamed or deleted

Examples
Common usage examples

Display last 10 lines

tail file.txt

Display last 50 lines

tail -n 50 file.txt

Follow log file in real-time

tail -f /var/log/syslog
Notes
  • tail -f is essential for monitoring log files
  • Press Ctrl+C to stop following
Related Commands
You might also find these useful