Linux removing folders older than 1 year and more than 3 files
问题 I'm writing an ant script to clean up an archive folder Here's how I need to clean it up: I need to delete folders old than a certain amount of days AND has more than 3 files in it. So for example if a folder is 300 days old but only has 3 files than it will NOT be deleted. I know I can ssh into the archive and do find -mtime +365 -exec rm -rf {} ;\ to delete files older than 1 year but I don't know how to account for the minimum of 3 files I also know that find -type f | wc -l will list the