Post Description: how to display show get last 10 lines from a file in linux shell command
how, to, display, show, get, last, 10, lines, from, a, file, in, linux, shell, command
This Post Has Been Viewed 835 Times Since Fri Feb 29, 2008 12:01 pm Posted By web hosting with 0 replies
POST# 214
Posted On: Fri Feb 29, 2008 12:01 pm
i had a very large file in my linux dedicated server i leased from www.webune.com and i wanted to see what were the last list, it was an error log file and it was huge, but opening would mean i would have to wait a while just to see the last lines. well, linux being such a wonderful operating system, it has the tail command so to see the last 10 lines on my error log file all i had to do is send this command in the linux shell and it would get and show me the last ten lines:
Code:tail error_log.txt
hey wait a minute, what about if you wanted to display the last 15 lines?
well you can do that with tail: this is how you would display them:
Code:tail -15 error_log.txt
you can change 15 to whatever number of lines you want