Computing.Net > Forums > Unix > Remove old files from Dir > 60 days

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Remove old files from Dir > 60 days

Reply to Message Icon

Name: babu.dwh
Date: June 6, 2007 at 19:49:37 Pacific
OS: UNIX
CPU/Ram: 512 MB RAM
Product: 2006
Comment:

Hello,

We are saving some files in the UNIX directory with the naming convention "ABC_yyyymmddhhmi.txt". Our requirement is to remove files from this directory which are 60 days old. Any help to script down this is very much appreciated.

Thanks in Advance

Thanks,
Babu



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: June 7, 2007 at 06:34:23 Pacific
Reply:

find /yourdir -type f -name "ABC_*txt" -mtime +60 -ls

use the above first. verify the files are found, then use

find /yourdir -type f -name "ABC_*txt" -mtime +60 -exec rm {} \;


0
Reply to Message Icon

Related Posts

See More


Read the content and chec... Creating Script to Shutdo...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Remove old files from Dir > 60 days

Remove old hosts from known_hosts www.computing.net/answers/unix/remove-old-hosts-from-knownhosts/8330.html

Unix cmd for find and remove www.computing.net/answers/unix/unix-cmd-for-find-and-remove/2376.html

prevent a file from being removed.. www.computing.net/answers/unix/prevent-a-file-from-being-removed/4884.html