Very simple ZSH function for retrieving and displaying informations about IP addresses.
The ipapi function makes use of the IP API service to retrieve data for a given IP address. It sends a request to the IP API endpoint, receives the JSON response and extracts specific information from it using jq
(you have to install it). The function then formats and displays the retrieved data beautifully. 🐆
-
Clone this repository to your local machine or download the ip-api.zsh file directly.
-
Open your ZSH configuration file (usually .zshrc) in a text editor.
-
Import the ip-api.zsh file by adding the following line to your .zshrc file:
source /path/to/ip-api.zsh
-
Replace /path/to/ip-api.zsh with the actual path to the ip-api.zsh file on your system.
-
Save and close the .zshrc file.
-
Run
source ~/.zshrc
to apply the changes.
To use the ipapi function, open a new terminal session and run the following command:
ipapi <ip_address>
Replace <ip_address> with the IP address you want to retrieve information for.
Curl
JQ