Voici une commande simple pour géolocaliser une adresse IP donnée
curl ipinfo.io/<ipaddress>
Source: http://www.commandlinefu.com/commands/view/12868/geolocate-a-given-ip-address
Une variante avec tr -d '“ ,{}' est disponible à cette adresse: https://github.com/steeltempest/BashGeolocation
curl ipinfo.io/<ipaddress> | tr -d '" ,{}'
Résultat:
curl -s ipinfo.io/222.158.111.56 | tr -d '" ,{}' ip:222.158.111.56 hostname:NoHostname city:Tokyo region:Tokyo country:JP loc:35.6850139.7514 org:AS2510FUJITSULIMITED postal:100-0001