how to print ip address in linux code example
Example 1: display ip address linux
#private ip
hostname -I
or
ifconfig
or
ip addr show
#public ip
curl ifconfig.me
Example 2: how to see ip in linux
curl ifconfig.me
#private ip
hostname -I
or
ifconfig
or
ip addr show
#public ip
curl ifconfig.me
curl ifconfig.me