常用查找命令总结

1. which 在 path 变量中查找,which nginx, which php等
2. whereis 查找二进制文件,源文件,帮助手册等,whereis bash等
3. locate 模板查找文件,在系统的文件数据库中查找,速度快,但不是实时的,locate /ect/my,实时的可以,先updatedb更新一下文件数据库
4. find 在磁盘中遍历文件,速度慢

find . -name "*.c" #列出所有.c结尾的文件
find . -type f #列出所有文件
find . -type d -name "*test*" #查找目录包含test的
find . -ctime -20 #过去20天被修改过的文件
find . -cmin -20 #过去20分钟被修改过的文件

posted @ 2020-08-08 16:46  全玉  阅读(349)  评论(0编辑  收藏  举报