Fix: bash: ipconfig: command not found on Linux


# ipconfig

bash: ipconfig: command not found

If you are trying to find out your private or public IP on Linux or Unix-Like Operating Systems and you get "ipconfig: command not found", well the reason for this error, is that there is no ipconfig command for Linux, instead you need to make use of the ifconfig command.

# ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 65535
        inet 1xx.17.0.2  netmask 255.255.0.0  broadcast 1xx.17.255.255
        ether 02:42:ac:11:00:02  txqueuelen 0  (Ethernet)
        RX packets 5434  bytes 83686640 (83.6 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3076  bytes 229403 (229.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Example of ifconfig on Linux
# ifconfig
bash: ifconfig: command not found

If you even get the same error of ifconfig then the required binary is missing, and you need to install net-tools using the apt package manager.

# sudo apt-get install net-tools

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap