In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the Linux whereis command how to use the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe everyone will read this Linux whereis command how to use the article will have some gains, let's take a look at it.
The easiest and quickest way to search for files in Linux is to use the whereis command, which helps users find binaries, source codes, and help pages for a given command.
Syntax whereis [-bfmsu][-B...] [-M ...] [-S ...] [Documents...] Parameter: -b Finds binary files only.
-B Only looks for binary files in the directory of settings.
-f Do not display path names before file names.
-m Only find description files.
-M only looks for description files in the directory of settings.
-s Finds only original code files.
-S Only looks for original code files in the directory of settings.
-u Finds files that do not contain the specified type.
whereis command uses instance Q1. How to find binary file location with whereis command? Suppose you want to find, say, where the command is located. Here are your specific actions:
whereis whereis
Note that the first path of the output is the result you want. Use the whereis command, which also displays the help page and the source code path. (It appears if it can be found, but not in this case.) So the second path you see in the output is where the help page file is located.
Q2. How do you specify whether to search only for binaries, help pages, or source code? If you want to search only for, say, binary files, you can use the-b command-line option. For example:
whereis -b cp
Similarly, -m and-s correspond to help pages and source code, respectively.
Q3. How to limit where the whereis command searches? By default, whereis looks for files from hardcoded paths defined by matching characters. But you can limit the search with command-line options if you want. For example, if you only want to find binaries in/usr/bin, you can do so with the-B option.
whereis -B /usr/bin/ -f cp Note: Multiple paths can be given in this way. Use the-f option to clearly separate the directory list from the file names to be searched.
Similarly, if you want to search only for help files or source code, you can use-M and-S accordingly.
Q4. How do I view the search path for whereis? There is also an option corresponding to this. Just add-l after whereis.
whereis -l This is the partial output of the example:
Q5. How do I find a command with an exception entry? For the whereis command, a command is considered an exception if it has more than one entry for each explicit request type. For example, commands with no available documents, or commands with documents scattered around, can count as exception commands. When the-u option is used, whereis displays commands with exception entries.
For example, the following example shows commands with no document or multiple documents in the current directory.
whereis -m -u * About "Linux whereis command how to use" The content of this article is introduced here, thank you for reading! I believe everyone has a certain understanding of the knowledge of "how to use Linux whereis command". If you still want to learn more knowledge, please pay attention to the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.