Find Command

From Wiki
Jump to navigation Jump to search

Find and Delete Files with Specific Extension

find /var/log -name "*.log" -type f -mtime +30 -delete 

Find and Delete Files older Than 30 Days

find /opt/backup -type f -mtime +30 -delete 

Delete Directory older than 30 days Recursively

find /var/log -type d -mtime +30 -exec rm -rf {} \;