linux show ip v4 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: get your ip address from terminal
for local ip :
hostname -I
for Public ip :
curl icanhazip.com