How do I find out my IP address on a unix-like box?

8,786

ifconfig is usually in /sbin. Depending on what system you're running this mightn't be on your path (in particular, RedHat systems don't include this on the default path)

Try:

$ /sbin/ifconfig

If it works then that's the issue, and you should change your path via your .bashrc (or whatever shell you're using).

export PATH=$PATH:/sbin:/usr/sbin
Share:
8,786

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin over 1 year

    How do I find out my IP address on a unix box? I've tried

    ifconfig
    

    but it doesn't exist on the system.

    • Adam
      Adam almost 15 years
      Did you try as root? Also what OS?
  • Ernie
    Ernie almost 15 years
    This makes the assumption that the computer is on the internet, not behind NAT, has a working DNS server configured, and a hostname. If you're on a TCP/IP network that isn't connected to the internet, then this won't work.