How to monitor log files in real time on Linux?
This method/trick can be used on Unix, Linux or Mac platforms.
Here it goes:
1. SSH on your server first.
2. Type # tail -f /var/log/httpd/access_log
Note: # is the prompt, do not type it. :)
3. The command above will show you the last few lines of the log file. If you are familiar with tail command, this is no surprise. But the -f flag will print you any new lines added to the log file in real-time.
By this way you can easily get the live traffic to your server.
If you feel like monitoring and tracing the output based on a specific IP address, then type
# tail -f /var/log/httpd/access_log | grep '192.168.3.127'
This method/trick can be used on Unix, Linux or Mac platforms.
Here it goes:
1. SSH on your server first.
2. Type # tail -f /var/log/httpd/access_log
Note: # is the prompt, do not type it. :)
3. The command above will show you the last few lines of the log file. If you are familiar with tail command, this is no surprise. But the -f flag will print you any new lines added to the log file in real-time.
By this way you can easily get the live traffic to your server.
If you feel like monitoring and tracing the output based on a specific IP address, then type
# tail -f /var/log/httpd/access_log | grep '192.168.3.127'
No comments:
Post a Comment