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.