which 查看可执行文件的位置,从全局环境变量PATH里面查找对应的路径,默认是找 bash内所规范的目录

whereis 查看文件的位置,配合参数-b,用于程序名的搜索,从linux数据库查找。

locate 配合数据库查看文件位置。

find 实际搜寻硬盘查询文件名称,效率低。

which常用命令参数

--version, -[vV] Print version and exit successfully.
--help, Print this help and exit successfully.
--skip-dot Skip directories in PATH that start with a dot.
--skip-tilde Skip directories in PATH that start with a tilde.
--show-dot Don't expand a dot to current directory in output.
--show-tilde Output a tilde for HOME directory for non-root.
--tty-only Stop processing options on the right if not on tty.
--all, -a Print all matches in PATH, not just the first
--read-alias, -i Read list of aliases from stdin.
--skip-alias Ignore option --read-alias; don't read stdin.
--read-functions Read shell functions from stdin.
--skip-functions Ignore option --read-functions; don't read stdin.

which常用的命令展示

which cp  ==> /bin/cp

whereis常用命令参数

# Usage:  whereis [ -sbmu ] [ -SBM dir ... -f ] name...

whereis  -b  cp    ==>which cp  ==> /bin/cp

locate常用命令参数

Usage: locate [OPTION]... [PATTERN]...
Search for entries in a mlocate database. -b, --basename match only the base name of path names
-c, --count only print number of found entries
-d, --database DBPATH use DBPATH instead of default database (which is
/var/lib/mlocate/mlocate.db)
-e, --existing only print entries for currently existing files
-L, --follow follow trailing symbolic links when checking file
existence (default)
-h, --help print this help
-i, --ignore-case ignore case distinctions when matching patterns
-l, --limit, -n LIMIT limit output (or counting) to LIMIT entries
-m, --mmap ignored, for backward compatibility
-P, --nofollow, -H don't follow trailing symbolic links when checking file
existence
-0, --null separate entries with NUL on output
-S, --statistics don't search for entries, print statistics about each
used database
-q, --quiet report no error messages about reading databases
-r, --regexp REGEXP search for basic regexp REGEXP instead of patterns
--regex patterns are extended regexps
-s, --stdio ignored, for backward compatibility
-V, --version print version information
-w, --wholename match whole path name (default)

locate常用的命令展示

locate cp   ==> which cp  ==> /bin/cp

Linux which/whereis/locate命令详解的更多相关文章

  1. Linux上的free命令详解、swap机制

    Linux上的free命令详解   解释一下Linux上free命令的输出. 下面是free的运行结果,一共有4行.为了方便说明,我加上了列号.这样可以把free的输出看成一个二维数组FO(Free ...

  2. Linux CAT与ECHO命令详解 <<EOF EOF

    Linux CAT与ECHO命令详解 cat命令是Linux下的一个文本输出命令,通常是用于观看某个文件的内容的: cat主要有三大功能: .一次显示整个文件. $ cat filename .从键盘 ...

  3. [r]Ubuntu Linux系统下apt-get命令详解

    Ubuntu Linux系统下apt-get命令详解(via|via) 常用的APT命令参数: apt-cache search package 搜索包 apt-cache show package ...

  4. Linux CAT与ECHO命令详解

    Linux CAT与ECHO命令详解 cat命令是Linux下的一个文本输出命令,通常是用于观看某个文件的内容的: cat主要有三大功能: 1.一次显示整个文件. $ cat filename 2.从 ...

  5. (转)Linux: dirname、basename命令详解

    Linux: dirname.basename命令详解 原文:http://blog.sina.com.cn/s/blog_3f63916f010143vo.html 一.dirname指令 1.功能 ...

  6. Linux下面的yum命令详解

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  7. linux应用之yum命令详解

    linux yum命令详解 yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能 ...

  8. Linux服务管理 systemctl命令详解

    Linux服务器,服务管理--systemctl命令详解,设置开机自启动 syetemclt就是service和chkconfig这两个命令的整合     任务 旧指令 新指令 使某服务自动启动 ch ...

  9. centos、linux关机与重启命令详解

    Linux centos关机与重启命令详解与实战 Linux centos重启命令: 1.reboot 2.shutdown -r now 立刻重启(root用户使用) 3.shutdown -r 1 ...

随机推荐

  1. springboot-7-配置druid数据源监视

    关于druid数据源的配置, 上个博客已经说过了,再说一遍吧 , 引入依赖 , 配置properties参数 , 编写servlet和filter提供页面监视 , 测试 1, 引入maven依赖 &l ...

  2. 在Ubuntu16.04上使用Autofs

    在Solaris上,autofs是默认安装的,可以通过/net/<NFS server>很方便地访问远程的共享目录.但在Linux上(例如Fedora或者Ubuntu),使用autofs则 ...

  3. jquery.dataTables动态列--转

    转自 https://www.cnblogs.com/lyeo/p/4765514.html jquery.dataTables  版本1.10.7 直接上代码: 0.table <table ...

  4. Redis debugging guide---官方

    Redis debugging guide Redis is developed with a great stress on stability: we do our best with every ...

  5. Hibernate框架 hilo 方式配置MySQL 数据库的主键自增

    hilo(高低位方式high low)是hibernate中最常用的一种生成方式,需要一张额外的表保存hi的值.保存hi值的表至少有一条记录(只与第一条记录有关),否则会出现错误.可以跨数据库. 创建 ...

  6. MVC下拉框Html.DropDownList 和DropDownListFor 的常用方法

    一.非强类型:Controller:ViewData["AreId"] = from a in Table                               select ...

  7. Uploadify火狐出现302错误

    $(function () { var auth = "@(Request.Cookies[FormsAuthentication.FormsCookieName] == null ? st ...

  8. MySql__centos6.5源码安装

    安装MySql步骤如下: 依赖包检查安装 配置防火墙 配置hosts文件 配置sysctl.cnf 检查是否安装mysql 如果有卸载掉(指的是没有用的mysql) 创建用户属组 创建相应目录并修改权 ...

  9. [javaSE] 变量的传值与传址

    变量:就是将不确定的数据进行存储.也就是需要在内存中开辟一个空间 这个空间需要一个名称,这个名称就是变量名 基本数据类型:byte,short,int,long,double,float,char,b ...

  10. Hive配置文件hive-site.xml

    <configuration> <property> <name>hive.metastore.warehouse.dir</name> <val ...