常用查找命令总结

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分钟被修改过的文件

原文地址:https://www.cnblogs.com/mengff/p/13458409.html