bash find, only delete files - order of arguments
问题 Say today is April 8th and I execute the following in bash. cd /tmp mkdir hello touch -d 2015-04-01 hello Then, say I want to delete all files in /tmp that are older than one day, but NOT directories and I execute this: find /tmp -mtime +1 -delete -type f Why is directory "hello" deleted if it's not a file? Thanks! 回答1: The find command executes the expression in order. Since -delete is before -type , -type is never reached. Try: find /tmp -mtime +1 -type f -delete 回答2: David C. Rankin's