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 …


This content originally appeared on DEV Community and was authored by Babak K. Shandiz

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).


This content originally appeared on DEV Community and was authored by Babak K. Shandiz


Print Share Comment Cite Upload Translate Updates
APA

Babak K. Shandiz | Sciencx (2021-12-20T19:41:07+00:00) Living in the Shell #20; tail (Display/Follow File Content). Retrieved from https://www.scien.cx/2021/12/20/living-in-the-shell-20-tail-display-follow-file-content/

MLA
" » Living in the Shell #20; tail (Display/Follow File Content)." Babak K. Shandiz | Sciencx - Monday December 20, 2021, https://www.scien.cx/2021/12/20/living-in-the-shell-20-tail-display-follow-file-content/
HARVARD
Babak K. Shandiz | Sciencx Monday December 20, 2021 » Living in the Shell #20; tail (Display/Follow File Content)., viewed ,<https://www.scien.cx/2021/12/20/living-in-the-shell-20-tail-display-follow-file-content/>
VANCOUVER
Babak K. Shandiz | Sciencx - » Living in the Shell #20; tail (Display/Follow File Content). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/12/20/living-in-the-shell-20-tail-display-follow-file-content/
CHICAGO
" » Living in the Shell #20; tail (Display/Follow File Content)." Babak K. Shandiz | Sciencx - Accessed . https://www.scien.cx/2021/12/20/living-in-the-shell-20-tail-display-follow-file-content/
IEEE
" » Living in the Shell #20; tail (Display/Follow File Content)." Babak K. Shandiz | Sciencx [Online]. Available: https://www.scien.cx/2021/12/20/living-in-the-shell-20-tail-display-follow-file-content/. [Accessed: ]
rf:citation
» Living in the Shell #20; tail (Display/Follow File Content) | Babak K. Shandiz | Sciencx | https://www.scien.cx/2021/12/20/living-in-the-shell-20-tail-display-follow-file-content/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.