5 Commands to Get Public IP using Linux Terminal

GIT – Use one of following commands to find public of your system using terminal. These are also useful to use in shell script.

1. Using wget

# wget http://ipecho.net/plain -O - -q ; echo

Command 2: Using curl

# curl ipecho.net/plain; echo

Command 3: Using curl

# curl -s checkip.dyndns.org| -e 's/.*Current IP Address: //' -e 's/<.*$//'

Command 4: Using curl

# curl icanhazip.com

Command 5: Using curl

# curl ifconfig.me
Get Public IP in Shell Script

PUBLIC_IP=`wget http://ipecho.net/plain -O - -q ; echo`


Print Friendly, PDF & Email



Bài viết liên quan

Be the first to comment

Để lại lời nhắn