Skip to content

Instantly share code, notes, and snippets.

@DerEnderKeks
Created January 20, 2019 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DerEnderKeks/639b4345c002c69bdb13b2e6b4e1acbc to your computer and use it in GitHub Desktop.
Save DerEnderKeks/639b4345c002c69bdb13b2e6b4e1acbc to your computer and use it in GitHub Desktop.
Delete old files from the Downloads folder
#!/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