#private ip
hostname -I
or
ifconfig
or
ip addr show
#public ip
curl ifconfig.me
ifconfig -a
$ hostname -I
ip addr
ip addr show eth0
ifconfig -a
ifconfig eth0
ip route
ip route show dev eth0
# The following commands allow you to get ip address in Linux. Open a terminal. Type any of the following command. Press Enter. The Ip address is next to inet.
ip address
ip address show eth0
ifconfig -a
ifconfig eth0
ip route
ip route show dev eth0
ip addr
ip addr show
ifconfig -a
ip route
# IP address
hostname -I | awk '{print $1}'
ip route get 1 | awk '{print $NF;exit}'
ifconfig | grep -m1 'inet' | awk '{print $2}'
# Public IP
curl ifconfig.me
# View RX & TX
ip -s -h a show eth0 | grep -A3 RX
# show IP address of current linux machine
ip addr show