Living in the Shell #20; tail (Display/Follow File Content)
Babak K. Shandiz
Posted on December 20, 2021
tail
⛵
Display or follow file content.
ℹ️ Here, following means streaming a file while it's being updated (appended).
ℹ️ You can use -c
in place of -n
in the following examples, to switch to binary offset selection.
Print bottom N lines of a file -n
tail -n 5 ~/.bashrc
Prints last 5 lines of
~/.bashrc
Print from N-th line afterwards -n +N
tail -n +3 ~/.bashrc
Prints
~/.bashrc
from the 3rd line until the end.
Following syslog
events -f
tail -f /var/log/syslog
Follows system logs (on Debian/Ubuntu).
💖 💪 🙅 🚩
Babak K. Shandiz
Posted on December 20, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.