The tail command in Linux

Ok, so I'm not really a *nix guy. I just happen to know a few handful commands in Linux. I kind of wonder why some people get angry when you ask them something about what they know about Linux. I remember talking to a friend of mine and I asked him how I should organize my files in Linux. He answered,

f*ck, just arrange it anyway you like

I don't know if that's suppose to be a joke or something... The question was came from a Linux newbie and I think that wasn't the correct response. It's not nice to be stingee about that things  you know... So I'm sharing something I learned from my work today while using putty. :)


Ok, how do you list the last 100 lines in a textfile in Linux?

using the command

tail -n 100 mytext.txt

lists the last 100 lines from mytext.txt. Before, I used to do

cat mytext.txt to list the content of a log file, and it gets really annoying especially if you're browsing through a file with a huge file size.


This makes life very convenient indeed...
Published 01-17-2007 2:23 AM by lamia
Filed under:

Comments

Wednesday, January 17, 2007 1:09 PM by cruizer

# re: The tail command in Linux

yeah one of the things I miss in Windows is not being able to do something like

tail -f somelogfile.txt

and see that console window change as content is added to somelogfile.txt. good thing there's tailforwin32.sourceforge.net :)

Thursday, January 18, 2007 5:29 AM by lamia

# re: The tail command in Linux

Thanks Cruizer! That's even better! :)