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.

 

About amalgjose
I am an Electrical Engineer by qualification, now I am working as a Software Architect. I am very much interested in Electrical, Electronics, Mechanical and now in Software fields. I like exploring things in these fields. I love travelling, long drives and music.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: