以下两条命令查询出来的文件是不一样的:
find ~/workspace/ -iname "test.log.*" -o -iname "test.profile.*" -ctime +10
find ~/workspace/ -iname "test.log.*" -o -iname "test.profile.*" -ctime +10 -exec ls -lh {} \;
对于第一个语句,问题在于-o的优先级低于-a的优先级,所以得到的结果是包含了ctime在10天以内的文件
所以需要加一对括号来指定优先级:
find ~/workspace/ \( -iname "test.log.*" -o -iname "test.profile.*" \) -ctime +10
标签:profile,10,iname,笔记,命令,test,find,ctime
From: https://www.cnblogs.com/lifewithlight/p/17057581.html