The ifconfig command for viewing IP addresses in centos 7 cannot identify how to handle the issue.

Source: Internet
Author: User

Problem description:

 

The centos7 system has been installed in the Virtual Machine. When you view the IP address and use the ifconfig command, the system prompts that the command cannot be found. You can use the ip addr command to query the IP addresses of the current system (1, 2 ):

Figure 1

Figure 2

Solution steps:

1. First, you will think about whether the ifconfig command path is not in the environment variable, because ifconfig is in the/sbin path and can be run only when the root user logs on, however, we logged on as the root user to check the environment variables of the root user;

 

The above environment variable contains the path/sbin. If the ifconfig command exists and is located in the/sbin directory, we can certainly run it, so let's see if there is any ifconfig command in the/sbin directory.

 

The result shows that the ifconfig command is not in the/sbin directory, so the conclusion is: ifconfig is not installed in centos.

2. Install the ifconfig command package in Yum (3)

Figure 3

Through the yum SEARCH Command we found that the ifconfig command is in the net-tools.x86_64 package, then install this package on the line (4, 5)

Figure 4

Figure 5

Summary:

The ifconfig command comes from net-tools, which contains ifconfig, netstat, Whois, and other commands. Therefore, these commands cannot be run before.

The ifconfig command for viewing IP addresses in centos 7 cannot identify how to handle the issue.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.