天天看点

linux指令 -- find

find (搜索文件)

一、常用指令

1、find -name “文件名” :当前目录下搜索文件  子目录也会被搜索

2、find -type (文件类型) -name “文件名” :在当前目录下搜索指定文件类型与文件名的文件

文件类型:

1、b 块设备文件

2、d 目录

3、c 字符设备文件

4、p 管道文件

5、l 符号链接文件

6、f  普通文件

二、例

1、find -name “hello.c”

2、find -name "x*"  :搜索以x为开头的文件名的文件

3、find -name “*.c” :搜索文件后缀为.c的文件

4、find -type f -name “hello.c” :搜索文件名为hello.c的普通文件