how do i list just the first and last of a listing?
I have a series of files of this pattern:
name.log.nnn.gz. I'd like to list just the first and last one, and being that linux is so robust I wonder how many different or better ways to do this there are. This works: ls -g name.log.001.gz name.log.999.gz but it would be nice to use 'head' 'tail' 'gawk' etc. Ideas? |
Quote:
Code:
$ ls -g | head -1; ls -g | tail -1 Code:
$ ls -g > /tmp/listing.$$ |
no no, i was looking for exactly that -- ";". Silly simple things...
Thanks a bunch :) |
All times are GMT -5. The time now is 09:54 AM. |