tail - check the end of the file

when dealing with logs, getting to the end of a huge file is a huge pain. Thats why tail was created.

tail is on most machines and can be used as such



tail filename[ENTER]

by default that shows the last 5 lines of the file.



tail -n 1000 filename

will show the last -n # of lines.


tail also has another useful feature, which is show the log file as it’s written to:

so

tail -f filename

will stay active showing you the log file as it’s written to on the screen. You can press Control and C at the same time to break out.

Give it a try on a web log file and hit a site, you’ll see your visit!

Leave a Comment