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

Installation paths for files and programs in linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

For beginners in linux, it is not easy to install a software, but find that they do not know where to install it, can not find it, or even uninstall it with great effort. Summarize the path problems:

It is sometimes important to look at the installation path (address) of a software in Linux. For example, the quick start item of a file is deleted, or you want to create a quick start item, or you want to delete or add installation files, etc., many places need to use the command to check the file installation path.

Here we introduce the Linux view file installation path (address) command.

First, view the file installation path:

Since the software is installed in more than one place, let's first check all the paths (addresses) of the file installation. Take hbase as an example.

For example, I installed Oracle, but I don't know where the files are installed or in which folders. You can check all the file paths with the following command.

At the terminal, enter:

Whereis hbase

Enter, if you have installed hbase, the installation address of the file will be displayed, such as my display (the installation address may be different).

Hbase: / usr/bin/hbase / etc/hbase

If you do not install hbase or hbase installation is not successful, the file path will not be displayed. Only prompt:

Hbase:

Second, query the path where the running file is located:

If you only need to query the address where the file is running, you can simply use the following command (or take Oracle as an example):

Which oracle

The results show:

/ usr/bin/oracle

Third, check the installation path of the software

Take mysql as an example:

1. You can enter commands directly:

Service mysql status

If installed, it is on by default. If you don't install it, there will be a hint.

If it is not installed, enter the command:

Apt-get install mysql-server

Just do it. (ubuntu system will be fine. )

2 、

Mysql-version

3. Check through rpm

Fourth, check whether the software is installed

First of all, we need to see if the software is installed, or the name of the installed package. For example, find out whether to install mysql

Rpm-qa | grep mysql

4. Rpm-ql lists the files installed by the software package

Rpm-ql xxx (installation package name)

5. Rpm-qal | grep mysql to view the file storage locations of all mysql installation packages

Rpm-qal | grep mysql

6. Find the corresponding software packages that can be installed through yum search

Yum search mysql

7. In addition to finding file locations according to software packages, the most commonly used is to find a keyword such as mysql all file paths that contain mysql services through find

Find /-name mysql

8. The Which command looks for the executable file path through the PATH environment variable, which is used to find the folder where the command is located.

Which mysql

9. The Whereis command is similar to find, except that whereis is faster to find through a locally structured database index. Information cannot be found if there are no files or commands updated to the database

Whereis mysql

These are the details of how newcomers to linux know where the program is installed. Please pay attention to other related articles for more information.

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