Linux which/whereis/locate命令详解
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命令详解的更多相关文章
- Linux上的free命令详解、swap机制
Linux上的free命令详解 解释一下Linux上free命令的输出. 下面是free的运行结果,一共有4行.为了方便说明,我加上了列号.这样可以把free的输出看成一个二维数组FO(Free ...
- Linux CAT与ECHO命令详解 <<EOF EOF
Linux CAT与ECHO命令详解 cat命令是Linux下的一个文本输出命令,通常是用于观看某个文件的内容的: cat主要有三大功能: .一次显示整个文件. $ cat filename .从键盘 ...
- [r]Ubuntu Linux系统下apt-get命令详解
Ubuntu Linux系统下apt-get命令详解(via|via) 常用的APT命令参数: apt-cache search package 搜索包 apt-cache show package ...
- Linux CAT与ECHO命令详解
Linux CAT与ECHO命令详解 cat命令是Linux下的一个文本输出命令,通常是用于观看某个文件的内容的: cat主要有三大功能: 1.一次显示整个文件. $ cat filename 2.从 ...
- (转)Linux: dirname、basename命令详解
Linux: dirname.basename命令详解 原文:http://blog.sina.com.cn/s/blog_3f63916f010143vo.html 一.dirname指令 1.功能 ...
- Linux下面的yum命令详解
yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...
- linux应用之yum命令详解
linux yum命令详解 yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能 ...
- Linux服务管理 systemctl命令详解
Linux服务器,服务管理--systemctl命令详解,设置开机自启动 syetemclt就是service和chkconfig这两个命令的整合 任务 旧指令 新指令 使某服务自动启动 ch ...
- centos、linux关机与重启命令详解
Linux centos关机与重启命令详解与实战 Linux centos重启命令: 1.reboot 2.shutdown -r now 立刻重启(root用户使用) 3.shutdown -r 1 ...
随机推荐
- HihoCoder - 1478 水陆距离
水陆距离 描述 给定一个N x M的01矩阵,其中1表示陆地,0表示水域.对于每一个位置,求出它距离最近的水域的距离是多少. 矩阵中每个位置与它上下左右相邻的格子距离为1. 输入 第一行包含两个整数, ...
- sparkthriftserver启动及调优
Sparkthriftserver启用及优化 1. 概述 sparkthriftserver用于提供远程odbc调用,在远端执行hive sql查询.默认监听10000端口,Hiveserver2默 ...
- <MYSQL Index>
About Mysql 1. Mysql工作流程分析 2. Mysql单实例安装(5.6.31) DATABASE 1. 事务的4种隔离级别 ——————————————————Mysql管理———— ...
- BATJ面试必会之Java IO 篇
一.概览 二.磁盘操作 三.字节操作 实现文件复制 装饰者模式 四.字符操作 编码与解码 String 的编码方式 Reader 与 Writer 实现逐行输出文本文件的内容 五.对象操作 序列化 S ...
- vue基于d2-admin的RBAC权限管理解决方案
前两篇关于vue权限路由文章的填坑,说了一堆理论,是时候操作一波了. vue权限路由实现方式总结 vue权限路由实现方式总结二 选择d2-admin是因为element-ui的相关开源项目里,d2-a ...
- DataGridView删除多行选中数据
思路是找到最先选择和最后选择到的行 ,弄一个for循环,根据这些行的索引值在执行数据的删除. 我这里用了EF. DialogResult result = MessageBox ...
- js中var与let
问题 for (var iii = 0; iii < 3; iii++) { setTimeout(function(){ console.debug(iii) }, 1000) let let ...
- Leetcode 计划
如何正确高效地使用LeetCode? LeetCode按照怎样的顺序来刷题比较好? LeetCode 题目总结/分类 Leetcode 简略题解 - 共567题 500. Keyboard Row [ ...
- 实现一个符合 RESTful 架构的程序
前言:在网上经常看到 RESTful,十分好奇,于是自己来试试. 代码地址:https://github.com/yuleGH/restdemo 首先,介绍一下 RESTful 架构:理解 RESTf ...
- MySQL内连接和外连接
INNER JOIN(内连接,或等值连接):获取两个表中字段匹配关系的记录. LEFT JOIN(左连接):获取左表所有记录,即使右表没有对应匹配的记录. RIGHT JOIN(右连接): 与 LEF ...