Linux Bash – Delete old directories and files

To remove files older then 5 days:

findĀ /path/to/files* -mtime +5 -exec rm {} \;

Source

To remove files and directories older then 3 days:

find /path/to/dir/ -type d -mtime +3 -exec echo "Removing Directory => {}" \; -exec rm -rf "{}" \;

Source