find
時間相關
-mtime : 指定時間段被修改過的文件
-ctime : 指定時間段被修改文件狀態的文件
-atime : 指定時間段被訪問過的文件
- -amin n 在n分鐘之前的那一分鐘
- -cmin -n 在n分鐘之內
- -mmin +n 在n分鐘之前
- -atime n 在n*24小時前的那24小時
[root@localhost /]# find / -atime 1 #查找距離現在24小時前的那24小時內訪問過的文件
- -ctime -n n*24小時前到現在
[root@localhost /]# find / -ctime -1 #查找距現在1*24小時前到現在修改過文件權限的文件(其實==-mtime 0)
- -mtime +n 在n*24小時前的時間內
[root@localhost /]# find / -mtime +2 #查找距現在2*24小時前修改過的文件```
***用戶/組相關***
-user:所屬主的文件
-nouser:沒有所屬組的文件
-group:所屬組的文件
***其他***
-name 按文件全名查找(也可以寫成通配符格式)
-iname 按文件全名查找(不區分大小寫)
-type 按文件類型查找(f:file l:link d:dir)
-size n(文件大小為nk)/+n(文件大小大于nk)
[root@localhost /]# find / -iname file -type f -size 0
/proc/filesystems
/proc/sys/fs/file-nr
/proc/sys/fs/file-max
/tmp/myfile
>######grep
[testuser@localhost test]$ pwd
/home/testuser/test
[testuser@localhost test]$ ll
總用量 4
-rw-rw-r--. 1 testuser testuser 63 12月 13 02:45 test.txt
[testuser@localhost test]$ cat test.txt
This is Test File
a b c d e
1 2 3 4 5
pangxie yungou jishu bu