-group GroupName:根据属组查找
-uid UID 根据用户id查找
-gid GID 根据组ID查找
-nouser:查找没有属主的文件(ps:假若当前用户tom创建了一个文件a,现在tom用户被删除了。文件a就是没有属主属组的)
-nogroup:查找没有属组的文件
[root@mysql5 ~]# useradd tom
[root@mysql5 ~]# passwd tom
Changing password for user tom.
New password:
BAD PASSWORD: it is WAY too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@mysql5 ~]# touch a
[root@mysql5 ~]# chown tom.tom a
[root@mysql5 ~]# ls -la a
-rw-r--r--. 1 tom tom 0 Dec 30 01:54 a
[root@mysql5 ~]# userdel -r tom
[root@mysql5 ~]# ls -la a
-rw-r--r--. 1 500 500 0 Dec 30 01:54 a
[root@mysql5 ~]# find -nouser
./a
[root@mysql5 ~]#
3.组合条件:
-a:与,同时满足
-o:或
-not,!:非取反[root@mysql5 ~]# touch 1 22 ab
[root@mysql5 ~]# ls
1 22 a ab abcd aBCd anaconda-ks.cfg install.log install.log.syslog
[root@mysql5 ~]# find -name a -o -name 1
./a
./1
4.根据文件类型或大小查找:
1)-type:根据文件类型查找:
f:普通文件
d:目录
b:块文件
c:字符文件
l:符号链接设备
p:命名管道设备
s:套接字
[root@mysql5 ~]# ls
1 22 a ab abc abcd aBCd anaconda-ks.cfg install.log install.log.syslog test
[root@mysql5 ~]# find -type d
.
./abc
./test
2)-size:根据文件大小查找
find可以根据文件的时间戳来查找:
-amin n 查找系统中最后N分钟访问的文件
-atime n 查找系统中最后n天小时访问的文件
-cmin n 查找系统中最后N分钟被改变文件状态的文件
-ctime n 查找系统中最后n天被改变文件状态的文件
-mmin n 查找系统中最后N分钟被改变文件数据的文件
-mtime n 查找系统中最后n天被改变文件数据的文件
#min后接时间是分钟,time后接时间是天数 6.根据文件权限查找: