# Apache httpd Log File...interesting...



## owaters (Jan 7, 2003)

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


----------



## nodak (Jan 7, 2003)

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.
> ...


----------



## owaters (Jan 8, 2003)

Excellent, thanks!


----------



## mntamago (Jan 8, 2003)

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


----------



## slur (Jan 8, 2003)

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.


----------



## mntamago (Jan 8, 2003)

Thanks for the info!  Enjoyed giving it a try.

m(_ _)m


----------

