You were trying to know the IP address of your Linux Operating System, and an error occurred with the message “bash: /usr/sbin/ifconfig: No such file or directory,” and that error has brought you here. Don’t worry; you are reading exactly the right post. But, the question arises that it was working before; what happened?

Why is the “ifconfig” command not working anymore?

The answer is pretty simple; the “ifconfig” command is deprecated in Linux Operating Systems’ upcoming versions. It must be an older version of your Operating System when this command worked for you last time. But, it does not mean you are out of doing anything. You can either know the IP address of your system by typing the command given below.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image1-17.png" data-lazy- height="325" src="data:image/svg xml,” width=”730″>

Or you can install the net-tools on your Operating System if you still want to run the “ifconfig” command.

How to install net-tools on Linux

The net-tools is a toolkit that provides many programs related to Linux networking and allows users to perform network-related tasks. For example,

  • Hostname configuration
  • Netstat tool
  • Address Resolution Protocol Configuration
  • Dig command
  • Ifconfig command

Let’s install the net-tools so that we can run the “ifconfig” command easily. This post will install the net-tools on Ubuntu 20.04 LTS operating System, but the process will be the same for Debian or other Debian-based systems.

Step 1: Update the system’s APT cache repository

First of all, before installing any application in a Linux operation system, it is a better practice to update the system’s APT cache repository first.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image3-15.png" data-lazy- height="231" src="data:image/svg xml,” width=”623″>

After updating the system’s APT repository cache, install net-tools.

Step 2: Install net-tools

The command for installing net-tools on Ubuntu 20.04 is typed below.

$ sudo apt install net-tools -y

The installation of net-tools will start and complete in a couple of minutes.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image2-17.png" data-lazy- height="160" src="data:image/svg xml,” width=”700″>

After the installation of net-tools, you can run the “ifconfig” command.

Step 3: Run the “ifconfig” command

Now, run the “ifconfig” command in the terminal

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image4-15.png" data-lazy- height="373" src="data:image/svg xml,” width=”697″>

You can see that the network statistics are displayed using the “ifconfig” command.

Conclusion

This post contains a short yet profound and step-by-step guide on installing net-tools to run the “ifconfig” command. This post also provides an alternate “ip a” command to get the network stats without even installing the net-tools. Keep on learning with linuxhint.com.

About the author

<img alt="Shehroz Azam" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/7011409B3A384F43A8417D1DAC68D179-150×150.jpg60396d9c82f90.jpg" height="112" src="data:image/svg xml,” width=”112″>

Shehroz Azam

A Javascript Developer & Linux enthusiast with 4 years of industrial experience and proven know-how to combine creative and usability viewpoints resulting in world-class web applications. I have experience working with Vue, React & Node.js & currently working on article writing and video creation.