Ubuntu的which、whereis、locate和find命令


which 只能寻找执行文件 ,并在PATH变量里面寻找。

whereis 从linux文件数据库(/var/lib/slocate/slocate.db)寻找,所以有可能找到刚刚删除,或者没有发现新建的文件。

locate 同上,不过文件名是部分匹配。

find 是直接在硬盘上搜寻,功能强大,但耗硬盘,一般不要用。

相关内容