Computing.Net > Forums > Unix > Script to delete old files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Script to delete old files

Reply to Message Icon

Name: Daniel
Date: October 25, 2002 at 13:14:47 Pacific
OS: IRIX
CPU/Ram: 900MHz
Comment:

Hi

I need a script to delete all files that were created more than x number of days ago.

Any ideas

Cheers



Sponsored Link
Ads by Google

Response Number 1
Name: Parimal
Date: October 25, 2002 at 13:35:30 Pacific
Reply:

This command will delete all files that were modified 1 day ago
find /tmp -type f -mtime +1 -exec rm {} \;

Note: Pls see find command on more options
Directory name is /tmp
and file types are ordinary (-type f)


0
Reply to Message Icon

Related Posts

See More







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: Script to delete old files

Deleting old files using ftp script www.computing.net/answers/unix/deleting-old-files-using-ftp-script/4257.html

Writing batch script to delete files www.computing.net/answers/unix/writing-batch-script-to-delete-files/120.html

Script to delete lines from a file www.computing.net/answers/unix/script-to-delete-lines-from-a-file/7408.html