On Wed, Oct 14, 2009 at 04:43:04PM +1030, Matthew Smith wrote: > Quoth Håkon Alstadheim at 14/10/09 16:37... >> Due to all the positive feed-back, I actually tested the "ls -rt"-bit, >> and sure enough, the 'r' makes ls list the newest files _last_, so you >> DON'T want 'r'. This makes the correct command: >> >> rm $(ls -t | sed '1,2d') > > I thought this looked like an interesting recipe, so I tried it. (With > echo, I hasten to add.) > > I get a listing of every file (and directory) in the directory, but all > on one line. > > All the sed seems to do is to convert the multiple spaces used to format > ls -t into single spaces.
try: ls $PARAMETERS | cat 'ls' defaults to a single-column format when the output is a pipe. -- Tzafrir Cohen | tzaf...@jabber.org | VIM is http://tzafrir.org.il | | a Mutt's tzaf...@cohens.org.il | | best ICQ# 16849754 | | friend -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org