Viewing the Last 20 Lines of a Log File in Real-Time
作者:XD / 发表: 2024年5月31日 06:09 / 更新: 2024年5月31日 06:10 / 编程笔记 / 阅读量:905
When working with log files, it's often crucial to quickly check the most recent entries. The tail
command in Unix-like operating systems is a handy tool for this purpose. In this post, we'll look at how to use tail -n 20 notes.log
to view the last 20 lines of a log file.
The tail
Command
The tail
command displays the end of a file. By default, it shows the last 10 lines, but you can customize this number with the -n
option.
Using tail -n 20
To see the last 20 lines of a file, you use:
tail -n 20 notes.log
相关标签