大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全家桶1年46,售后保障稳定
名称
whereis – 定位一个“命令”的二进制文件、源文件、手册文件。
用法
whereis [options] [-BMS directory… -f] name…
描述
whereis 定位一个指定“命令”的二进制文件、源文件、手册文件的位置。提供的名称首 先去除前导路径名组件和任何(单个)尾随 .ext 扩展名(例如:.c)。使用源代码控制 产生的前缀 “s.” 也得到处理。然后 whereis 尝试在标准 Linux 位置以及 $PATH 和 $MANPATH 指定的位置中定位所需的程序。
选项
-b 只搜索二进制文件。
-m 只搜索手册文件。
-s 只搜索源文件。
-u 只展示有特殊条目的命令名称。如果一个命令对于每个明确请求的类型不只有 一个条目,则称该命令是不寻常的。因此 “whereis -m -u *” 请求在当前目录中 没有文档文件或有多个文档文件的文件。
-B list 使用空格分隔的目录列表限制查找二进制文件的范围。
-M list 使用空格分隔的目录列表限制查找手册文件的范围。
-S list 使用空格分隔的目录列表限制查找源文件的范围。
-f 终止目录列表并表示文件名的开始。
-l 输出 whereis 使用的有效查找路径的列表。 当指定非 -B、-M 或 -S 时,该选项 将输出该命令能够在系统上找到的硬编码路径。
使用示例:
1. whereis:展示二进制文件、源文件、手册文件的位置。
[root@server bin]# whereis ls
ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz
2. whereis -b/m/s:只展示其中一项。
[root@server bin]# whereis -b ls
ls: /usr/bin/ls
[root@server bin]# whereis -m ls
ls: /usr/share/man/man1/ls.1.gz
[root@server bin]# whereis -s ls
ls:[root@server bin]#
3. whereis -B/M/S:限定查找目录,必须使用 -f ,否则 whereis 会把命令名当成目录
[root@server bin]# whereis -s -S /usr/src -f ls
ls:[root@server bin]# whereis -m -M /usr/share/man/man1 -f ls
ls: /usr/share/man/man1/ls.1.gz
[root@server bin]# whereis -b -B /usr/bin -f ls
ls: /usr/bin/ls
4. whereis -u:限定特殊命令。
[root@server bin]# whereis -u -ms -M /usr/man/man1 -S /usr/src -f *
ar: /usr/bin/ar /usr/include/ar.h
at: /usr/bin/at /etc/at.deny
awk: /usr/bin/awk /usr/libexec/awk /usr/share/awk
cancel: /usr/bin/cancel.cups /usr/bin/cancel
cancel: /usr/bin/cancel.cups /usr/bin/cancel
cloud-init: /usr/bin/cloud-init /usr/lib/cloud-init
cpio: /usr/bin/cpio /usr/include/cpio.h
cpp: /usr/bin/cpp /usr/lib/cpp
crontab: /usr/bin/crontab /etc/crontab
dracut: /usr/bin/dracut /usr/sbin/dracut /usr/lib/dracut /etc/dracut.conf
file: /usr/bin/file /usr/share/file
fipscheck: /usr/bin/fipscheck /usr/lib64/fipscheck
gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc
genl-ctrl-list: /usr/bin/genl-ctrl-list /usr/sbin/genl-ctrl-list
getconf: /usr/bin/getconf /usr/libexec/getconf
getopt: /usr/bin/getopt /usr/include/getopt.h
gettext: /usr/bin/gettext /usr/bin/gettext.sh /usr/lib64/gettext /usr/share/gettext
gettext: /usr/bin/gettext /usr/bin/gettext.sh /usr/lib64/gettext /usr/share/gettext
gio: /usr/bin/gio /usr/lib64/gio
groff: /usr/bin/groff /etc/groff /usr/share/groff
hostname: /usr/bin/hostname /etc/hostname
iconv: /usr/bin/iconv /usr/include/iconv.h
info: /usr/bin/info /usr/share/info
lastlog: /usr/bin/lastlog /usr/include/lastlog.h
ld: /usr/bin/ld.gold /usr/bin/ld /usr/bin/ld.bfd
ld: /usr/bin/ld.gold /usr/bin/ld /usr/bin/ld.bfd
ld: /usr/bin/ld.gold /usr/bin/ld /usr/bin/ld.bfd
link: /usr/bin/link /usr/include/link.h
locale: /usr/bin/locale /usr/lib/locale /etc/locale.conf /usr/include/locale.h /usr/share/locale
login: /usr/bin/login /etc/login.defs
lp: /usr/bin/lp /usr/bin/lp.cups
lp: /usr/bin/lp /usr/bin/lp.cups
lpq: /usr/bin/lpq /usr/bin/lpq.cups
lpq: /usr/bin/lpq /usr/bin/lpq.cups
lpr: /usr/bin/lpr /usr/bin/lpr.cups
lpr: /usr/bin/lpr /usr/bin/lpr.cups
lprm: /usr/bin/lprm /usr/bin/lprm.cups
lprm: /usr/bin/lprm /usr/bin/lprm.cups
lpstat: /usr/bin/lpstat /usr/bin/lpstat.cups
lpstat: /usr/bin/lpstat /usr/bin/lpstat.cups
lua: /usr/bin/lua /usr/lib64/lua /usr/share/lua
mail: /usr/bin/mail /etc/mail.rc
mailq: /usr/bin/mailq.postfix /usr/bin/mailq
mailq: /usr/bin/mailq.postfix /usr/bin/mailq
man: /usr/bin/man /usr/share/man
mysql: /usr/bin/mysql /usr/lib64/mysql /usr/share/mysql
newaliases: /usr/bin/newaliases /usr/bin/newaliases.postfix
newaliases: /usr/bin/newaliases /usr/bin/newaliases.postfix
nl-class-add: /usr/bin/nl-class-add /usr/sbin/nl-class-add
nl-class-delete: /usr/bin/nl-class-delete /usr/sbin/nl-class-delete
nl-classid-lookup: /usr/bin/nl-classid-lookup /usr/sbin/nl-classid-lookup
nl-class-list: /usr/bin/nl-class-list /usr/sbin/nl-class-list
nl-cls-add: /usr/bin/nl-cls-add /usr/sbin/nl-cls-add
nl-cls-delete: /usr/bin/nl-cls-delete /usr/sbin/nl-cls-delete
nl-cls-list: /usr/bin/nl-cls-list /usr/sbin/nl-cls-list
nl-link-list: /usr/bin/nl-link-list /usr/sbin/nl-link-list
nl-pktloc-lookup: /usr/bin/nl-pktloc-lookup /usr/sbin/nl-pktloc-lookup
nl-qdisc-add: /usr/bin/nl-qdisc-add /usr/sbin/nl-qdisc-add
nl-qdisc-delete: /usr/bin/nl-qdisc-delete /usr/sbin/nl-qdisc-delete
nl-qdisc-list: /usr/bin/nl-qdisc-list /usr/sbin/nl-qdisc-list
openssl: /usr/bin/openssl /usr/lib64/openssl
os-prober: /usr/bin/os-prober /usr/share/os-prober
p11-kit: /usr/bin/p11-kit /usr/libexec/p11-kit /usr/share/p11-kit
passwd: /usr/bin/passwd /etc/passwd
ping6: /usr/bin/ping6 /usr/sbin/ping6
pip: /usr/bin/pip2.7 /usr/bin/pip
pip2: /usr/bin/pip2 /usr/bin/pip2.7
pip2: /usr/bin/pip2 /usr/bin/pip2.7
plymouth: /usr/bin/plymouth /usr/lib64/plymouth /etc/plymouth /usr/libexec/plymouth /usr/share/plymouth
printf: /usr/bin/printf /usr/include/printf.h
pstree: /usr/bin/pstree /usr/bin/pstree.x11
pstree: /usr/bin/pstree /usr/bin/pstree.x11
pwd: /usr/bin/pwd /usr/include/pwd.h
python: /usr/bin/python2.7-config /usr/bin/python2.7 /usr/bin/python /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7
python2: /usr/bin/python2.7-config /usr/bin/python2.7 /usr/bin/python2 /usr/lib/python2.7 /usr/lib64/python2.7 /usr/include/python2.7
python2: /usr/bin/python2.7-config /usr/bin/python2.7 /usr/bin/python2 /usr/lib/python2.7 /usr/lib64/python2.7 /usr/include/python2.7
python2: /usr/bin/python2.7-config /usr/bin/python2.7 /usr/bin/python2 /usr/lib/python2.7 /usr/lib64/python2.7 /usr/include/python2.7
rmail: /usr/bin/rmail /usr/bin/rmail.postfix
rmail: /usr/bin/rmail /usr/bin/rmail.postfix
rpm: /usr/bin/rpm /usr/lib/rpm /etc/rpm
screen: /usr/bin/screen /usr/share/screen
setup-nsssysinit: /usr/bin/setup-nsssysinit.sh /usr/bin/setup-nsssysinit
setup-nsssysinit: /usr/bin/setup-nsssysinit.sh /usr/bin/setup-nsssysinit
ssh: /usr/bin/ssh /etc/ssh
strings: /usr/bin/strings /usr/include/strings.h
sudo: /usr/bin/sudo /etc/sudo.conf /usr/libexec/sudo
tar: /usr/bin/tar /usr/include/tar.h
time: /usr/bin/time /usr/include/time.h
tracepath: /usr/bin/tracepath /usr/sbin/tracepath
tracepath6: /usr/bin/tracepath6 /usr/sbin/tracepath6
udevadm: /usr/bin/udevadm /usr/sbin/udevadm
updatedb: /usr/bin/updatedb /etc/updatedb.conf
vim: /usr/bin/vim /usr/share/vim
wait: /usr/bin/wait /usr/include/wait.h
yum: /usr/bin/yum /etc/yum /etc/yum.conf
5. whereis -l:输出有效查找路径。
[root@server bin]# whereis -l
bin: /usr/bin
bin: /usr/sbin
bin: /usr/lib
bin: /usr/lib64
bin: /etc
bin: /usr/etc
bin: /usr/games
bin: /usr/local/bin
bin: /usr/local/sbin
bin: /usr/local/etc
bin: /usr/local/lib
bin: /usr/local/games
bin: /usr/include
bin: /usr/local
bin: /usr/libexec
bin: /usr/share
man: /usr/share/man/man7
man: /usr/share/man/cs
man: /usr/share/man/es
man: /usr/share/man/man0p
man: /usr/share/man/zh_CN
man: /usr/share/man/tr
man: /usr/share/man/pl
man: /usr/share/man/fr
man: /usr/share/man/man4x
man: /usr/share/man/id
man: /usr/share/man/man1
man: /usr/share/man/man6x
man: /usr/share/man/man1x
man: /usr/share/man/man7x
man: /usr/share/man/man8x
man: /usr/share/man/man8
man: /usr/share/man/man3
man: /usr/share/man/man6
man: /usr/share/man/pt
man: /usr/share/man/man3p
man: /usr/share/man/man9
man: /usr/share/man/man5x
man: /usr/share/man/de
man: /usr/share/man/nl
man: /usr/share/man/sv
man: /usr/share/man/mann
man: /usr/share/man/zh_TW
man: /usr/share/man/pt_BR
man: /usr/share/man/ru
man: /usr/share/man/ja
man: /usr/share/man/man2x
man: /usr/share/man/man5
man: /usr/share/man/man4
man: /usr/share/man/da
man: /usr/share/man/man3x
man: /usr/share/man/man2
man: /usr/share/man/hu
man: /usr/share/man/ko
man: /usr/share/man/sk
man: /usr/share/man/man1p
man: /usr/share/man/man9x
man: /usr/share/man/it
src: /usr/src/kernels
src: /usr/src/debug
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/219180.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...