how to get ip address terminal 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 get ip address in ubuntu

Open your command prompt and type following command shown below and press enter

ifconfig -a

Example 3: show ip address linux

$ hostname -I

Example 4: IP adress terminal

# when you're on your terminal Window : 
ipconfig

# on macOS : 
ifconfig | grep "inet" | grep -v 127.0.0.1

# on Linux : 

hostname -I

Example 5: get your ip address from terminal

for local ip :

hostname -I

for Public ip :

curl icanhazip.com

Example 6: how to show ip in terminal debian

1- sudo ifconfig

2- ip a

Tags:

Misc Example