Re: keeping the two latest files on a folder
- From: Håkon Alstadheim <hakon@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 13 Oct 2009 21:35:19 +0200
Israel Garcia skrev:
Hi List,untested, run it with 'echo' in front first to test:
It's a simple question but difficult to me :-).
How can I delete all files on a folder /xxxx but keeping only the two
latest (newest) files?
rm $(ls -rt | sed '1,2d')
--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
- Follow-Ups:
- Re: keeping the two latest files on a folder
- From: Chris Jones
- Re: keeping the two latest files on a folder
- References:
- keeping the two latest files on a folder
- From: Israel Garcia
- keeping the two latest files on a folder
- Prev by Date: Re: keeping the two latest files on a folder
- Next by Date: Re: Could you recommend CD/DVD writer program?
- Previous by thread: Re: keeping the two latest files on a folder
- Next by thread: Re: keeping the two latest files on a folder
- Index(es):
Relevant Pages
|