Skip to main content
Home GrN.dk

Main navigation

  • Contact
  • Your Digital Project Manager
  • About Greg Nowak
  • Services
  • Portfolio
  • Container
    • Excel Freelancer
    • Kubuntu - tips and tricks
    • Linux Apache MySQL and PHP
    • News
    • Image Gallery

Delete Files and Folders Older Than X days

find /[FOLDER_NAME]/* -mtime +[OLDER_THAN_DAYS] -exec rm -rf {} \;

Example deletes all files and folders in tmp folder that are older than 180 days: find /tmp/* -mtime +180 -exec rm -rf {} \;

Last modified
2022-02-10
Tags
bash
Script
Linux

Review Greg on Google

Greg Nowak Google Reviews

 

Search

Recent content

  • Running Linux on T450s T495s T14, Thinkpads and Others
  • Sending Mails From A Linux Server
  • Skype For Linux Fix High CPU Consumption
  • Keyboard Mapping Kubuntu 20.04
  • Gregs IT and Logistics Optimization
  • Mounting Your Android Phone In Linux
  • Ubuntu Linux Flush DNS Cache
  • Converting PNG to SVG
  • Protocols h2 h2c http/1.1 Tips and Tricks
  • Delete Files and Folders Older Than X days
  • Ubuntu Select Touch Device
  • Portfolio
  • Shrink PDF In Linux
  • Linux Laptop Power Management TLP
  • SSH Tips and Tricks
  • Cloudflare API
  • Debugging PHP
  • KDE 5 Plasma Fix After Upgrade
  • Signing PDF documents
  • Canon 2010 Printer Tips and Tricks

GrN.dk web platforms, web optimization, data analysis, data handling - CSV files, spreadsheets Excel, and logistics.