Linux下搜索文件
1.which 查找可执行文件的绝对路径
#which vi
#which cat
2.whereis 查找文件 whereis [-bmsu] [文件名称]
-b 查找binary文件 -m 查找在说明文件manual路径下的文件
-s 查找source来源文件 -u查找没有说明文档的文件
#whereis ls
3.locate 查找文件 不适合精确搜索
4.find 搜索文件 find [路径] [参数]
参数: -atime +n/-n 访问或执行时间大于或小于n天的文件,
atime (Access time)读取文件或 执行文件时更改
-ctime +n/-n 写入、更改inode属性时间大于或小于n天的文件,
ctime(Create time)写入文件、更改所有者、权限或链接设置时随时间inde内容的更改而更改
-mtime+n/-n 写入时间大于或小于n天的文件,mtime(Modified time)写入文件时随文件内容的更改而更改
#find /tmp/ -mtime -1
#find /tmp/ -atime +1
-name file 直接查找该文件名的文件
#find . -name test2
-type file 通过文件类型查找文件 (f,b,c,d,l,s)
#find /tmp/ -type d