Windows
Linux
Text Processing
Windows type (end of file / logs) equivalent in Linux
Shows the last N lines of a file. With -f, follows the file in real-time — essential for watching logs.
Windows
→
type (end of file / logs)
Linux equivalents
tail
tail
tail
Overview
What this command does
Shows the last N lines of a file. With -f, follows the file in real-time — essential for watching logs.
Migration tip:
tail -f is one of the most-used Linux commands for live log monitoring. Use it on multiple files at once — it labels each line with the filename.Practical tasks
Common use cases
Display the last lines of a file
Shows the last N lines of a file. With -f, follows the file in real-time — essential for watching logs.
tail file.txt
Last 10 lines (default)
tail -n 50 file
Last 50 lines
tail -f file.log
Follow live (Ctrl+C to stop)
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
tail /var/log/syslog
tail -n 100 error.log
tail -f /var/log/nginx/access.log
tail -f /var/log/nginx/*.log
Walkthrough
Examples with explanations
# No direct Windows CMD equivalent
tail /var/log/syslog # last 10 lines
tail -n 100 error.log # last 100 lines
# Watch a log in real-time:
tail -f /var/log/nginx/access.log
# Follow multiple files:
tail -f /var/log/nginx/*.log
Reference
Common options and variations
| Command or option | Use |
|---|---|
tail file.txt | Last 10 lines (default) |
tail -n 50 file | Last 50 lines |
tail -f file.log | Follow live (Ctrl+C to stop) |
tail -f f1.log f2.log | Follow multiple log files |
tail -n +2 file.csv | All lines except the first (skip header) |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | tail |
Same command on this distribution. |
| Fedora | same command | tail |
Same command on this distribution. |
| Arch | same command | tail |
Same command on this distribution. |
Keep learning