一 whereis
1、语法
whereis 命令名
搜索命令所在的路径以及帮助文档所在的位置
选项:
-b:只查找可执行文件
-m:只查找帮助文件
2、实战
[root@localhost ~]# whereis ls
ls:/usr/bin/ls /usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz
[root@localhost ~]# whoami
root
[root@localhost ~]# whatis
whatis what?
[root@localhost ~]# whatis ls
ls (1)- list directory contents
ls (1p)- list directory contents
[root@localhost ~]# whereis -b ls
ls:/usr/bin/ls
[root@localhost ~]# whereis -m ls
ls:/usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz
二 which
1、语法
which 命令名
搜索命令所在路径及别名
2、实战
[root@localhost ~]# which ls
alias ls='ls --color=auto'
/usr/bin/ls
[root@localhost ~]# which pwd
/usr/bin/pwd
[root@localhost ~]# whereis cd
cd:/usr/bin/cd /usr/share/man/man1/cd.1.gz/usr/share/man/man1p/cd.1p.gz
[root@localhost ~]# which cd
/usr/bin/cd
三 PATH环境变量
定义的是系统搜索命令的路径
[root@localhost ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
相关推荐
Linux命令搜索命令whereis与which的区别 一 whereis 1、语法 whereis 命令名 搜索命令所在的路径以及帮助文档所在的位置 选项: -b:只查找可执行文件 -m:只查找帮助文件 2、实战 [root@localhost ~]# ...
本文档详细介绍了在Linux系统下which、whereis、locate、find 命令的区别,具体的应用方法,结合案例,非常的实用
linux下which、whereis、locate、find命令的区别.docx
1.24 whereis和which查找命令所在目录 13 1.25 grep搜索文件内容 13 1.26 tar文档管理 14 1.27 gzip/gunzip 和 bzip2/bunzip2文件压缩/解压缩 15 1.28 unzip winzip文件解压缩 17 1.29 其他常用命令 17 2 vi编辑器 ...
diff、diffstat、file、find、git、gitview、ln、locate、lsattr、mattrib、mc、mcopy、mdel、mdir、mktemp、mmove、mread、mren、...whereis、which、cat、chattr、chgrp、chmod、chown、cksum、cmp、cp、cut、indent...
另外还总结了find、whereis、which、sudo、grep等实用工具命令,以及系统管理中的防火墙设置、主机名修改、网络配置、进程管理等常见任务的相关命令使用方式。 总的来说,这是一份内容丰富、知识面广、实用性强的...
在此我就介绍几条比较基础的Linux命令帮助大家入门。 1. man 对你熟悉或不熟悉的命令提供帮助解释 eg:man ls 就可以查看ls相关的用法 注:按q键或者ctrl+c退出,在linux下可以使用ctrl+c终止当前程序运行。 2. ls...
我们经常在linux要查找某个文件,但不知道放在哪里了,可以使用下面的一些命令来搜索: which 查看可执行文件的位置。 whereis 查看文件的位置。 locate 配合数据库查看文件位置。 find 实际搜寻硬盘查询文件...
查看 Linux 命令帮助信息 - 关键词:help, whatis, info, which, whereis, man Linux 文件目录管理 - 关键词:cd, ls, pwd, mkdir, rmdir, tree, touch, ln, rename, stat, file, chmod, chown, locate, find, cp, ...
whereis which cat chattr chgrp chmod chown cksum cmp cp cut indent 磁盘管理 cd df dirs du edquota eject lndir ls mcd mdeltree mdu mkdir mlabel mmd mmount mrd mzip pwd quota quotacheck quotaoff quotaon...
大数据基础-Linux基础详解课程
Linux命令大全完整版 目 录 目 录 I 1. linux系统管理命令 1 adduser 1 chfn(change finger information) 1 chsh(change shell) 1 date 2 exit 3 finger 4 free 5 fwhois 5 gitps(gnu interactive tools ...
这是因为 Linux 系统会将系统内的所有档案都记录在一个数据库档案里面,而当使用 whereis 或者是底下要说的 locate 时,都会以此数据库档案的内容为准,因此,有的时后你还会发现使用这两个执行档时,会找到已经被杀...
4:whereis 搜索命令所在目录级帮助文档路径 语法:whereis[命令名称] 5:grep 在文件中搜索字串匹配的行并输出 语法:grep -iv[指定字串][文件] 6:uname 显示当前操作系统名称 常用命令/压缩解压 1:gzip 压缩文件 ...
whereis which cat chattr chgrp chmod chown cksum cmp cp cut indent 磁盘管理 cd df dirs du edquota eject lndir ls mcd mdeltree mdu mkdir mlabel mmd mmount mrd mzip pwd quota quotacheck quotaoff quotaon...
which [-a] command //其中参数-a是指列出找到所有命令,而非只显示找到的第一个 例如:which ifconfig 二、文件名的查找 1、whereis(寻找特定文件) whereis [-bmsu] filename/directoryname -b :只找二进制的...
文章目录1 文件搜索——locate2 命令搜索——whereis与which3 文件名搜索——find命令4 字符串搜索——grep 注:转载请标明原文出处链接:https://xiongyiming.blog.csdn.net/article/details/105856510 1 文件...
(which is 或者 whereis vim ) locate:文件查找,依赖数据库。 而今天的主角find查找命令是在linux中最重要也是应用最多的,通常的用法是在指定目录里查找文件。 find的语法是 :find [ path…] [options] ...