108 words
1 minutes
Linux commands: tail
2022-09-01

Linux commands: tail#

The tail command in Linux is used to display the last part of a file. It is commonly used to monitor log files in real-time.

Basic Usage#

To display the last 10 lines of a file, use the following command:

tail filename

Displaying a Specific Number of Lines#

To display a specific number of lines from the end of a file, use:

tail -n number filename

Monitoring a File in Real-Time#

To monitor a file in real-time and display new lines as they are added, use:

tail -f filename

Conclusion#

The tail command is a powerful tool for viewing the end of files and monitoring log files in real-time. It is essential for system administrators and developers.


Linux commands: tail
https://zxce3.net/posts/cli/linux-commands-tail/
Author
Memet Zx
Published at
2022-09-01