Solution to centos7 without installing the ifconfig command

Source: Internet
Author: User
The ifconfig command is a program that sets or displays network interfaces and displays the Nic information of our machine. However, in some cases, commands such as ifconfig are not installed by default when CentOS and other Linux releases are minimized, at this time, when you enter the terminal and run the ifconfig command, an error will occur. this is the first thing we will think about is whether the environment variable does not have the ifconfig command path, because ifconfig is in the/sbin path, it can run only when logged on as the root user, but we

The ifconfig command is a program that sets or displays network interfaces and displays the Nic information of our machine. However, in some cases, commands such as ifconfig are not installed by default when CentOS and other Linux releases are minimized, when you enter the terminal, an error occurs when running the ifconfig command.

This is the first thing we will think about is whether the environment variable does not have the ifconfig command path, because ifconfig is in the/sbin path and can be run only after the root user logs on, but we logged on as the root user. Don't worry. let's take a look at the root user's environment variables.

No. our environment variables include the/sbin path. Also, 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 our/sbin directory does not have the ifconfig command, so our conclusion is: ifconf is not installed in CentOS.

--------------- The split line is an attitude ---------------

Our solution is: install the ifconfig command package in yum.

See It, bash is also split line, of course this is not in the focus, the focus is through the yum search command we found that the ifconfig command is in the net-tools.x86_64 of this package, next we will install this package.

Here we have installed the ifconfig command. let's try it.

After the command is run successfully, do you have the same questions as I did at the beginning? why is it not necessary to install the ipconfig command in windows when it comes to linux, the ifconfig command is originally from net-tools, which contains ifconfig, netstat, whois, and other commands. Therefore, you cannot run these commands before.

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.