Apache httpd Log File...interesting...

owaters

Registered
Hello all,

I am wondering if anyone knows of a way to get the log file for httpd (/var/log/httpd/access_log) to show the last 20 lines.

I am farmiliar with:
tail /var/log/httpd/access_log

...but it just doesn't show enough!

Thanks
 
try tail -20 /var/log/httpd/access_log



Originally posted by owaters
Hello all,

I am wondering if anyone knows of a way to get the log file for httpd (/var/log/httpd/access_log) to show the last 20 lines.

I am farmiliar with:
tail /var/log/httpd/access_log

...but it just doesn't show enough!

Thanks
 
I just thought I would add my 2 cents here.

In contrast to "tail", you can get the first 20 lines ( or how ever many you want ) of a file by using "head". For example, ...

head -n20 somefile.txt

...gives you the first 20 lines of the somefile.txt file.

m(_ _)m
 
This is fun too:

tail -f /var/log/httpd/access_log

...Whenever the file changes you see the new lines in real time. CTRL-C gets you out.
 
Back
Top