An Interest In:
Web News this Week
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
December 20, 2021 07:41 pm GMT
Print bottom N lines of a file
Print from N-th line afterwards
Following
Original Link: https://dev.to/babakks/living-in-the-shell-20-tail-displayfollow-file-content-3nm1
Living in the Shell 20; tail (Display/Follow File Content)
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).
Original Link: https://dev.to/babakks/living-in-the-shell-20-tail-displayfollow-file-content-3nm1
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To