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. 在Java Web项目中,不用ActionContext类来获得tomcat部署项目的绝对路径

    例子:sendIosApns.class.getClassLoader().getResource("").getFile().replaceAll("%20" ...

  2. 短视频APP是如何开启你的美好生活的?

    欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由腾讯视频云终端团队发表于云+社区专栏 常青, 2008 年毕业加入腾讯,一直从事客户端研发相关工作,先后参与过 PC QQ.手机QQ. ...

  3. 文件触发式实时同步 Rsync+Sersync Rsync+Inotify-tools

    一.概述 1.Rsync+Sersync 是什么? 1)Sersync使用c++编写基于inotify开发的触发机制: 2)Sersync可以监控所监听的目录发生的变化(包括新建.修改.删除),具体到 ...

  4. 14.Iterator 和 for...of 循环

    Iterator 和 for...of 循环 Iterator 和 for...of 循环 Iterator(遍历器)的概念 JavaScript 原有的表示"集合"的数据结构,主 ...

  5. zTree中 checkbox 点击向文本框中赋值

    例子如下:第一个 文本框: <div class="content_wrap" style="height: 0;position: relative; " ...

  6. Head First Python学习笔记2——文件与异常

    文件处理 1.用open()就可以打开文件,但是请注意:文件里有中文请设置编码,如 :open("filepath","r",encoding="ut ...

  7. Jsp&Servlet入门级项目全程实录第8讲

    惯例广告一发,对于初学真,真的很有用www.java1234.com,去试试吧! 1.添加dao public int studentAdd(Connection con,Student studen ...

  8. Web前端开发工程师常用技术网站整理

    1.常用工具相关 有道云笔记 http://note.youdao.com/signIn/index.html 36镇-最好用的共享收藏夹 http://www.36zhen.com/ 浏览器同步测试 ...

  9. iOS 交互h5 - WKWebView

    众所周知,UIWebView存在内存问题,也就是当加载一个UIWebView时,内存会一直上升趋势无法得到释放.这样在使用UIWebView进行h5交互开发时会有很大的问题. 因而苹果增加了一个新的类 ...

  10. 使用IDEA工具配置和运行vue项目(详细其中的坑)

    刚来公司实习发现公司的前端使用的是vue,之前根本就没有听说过.然后一上来就需要看代码,but but 就是没有文档什么的东西, 就需要自己去研读,我就想去运行其中的前端和后端联调起来方便理解,结果在 ...