Linux常用命令(十六) - whereis
来源:互联网 发布:阿里云二手域名 编辑:程序博客网 时间:2024/05/18 00:17
whereis命令只能用于程序名的搜索(程序安装在哪?),而且只搜索二进制文件(参数-b)、man说明文件(参数-m)和源代码文件(参数-s)。如果省略参数,则返回所有信息。
和find相比,whereis查找的速度非常快,这是因为linux系统会将系统内的所有文件都记录在一个数据库文件中,当使用whereis和下面即将介绍的locate时,会从数据库中查找数据,而不是像find命令那样,通过遍历硬盘来查找,效率自然会很高。但是该数据库文件并不是实时更新,默认情况下时一星期更新一次,因此,我们在用whereis和locate查找文件时,有时会找到已经被删除的数据,或者刚刚建立文件,却无法查找到,原因就是因为数据库文件没有被更新。
1.命令格式:
whereis [-bmsu] [BMS 目录名 -f ] 文件名
2.命令功能:
whereis命令是定位可执行文件、源代码文件、帮助文件在文件系统中的位置。这些文件的属性应属于原始代码,二进制文件,或是帮助文件。whereis 程序还具有搜索源代码、指定备用搜索路径和搜索不寻常项的能力。
3.命令参数:
-b 定位可执行文件。
-m 定位帮助文件。
-s 定位源代码文件。
-u 搜索默认路径下除可执行文件、源代码文件、帮助文件以外的其它文件。
-B 指定搜索可执行文件的路径。
-M 指定搜索帮助文件的路径。
-S 指定搜索源代码文件的路径。
4.使用实例:
实例一:将和**文件相关的文件都查找出来
命令:whereis svn
[root@localhost ~]# whereis tomcattomcat:[root@localhost ~]# whereis svnsvn: /usr/bin/svn /usr/local/svn /usr/share/man/man1/svn.1.gz
命令:
whereis -b svn 查找可执行文件路径
whereis -m svn 查找说明文档路径
whereis -s svn 查找源文件路径
[root@localhost ~]# whereis -b svnsvn: /usr/bin/svn /usr/local/svn[root@localhost ~]# whereis -m svnsvn: /usr/share/man/man1/svn.1.gz[root@localhost ~]# whereis -s svnsvn:[root@localhost ~]#
- Linux常用命令(十六) - whereis
- Linux常用命令(十六) - whereis
- Linux常用命令:whereis 命令
- linux常用命令(17):whereis命令
- linux常用命令locate,which,whereis,grep
- linux常用命令(locate,whereis,which,find,grep)
- Linux常用命令(二十六) - gzip
- Linux 常用命令——which, whereis, locate, find
- linux下cat/more/whereis/locate等常用命令介绍
- Linux常用命令之whereis,which,find和grep命令
- Linux常用命令——搜索which,whereis,slocate,find,grep
- Linux入门:常用命令:man、which、whereis、whatis、whoami命令帮助
- linux ------ whereis
- linux-whereis
- linux whereis
- linux常用命令—— 设备管理(十六)
- 《Linux》天影linux系列笔记一——linux常用命令详解:whereis
- Linux常用命令002之搜索命令locate、whereis、which、find、grep
- Ubuntu linux下安装sqlite3
- Hibernate注解详细说明
- linux内核系统调用和标准C库函数的关系分析
- 第12周项目4.1 银行系统的简单框架
- JAVA fastjson 使用
- Linux常用命令(十六) - whereis
- 线性表实验相关程序代码
- 基于PageRank的社交网络用户影响力
- sDBVGfhfdh
- “黑暗潜伏者” -- 手机病毒新型攻击方式
- C的union的应用
- C/C++枚举注册表某项下的所有子项【代码示例】
- 系统测试
- 在线框架引用|bootstrap|jq|jqmobile|CSS框架