-type c
File is of type c:
b block (buffered) special
c character (unbuffered) special
d directory
p named pipe (FIFO)
f regular file
l symbolic link; this is never true if the -L option or the -follow option is in effect, unless the
symbolic link is broken. If you want to search for symbolic links when -L is in effect, use
-xtype.
s socket
D door (Solaris)
find -type 可以指定文件的类型;比如查找当前文件夹下的所有以a打头的目录(目录也是文件)
find支持的文件检索类型可以区分普通文件和符号链接、目录等,但是二进制文件和文本文件无法直接通过find的类型区分出来;
file命令可以检查文件具体类型(二进制或文本):
可以用以下命令组合来实现查找本地目录下的所有二进制文件:
而文本文件可以这样查找:
可以到这里查看find更多的常见用法:
http://linuxtools-rst.readthedocs.org/zh_CN/latest/base/03_text_proces...
附:通过man find可以查看到find支持的文件检索类型: