Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of the Linux basic command whereis

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "the usage of Linux basic command whereis". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

whereis

Find the location of commands, including execution files, source code, manual files.

This command applies to Red Hat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

whereis [option] cmd

whereis [-bmsu] [-BMS directory... -f] filename...

2. Option list

option

description

-b

Search only binary files

-m

Search manual files only

-s

Search source code only

-u

Look for unusual items. A file is considered unusual if it does not have an entry for each request type. Therefore,"Whereis -m -u *" requests files that do not have documents in the current directory.

-B

Search for binary files in the specified directory

-M

Search for manual files in the specified directory

-S

Search for source code files in the specified directory

-f

Do not display path before file name, this option must be used when using-S, -M, -B option

3. Examples

1) Find the binary file of a command

[root@192 bin]#whereis -b ls

ls: /bin/ls

2) Find the manual file of the command

[root@192 bin]# whereis -m ls

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

3) Find all files in/usr/bin that are not recorded in/usr/man/man 1 and whose sources are in/usr/src:

[root@192 bin]# cd /usr/bin

[root@192 bin]# whereis -u -M /usr/man/man1 -S /usr/src -f *

"Linux basic command whereis usage" content introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report