HomeContact

Linux tail command

Published in Server
April 01, 2023
1 min read

The most commonly used command to view log files on a Linux server is tail.


The ‘tail’ command allows you to view a desired number of lines from the end of a log file, and can also display real-time logs. It is a commonly used command when viewing logs.


Show desired lines from the end.

You can specify the desired number of lines using the ‘-n’ option. tail -n [number of lines][logfile path]

tail -n 500 filename.log

This will display the last 500 lines of the ‘filename.log’ file.


How to view real-time logs

You can use the -f option.

tail -f filename.log

This will show real-time log in ‘filename.log’ file.



Tags

#server#linux#shell

Share


Previous Article
Creating URLs with Thymeleaf

Topics

Java
Other
Server

Related Posts

How to set Linux crontab time
April 25, 2023
1 min