-
-
Save asiellb/c6067cff503d576d8c7267beaee5402a to your computer and use it in GitHub Desktop.
Shell script to remove (delete) old files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# removes files older than 10 days under specific dir | |
find /my/dir -mtime +10 -type f -delete | |
# another example: deleting files older than 2 days under current dir | |
find . -mtime +2 -type f -delete | |
# deleting files older than 5h (5*60min=250min) under current dir | |
find . -mmin +250 -type f -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment