RE: remove old files from dictory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Creative use of "find" will do this type of thing for you.

Example: Remove files that haven't been modified in more than 30 days:
find /somedir \( -type f -a -mtime +30 \) -exec rm -f {} \;

-Steve 

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Jianping Zhu
Sent: Tuesday, January 04, 2005 11:34 AM
To: redhat-list@xxxxxxxxxx
Subject: remove old files from dictory

 OS redhat 9.0
 I have a huge direcory (more than 30 GB) I want to take all the files
and
 sub-dirctries which are created more than 
 two year ago out of the dicctory. Does anyone have a script to do this
 kind of work? 
 Thank

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list




-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux