2021-11-30 find命令的一个问题

找出/etc下面,容量大于1500KB以及容量等于0的文件

[root@localhost ~]# find /etc -size 0k -o -size +1500k -exec ls -lh {} \;
-r--r--r--. 1 root root 8.6M 11月 18 17:13 /etc/udev/hwdb.bin
-rw-r--r--. 1 root root 3.8M 11月 18 17:11 /etc/selinux/targeted/policy/policy.31
-rw-------. 1 root root 3.8M 11月 18 17:11 /etc/selinux/targeted/active/policy.kern
-rw-------. 1 root root 3.8M 11月 18 17:11 /etc/selinux/targeted/active/policy.linked

exec ls -lh 只会显示后面 -size 大于1500k 的 文件 并不会将前面的条件加上

疑问:-o 和 -exec如何一起使用

posted @ 2021-11-30 16:17  学习让我充实  阅读(59)  评论(0)    收藏  举报