Confusion about tail usage

stan stanb at panix.com
Mon Feb 18 15:15:29 UTC 2008


I am trying to write a quick shell script to delete all but the newest 3
files in a directory. Getting a list sorted by time, I use ls -t. I figured
I could use tail to print all the lines in it's input file, skipping the
first 3 lines. I expected tail -n +3 would do this. But it does not.

What am I doing wrong?

-- 
One of the main causes of the fall of the roman empire was that, lacking
zero, they had no way to indicate successful termination of their C
programs.




More information about the ubuntu-users mailing list