Linux – How to find out the IP address on a unix-like box

linuxtcpipunix

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

ifconfig

but it doesn't exist on the system.

Best Answer

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