find 命令使用(2)
find 查詢命令
-size |
查詢指定檔案的大小;大於+100M(K,M,G);-100小於;100 等於 |
-mtime |
指定時間查詢;+5是5天前的;-5是5天后的;5第5天 |
-perm |
查詢許可權 |
說明:由這個時間我們可以知道,最右邊為當前時,+5 代表大於等於6 天前的檔案名, -5 代表小於等於5 天內的檔案名,5 則是代表5-6 那一天的檔案名
例項:
[[email protected] atsshell]# find ./ -type f -mtime +5
./atsmenu.sh
./ats-text.sh
./atsscripts/chinese.txt
[[email protected] atsshell]# find / -type f -size +100M|xargs ls -lhr
find: `/proc/14744/task/14744/fdinfo/5': No such file or directory
find: `/proc/14744/fdinfo/5': No such file or directory
-rw------- 1 root root 128M Sep 10 23:32 /sys/devices/pci0000:00/0000:00:0f.0/resource1_wc
-rw------- 1 root root 128M Sep 10 23:32 /sys/devices/pci0000:00/0000:00:0f.0/resource1
[email protected] atsshell]# find / -type f -perm 4755|xargs ls -l
find: `/proc/14782/task/14782/fdinfo/5': No such file or directory
find: `/proc/14782/fdinfo/5': No such file or directory
-rwsr-xr-x. 1 root root 77336 May 11 2016 /bin/mount
-rwsr-xr-x. 1 root root 38264 May 11 2016 /bin/ping
-rwsr-xr-x. 1 root root 36488 May 11 2016 /bin/ping6
-rwsr-xr-x. 1 root root 34904 May 11 2016 /bin/su
-rwsr-xr-x. 1 root root 53472 May 11 2016 /bin/umount