Created
January 20, 2019 15:14
-
-
Save DerEnderKeks/639b4345c002c69bdb13b2e6b4e1acbc to your computer and use it in GitHub Desktop.
Delete old files from the Downloads folder
This file contains 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
#!/usr/bin/env bash | |
# Works with Git-Bash | |
echo "Deleting files..." | |
find "$HOME/Downloads/" -type f -mtime +3 -exec rm -f {} \; | |
echo "Deleting empty directories..." | |
find "$HOME/Downloads/" -type d -empty -delete | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment