In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use the whereis command in Linux. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Linux commonly used commands whereis commands are used to locate the path to related files such as instruction binaries, source code files, and man man pages.
Whereis looks for binary programs, codes, and other related file paths
Add that the whereis command can only be used to search for program names, and only binary files (parameter-b), man description files (parameter-m), and source code files (parameter-s) are searched. If the parameter is omitted, all information is returned.
Compared with find, whereis search is very fast, this is because the linux system will record all the files in the system in a database file, when using whereis and the following locate, it will look for data from the database, instead of traversing the hard disk to find, as the find command does, it will naturally be very efficient. However, the database file is not updated in real time, and by default it is updated once a week, so when we look for files with whereis and locate, we sometimes find the data that has been deleted, or the file has just been created, but cannot find it, because the database file has not been updated.
Syntax whereis (option) (parameter) option-b: find only binaries;-B: look for binaries only in the set directory;-f: do not display the path name before the file name;-m: find description files only;-M: find description files only in the set directory;-s: find only the original code files;-S only find the original code files in the set directory. -u: find files that do not contain the specified type. Parameter instruction name: the instruction name of the binary program, source file, and man man page to find.
Find out all the relevant files by an example
[root@localhost ~] # whereis tomcat tomcat: [root@localhost ~] # whereis svn svn: / usr/bin/svn / usr/local/svn / usr/share/man/man1/svn.1.gz description: tomcat is not installed, can not be found, svn installation found a lot of related files
Only look up the binaries
[root@localhost ~] # whereis-b svn svn: / usr/bin/svn / usr/local/svn [root@localhost ~] # whereis-m svn svn: / usr/share/man/man1/svn.1.gz [root@localhost ~] # whereis-s svn svn: note: whereis-m svn finds the path to the description document, and whereis-s svn looks for the source source file.
This is the end of the article on "how to use whereis commands in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.