🧀 Learn Linux

Commonly used · Reading and processing text

tail: Read the last few lines

Put in free practice

Syntax

tail [-n lines] [-f] [file…]

Options

-n
Specify the number of lines at the end
-f
The sandbox only shows the current snapshot

Examples

tail -n 1 logs/app.log

Usage and sandbox support

Real tail -f will continue to wait for new content in the file, and the sandbox will not be refreshed in the background.

Hands-on exercises

Full documentation ↗

Related commands