Help with 'tail' command!
Hi all.
I'm writing a simple bash script, and I need help with the 'tail' command; ok first of all I execute the 'ls' command and I pipe it to the 'tail' one with this option '-n N' where N is the number of lines I want to display. Now the point is the I need the FIRST N lines and not the LAST ones; I read in the 'man' of tail that if I use '+' before the number of lines I want to see. It doesn't work. Here it is: ls -l | tail -n +5 Ok, this is not running. Anyone can help? Thanx! |
Try this:
Code:
ls -l | tac | tail -n 5 |
Or just use head instead of tail (sounds like the beginning of a bad joke but it isn't :))
Håkan |
Thank you!
|
All times are GMT -5. The time now is 01:27 PM. |