2021 11 30 find命令的乙個問題

2022-09-10 11:36:14 字數 539 閱讀 1261

找出/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如何一起使用

find 命令 Linux命令篇 find命令

find name txt o name pdf print演示結果 find regex txt pdf iregex 忽略大小寫的正則 查詢所有非txt文字 find name txt print演示結果 列印出當前目錄的檔案 深度為1 find maxdepth 1 type f演示結果 5....

find命令的擴充套件

3.find 1.locate filename 在檔案資料庫中搜尋filename資訊,updatedb更新檔案資料庫 2.find find 查詢位置 條件 條件值 exec 動作 name not 條件 user 所屬使用者查詢 group 所屬組查詢 size 檔案大小查詢 perm 按照許...

find命令的引數

find path option action 與時間有關的引數 mtime ctime atime n n為數字 n天之前 n 在n天之內 包含n天 n 在n天之前 不含n天 newer file 列出比file還要新的檔案 有關使用者和組名的引數 uid n n為數字 這個數字是使用者帳號的id...