FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 06-19-2012, 08:33 AM
John R Pierce
 
Default we want to delete all files in a folder except the files with the most recent date

On 06/19/12 12:26 AM, maverh@telenet.be wrote:
> We want to delete all files in a folder except the files with...

man find


I suggest you get a book on basic unix systems management.




--
john r pierce N 37, W 122
santa cruz ca mid-left coast

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-19-2012, 02:13 PM
Ken godee
 
Default we want to delete all files in a folder except the files with the most recent date

#!/bin/sh
find /files/* -mtime +2 -exec rm {} ;



On 6/19/2012 12:26 AM, maverh@telenet.be wrote:
>
>
> Hi,
>
> We want to delete all files in a folder except the files with the most recent date
> example
>
> ls -l
> jun 3 10:45 file1
> jun 3 12:20 file2
> jun 2 10:20 file3
> jun 2 05:00 file4
> jun 1 12:00 file5
> jun 1 10:00 file6
>
> jun2 en jun1 must be deleted
>
> regards,
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 10:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org