SQL where,linux 命令:whereis詳解

 2023-10-27 阅读 29 评论 0

摘要:名稱 ? ? ? ? whereis - 定位一個“命令”的二進制文件、源文件、手冊文件。 用法 ? ? ? ??whereis [options] [-BMS directory... -f] name... SQL where、描述 ????????whereis 定位一個指定“命令”的二進制文件、源文件、手冊文件的位置。提供的名稱首? ? ? ? ? ? 先去除

名稱

? ? ? ? whereis - 定位一個“命令”的二進制文件、源文件、手冊文件。

用法

? ? ? ??whereis [options] [-BMS directory... -f] name...

SQL where、描述

????????whereis 定位一個指定“命令”的二進制文件、源文件、手冊文件的位置。提供的名稱首? ? ? ? ? ? 先去除前導路徑名組件和任何(單個)尾隨 .ext 擴展名(例如:.c)。使用源代碼控制? ? ? ? ? 產生的前綴 "s." 也得到處理。然后 whereis 嘗試在標準 Linux 位置以及 $PATH 和? ? ? ? ? ? ? ? ? $MANPATH 指定的位置中定位所需的程序。

選項

? ? ? ? -b? ? ? ? 只搜索二進制文件。

? ? ? ? -m? ? ? ?只搜索手冊文件。

linux find命令。? ? ? ? -s? ? ? ? 只搜索源文件。

? ? ? ? -u? ? ? ? 只展示有特殊條目的命令名稱。如果一個命令對于每個明確請求的類型不只有? ? ? ? ? ? ? ? ? ? ? ?一個條目,則稱該命令是不尋常的。因此 "whereis -m -u *" 請求在當前目錄中? ? ? ? ? ? ? ? ? ? ? ?沒有文檔文件或有多個文檔文件的文件。

? ? ? ? -B list? 使用空格分隔的目錄列表限制查找二進制文件的范圍。

? ? ? ? -M list?使用空格分隔的目錄列表限制查找手冊文件的范圍。

? ? ? ? -S list??使用空格分隔的目錄列表限制查找源文件的范圍。

vim查詢模式、? ? ? ? -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]#

whereis命令,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

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://808629.com/166448.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 86后生记录生活 Inc. 保留所有权利。

底部版权信息