docs:bash:remove_files_older_than

Remove files older than

# You want to find and remove tar.bz2 and tar.gz files older than 30 days
find . -name "*.tar.*" -mtime +30 -exec rm {} \;
 
# Same thing, but limit only to the current directory
find . -maxdepth 1 -name "*.tar.*" -mtime +30 -exec rm {} \;
  • docs/bash/remove_files_older_than.txt
  • Last modified: 2011/12/29 15:47
  • by billh