← All commands
Topic hub Text Processing
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
Debian/Ubuntu same command
tail
Fedora same command
tail
Arch same command
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 optionUse
tail file.txtLast 10 lines (default)
tail -n 50 fileLast 50 lines
tail -f file.logFollow live (Ctrl+C to stop)
tail -f f1.log f2.logFollow multiple log files
tail -n +2 file.csvAll 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.

DistributionPackage manager / baseEquivalent commandDifference 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

Related Text Processing commands