How To Get Your Geolocation From Commandline In Linux

Get Your Geolocation From Commandline In Linux

You may also like...

  • Warren L Shafor

    How could I get this to work on OS X?

    • SK

      I don’t have Mac OS X. I guess you can install it using homebrew. To install npm, run – brew install npm. And then install whereami using command – npm install -g @rafaelrinaldi/whereami. Let me if it works. Good luck.

    • Résistance Land Shark

      On OS/X, install ‘jq’. I use ‘homebrew’ for installing on OS/X.
      http://brew.sh
      To install a package, ‘brew install jq’

      Then use this one liner (works on Linux, too, with ‘jq’ installed):
      curl -s http://freegeoip.net/json/ | jq -r ‘”(.latitude) (.longitude)”‘

      • SK

        Thank you.