`
cakin24
  • 浏览: 1333145 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

Linux命令搜索命令whereis与which

阅读更多

一 whereis

1、语法
whereis 命令名
搜索命令所在的路径以及帮助文档所在的位置
选项:
-b:只查找可执行文件
-m:只查找帮助文件
2、实战
  1. [root@localhost ~]# whereis ls
  2. ls:/usr/bin/ls /usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz
  3. [root@localhost ~]# whoami
  4. root
  5. [root@localhost ~]# whatis
  6. whatis what?
  7. [root@localhost ~]# whatis ls
  8. ls (1)- list directory contents
  9. ls (1p)- list directory contents
  10. [root@localhost ~]# whereis -b ls
  11. ls:/usr/bin/ls
  12. [root@localhost ~]# whereis -m ls
  13. ls:/usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz
二 which
1、语法
which 命令名
搜索命令所在路径及别名
2、实战
  1. [root@localhost ~]# which ls
  2. alias ls='ls --color=auto'
  3. /usr/bin/ls
  4. [root@localhost ~]# which pwd
  5. /usr/bin/pwd
  6. [root@localhost ~]# whereis cd
  7. cd:/usr/bin/cd /usr/share/man/man1/cd.1.gz/usr/share/man/man1p/cd.1p.gz
  8. [root@localhost ~]# which cd
  9. /usr/bin/cd
三 PATH环境变量
定义的是系统搜索命令的路径
  1. [root@localhost ~]# echo $PATH
  2. /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
分享到:
评论

相关推荐

    Linux命令搜索命令whereis与which的区别

    Linux命令搜索命令whereis与which的区别 一 whereis 1、语法 whereis 命令名 搜索命令所在的路径以及帮助文档所在的位置 选项: -b:只查找可执行文件 -m:只查找帮助文件 2、实战 [root@localhost ~]# ...

    Linux下which、whereis、locate、find 命令的区别

    本文档详细介绍了在Linux系统下which、whereis、locate、find 命令的区别,具体的应用方法,结合案例,非常的实用

    linux下which、whereis、locate、find命令的区别.docx

    linux下which、whereis、locate、find命令的区别.docx

    Linux常见命令与shell脚本

    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编辑器 ...

    Linux命令搜索工具linux-command.zip

    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...

    Linux 常用操作命令大全(最后更新时间:2024年1月).md

    另外还总结了find、whereis、which、sudo、grep等实用工具命令,以及系统管理中的防火墙设置、主机名修改、网络配置、进程管理等常见任务的相关命令使用方式。 总的来说,这是一份内容丰富、知识面广、实用性强的...

    基础的Linux常用命令

    在此我就介绍几条比较基础的Linux命令帮助大家入门。 1. man 对你熟悉或不熟悉的命令提供帮助解释 eg:man ls 就可以查看ls相关的用法 注:按q键或者ctrl+c退出,在linux下可以使用ctrl+c终止当前程序运行。 2. ls...

    Linux which命令的具体使用

    我们经常在linux要查找某个文件,但不知道放在哪里了,可以使用下面的一些命令来搜索: which 查看可执行文件的位置。 whereis 查看文件的位置。 locate 配合数据库查看文件位置。 find 实际搜寻硬盘查询文件...

    Linux教程,主要内容:Linux 命令、Linux 系统运维、软件运维、精选常用Shell脚本.zip

    查看 Linux 命令帮助信息 - 关键词:help, whatis, info, which, whereis, man Linux 文件目录管理 - 关键词:cd, ls, pwd, mkdir, rmdir, tree, touch, ln, rename, stat, file, chmod, chown, locate, find, cp, ...

    Linux命令大全(CHM格式离线版)

    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基础详解课程30.基本命令-whereis,which.mp4

    大数据基础-Linux基础详解课程

    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 命令全集

    这是因为 Linux 系统会将系统内的所有档案都记录在一个数据库档案里面,而当使用 whereis 或者是底下要说的 locate 时,都会以此数据库档案的内容为准,因此,有的时后你还会发现使用这两个执行档时,会找到已经被杀...

    Linux命令笔记

    4:whereis 搜索命令所在目录级帮助文档路径 语法:whereis[命令名称] 5:grep 在文件中搜索字串匹配的行并输出 语法:grep -iv[指定字串][文件] 6:uname 显示当前操作系统名称 常用命令/压缩解压 1:gzip 压缩文件 ...

    Linux命令大全

    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命令与文件查找

    which [-a] command //其中参数-a是指列出找到所有命令,而非只显示找到的第一个 例如:which ifconfig 二、文件名的查找 1、whereis(寻找特定文件) whereis [-bmsu] filename/directoryname -b :只找二进制的...

    Linux基础知识(4): 文件搜索命令

    文章目录1 文件搜索——locate2 命令搜索——whereis与which3 文件名搜索——find命令4 字符串搜索——grep 注:转载请标明原文出处链接:https://xiongyiming.blog.csdn.net/article/details/105856510 1 文件...

    Linux系统配置及服务管理:文件查找

    (which is 或者 whereis vim ) locate:文件查找,依赖数据库。 而今天的主角find查找命令是在linux中最重要也是应用最多的,通常的用法是在指定目录里查找文件。 find的语法是 :find [ path…] [options] ...

Global site tag (gtag.js) - Google Analytics