Skip to content

Quickly get your machine's public and private IP addresses.

License

Notifications You must be signed in to change notification settings

MrPilotMan/QuickIP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

QuickIP

Quickly get your machine's public and private IP addresses.

Install

  1. Verify curl and jq are installed.
  • Ubuntu

    sudo apt install curl jq
    
  1. Download quickip.sh and place it somewhere you can leave it indefinitely (ex ~/.local/bin/quickip.sh).

  2. Add the following line to your .bashrc(found at ~/.bashrc). Make sure to modify the path to where you put the script.

    source ~/.local/bin/quickip.sh
    
  3. Resource your .bashrc by either quitting and reopening your terminal or with the command source ~/.bashrc.

  4. The script should now be ready to use.

Usage

QuickIP has 3 functions, each with their own name:

pubip to get your public IP

locip to get all local interfaces that have an IP assigned

allip to get both public and private IPs.

Usage: pubip [ OPTION ]
  -m    Minimal - Don\'t show IP address location.
  -M    Extra Minimal - Only show IP address.
Usage: locip [ OPTION ]
  -d    Down - Only show interfaces that are currently down.
  -m    Minimal - Only show interface name and address.
  -M    Extra Minimal - Only show interface address(es).
  -u    Up - Only show interfaces that are up.
Usage: allip [ OPTION ]
  -m    Minimal - Equivalent to `pubip -m && locip -m`.
  -M    Extra Minimal - Equivalent to `pubip -M && locip -M`.

Examples

[user@computer: ~ ] pubip
Public IP Address:
	45.152.182.131	(United States)
[user@computer: ~ ] locip
Local IP Address(es):
	lo     	 127.0.0.1    	 UNKNOWN
	eth0   	 192.168.1.12  	 UP     
	wlan0  	 192.168.1.248	 DOWN   
	vpn0	 10.8.8.17    	 UNKNOWN
[user@computer: ~ ] allip
Public IP Address:
	45.152.182.131	(United States)

Local IP Address(es):
	lo     	 127.0.0.1    	 UNKNOWN
	eth0   	 192.168.1.12  	 UP     
	wlan0  	 192.168.1.248	 DOWN   
	vpn0	 10.8.8.17    	 UNKNOWN

Issues

Please report any issues you encounter and include your operating system in the issue description.

About

Quickly get your machine's public and private IP addresses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages