Skip to content
Search

Tail

lastmod 2023-03-09created 2015-10-205 edits

tail lets you view or monitor the last part of a file.

Example

By default, prints the last 10 lines of the file to the screen:

$ tail test

Print the last 20 lines:

$ tail -n 20 test

Print the last 200 bytes:

$ tail -c 200 test

Monitor a log file in real time (exit with Ctrl-c):

$ tail -f /var/log/messages

Windows alternative

As a replacement for the tail command (-f), use cat filename.txt -Wait -Tail 1000 in PowerShell.

See also

Favorite site

author Zer0 sitemap