techxplore blog
12Jan

Checking Linux IP address bash: ifconfig: command not found

In Linux ifconfig is a basic command used to check the IP address. Recently, I did a fresh install of Redhat Linux on a virtual machine. Logged in as local user, I checked the IP address using of ifconfig command. I got a command not found error.

Linux IP address bash: ifconfig: command not found

Linux IP address bash: ifconfig: command not found

I tried to verify if ifconfig is really missing. Ifconfig as I know is a built-in Linux system command. I check under the /sbin/ folder and it’s present. Thus, the command could not be found, might be caused by the lack of privilege to run the command.

Linux IP address checking with ifconfig command

Linux IP address checking with ifconfig command

I login as root user and try to run ifconfig to check the IP address surely everything went okay.

One Response to “Checking Linux IP address bash: ifconfig: command not found”

  1. Cb Says:

    I think if this is a permission issue, it will tells you permission denied.

    Most probably this is a $PATH issue. Your user $PATH is not set to include /sbin, hence when you execute
    $ ifconfig

    You get command not found. To verify if this is indeed a $PATH issue, execute with a full path
    $ /sbin/ifconfig

    If returned success, consider adding /sbin to your user $PATH. (root already has /sbin included in $PATH)

Leave a Reply