In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how linux looks at the installation directory. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Linux to view the installation directory: 1, directly execute the "whereis software name" command to view the installation directory; 2, execute the "ps-ef | grep software name" command to obtain the process number of the software running, and then execute the "ls-l / proc/ process number / cwd" command to view the installation directory.
The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
The method of viewing the installation directory of software by linux
Method 1:whereis software name
Take querying MySQL as an example
Whereis mysql# result mysql: / usr/bin/mysql / usr/lib64/mysql / usr/share/mysql / usr/share/man/man1/mysql.1.gz
Method 2:ps-ef | grep software name and ls-l / proc/ process number / cwd
If the installed software is already running, you can query it according to the software running process number.
Take redis as an example
Ps-ef | grep redis# result duni 2246 10 Feb19? 00:09:09 / redis-server 127.0.0.1:6379ls-l / proc/2246/cwd# result, without / lrwxrwxrwx 1 duni duni 0 Feb19 17:46 / proc/2246/cwd-> / home/duni/DuniSoftware/redis-3.2.3/src after cwd
The / proc file system is a mechanism (so called / proc) that the kernel and kernel modules use to send information to the process. This pseudo-file system allows you to interact with kernel internal data structures, get useful information about processes, and on the fly settings (by changing kernel parameters) while running. Unlike other file systems, / proc exists in memory rather than on the hard disk. The proc file system provides access interfaces to user space in the form of files, which can be used to obtain information about related components or modify the behavior of components at run time, so it is a very convenient interface.
Thank you for reading! This is the end of this article on "how to view the installation directory for 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, you can share it out 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.