Simple mini How-To on how to know or look at your public IP desde linux, without using the browser to access the typical pages that exist.
In this case, I'm going to use Archlinux, but it is valid for other versions of Linux as well.
1 - First we check that we have "curl" installed like this:
2 - In case of not having it, we install it:
pacman -S curl
3 - Now we run it either as a normal user or root as follows:
curl ifconfig.me
4 - So simple did you see?
Well I hope it helps the curious who are lazy to open the browser to see their ip.
Goal hug
This command can also serve:
wget -qO- icanhazip.com
Greetings. -
Oh great! thanks!
Hi, I use this command: dig + short myip.opendns.com @ resolver1.opendns.com
without installing anything.
regards
dig + short myip.opendns.com @ resolver1.opendns.com
Please note that I do not recommend following curl / wget method due to security reasons.
source :
http://www.cyberciti. biz / faq / how-to-find-my-public-ip-address-from-command-line-on-a-linux
pacman -Ss to know if a package is installed?
.......
in that case:
pac-man -Q | grep package
something more universal (not all are archers)
which curl &> / dev / null && echo "installed" || echo "no"
https://blog.desdelinux.net/viernes-de-terminal-ubicacion-geografica-ip/
I've always used wget -qO- ifconfig.me/ip (it's an uppercase o. Not a zero)
without installing anything, at least on debian and derivatives
I think it is better and more immediate:
curl ipinfo.io/ip
Thank you very much for the info ! very useful, especially when you don't have a graphical environment on a server 😉
regards