Linux中whatis命令是 什么意思,linux基础入门命令---whereis、whatis、which命令

whereis命令:locate the binary, source, and manual page files for a command

【功能】查找文件、手册页、命令等的相关位置,

【语法】whereis options argument

【常用选项】-b:只查找二进制文件位置

-m:只查找手册页部分

【实例1】查找二进制文件所在位置[root@perthon50 tmp]# whereis -b passwd

passwd: /usr/bin/passwd /etc/passwd

[root@perthon50 tmp]# whereis -b shadow

shadow: /etc/shadow /usr/include/shadow.h

【实例2】查找manual手册页[root@perthon50 tmp]# whereis -m passwd

passwd: /usr/share/man/man1/passwd.1.gz /usr/share/man/man5/passwd.5.gz

[root@perthon50 tmp]# whereis -m cd

cd: /usr/share/man/man1/cd.1.gz /usr/share/man/man1p/cd.1p.gz

[root@perthon50 tmp]# whereis -m sort

sort: /usr/share/man/man1/sort.1.gz /usr/share/man/man3/sort.3pm.gz /usr/share/man/man1p/sort.1p.gz

whatis命令:search the whatis database for complete words

【功能】在whatis库中搜寻特定的命令

【语法】whatis COMMAND

【实例】[root@perthon50 tmp]# whatis passwd

passwd               (1)  - update user's authentication tokens

passwd               (5)  - password file

passwd [sslpasswd]   (1ssl)  - compute password hashes

[root@perthon50 tmp]# whatis sort

sort                 (1p)  - sort, merge, or sequence check text files

sort                 (1)  - sort lines of text files

sort                 (3pm)  - perl pragma to control sort() behaviour

which命令:shows the full path of (shell) commands

【功能】查看可执行命令的路径

【语法】

which COMMAND

【实例】[root@perthon50 tmp]# which ls

alias ls='ls --color=auto'

/bin/ls

[root@perthon50 tmp]# which passwd

/usr/bin/passwd

[root@perthon50 tmp]# which cd

/usr/bin/which: no cd in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

[root@perthon50 tmp]# which sort

/bin/sort

[root@perthon50 tmp]# which shutdown

/sbin/shutdown

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值