bash: ifconfig: command not found debian centos ubuntu rhel

This article will be helpful for Ubuntu, CentOS, RHEL, Debian, Raspbian OS users.

ifconfig is a very commonly used command to find the ipaddress of a linux machine. Sometimes we may get an error like

bash: ifconfig: command not found

The reason for this can be because of one of the following reasons.

  • The ifconfig command is not available in the system.
    • In case of this issue, we have to install the net-tools package
  • The ifconfig script is not available in the PATH
    • In this case, we have to try executing /sbin/ifconfig command

In these cases, we can get the ip address details by using another command. We don’t have to install any additional package for issuing the following command

ip addr

If the net-tools package is missing in the system, we can enable ifconfig by installing the package. The command to install the package is given below.

For Ubuntu, Raspbian, Debian OS use the following command

sudo apt-get install net-tools

For RHEL / CentOS users, use the following command

sudo yum install net-tools

Now try ifconfig in the commandline and you will be able to see the ip address details.

 

Configure Network in CentOS / RHEL from command line

How many of you are aware of a text user interface for network configuration ?. A tool called NMTUI (Network Manager Text User Interface) is available in CentOS and Redhat systems. You can simply open this by typing nmtui in the command line.

If this command is not available, you have to install the NetworkManager-tui package.

yum install NetworkManager-tui

If you type nmtui command in command line, the following console will open up. You can configure the network configurations in the opened console. You can

nmtui

nmtui