写在前面
本文主要记录linux环境下常用的搜索命令。
find、locate、which、whereis
★find:硬盘搜索,查询速度较慢,但是输出准确
★locate:数据库查询,由于该数据库不是实时更新,故存在新建文件查询不到、已删文件的脏读问题。查询速度快。
★which:主要用于可执行文件
的查询
whereis:定位可执行文件、源文件、帮助文件位置。查询数据库,速度较快存在输出数据不准确的问题。
1.find
硬盘查询

2.locate
数据库查询文件地址

3.which
可执行文件查询
注:仅返回查询到的第一条数据

4.whereis
定位可执行文件、源代码文件、帮助文件在文件系统中的位置

网友评论