Linux Read The First and The Last Line on Log File



If you want to see the first of 5 lines on csv/log/txt file

$ head 5 filename.csv


If you want to see the last of 5 lines on csv/log/txt file

$ tail 5 filename.csv

or

$ tail --lines=1000 filename.log


Source :

http://osr507doc.xinuos.com/en/OSTut/Reading_just_the_first_or_last_lines_of_a_file.html

Comments