I struggled to figure out how to quickly delete files in a directory older than -x- days, but finally found the trick. Below is how I did it:
# find . -mtime +5 -maxdepth 1 -exec rm -rf {} \;
The -maxdepth option tells it not to do recursion, as deleting the directory would get rid of the file anyway. If you don’t want to do a rm -rf, just remove -rf and directories won’t be deleted.
GD Star Rating
loading...
loading...
GD Star Rating
loading...
loading...
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.