Is there a console command that takes an IP address as an input and shows its geographical information like city, country, ISP, etc.?
The command is the easy part, the difficult part is having access to a database.
For example, Ubuntu has a free database with a command line query tool (
There are various GeoIP databases that you can look up. They're generally meant to be viewed through a web browser, but you can look for a scraping script. For example, here's a ruby script to retrieve data from the MaxMind database. Note that scraping may be against the database's terms of service.