Ip command not found

In networking basics while using ip link command it says ip command not found.

@pathak.ravi1999 ip addr or ip address or ifconfig, may be one of it will work

Iā€™m on my mac m1. I think firstly i have to download packages through homebrew. Is there any other solution?

There is no ip command in Mac. Get it from brew or use:

ifconfig en0| grep "inet[ ]" | awk '{print $2}'

You can create an alias in ~/.bash_profile as follows:

alias ip-addr="ifconfig en0| grep \"inet[ ]\" | awk '{print \$2}'"

For Homebrew:


$ brew install iproute2mac
1 Like

use sudo apt install iproute2 -y in ubuntu to start making use of ip addr show.