Skip to content

Commit

Permalink
Update bash.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieparfet authored Aug 30, 2019
1 parent 8f0f22f commit b1dfcba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion misc/bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Sort IPs in file (1 per line) | `sort -t . -k 3,3n -k 4,4n file.txt`
Function | Command
------------ | -------------
Get IP address (Linux) | `hostname -I`
Get IP address of eth0 (Ubuntu) | `ifconfig eth0 \| grep 'inet addr' \| cut -d: -f2 \| awk '{print $1}'`<br>`ip -4 addr show eth0 \| grep -oP '(?<=inet\s)\d+(\.\d+){3}'`
Get IP address of eth0 (Ubuntu) | `ifconfig eth0 | grep 'inet addr' \| cut -d: -f2 \| awk '{print $1}'`<br>`ip -4 addr show eth0 \| grep -oP '(?<=inet\s)\d+(\.\d+){3}'`
Get IP address of eth0 (Debian/OS X) | `ifconfig eth0 \| grep 'inet ' \| awk '{print $2}'`
Get IP address of en0 (OS X) | `ipconfig getifaddr en0`
Get external IP | `curl icanhazip.com`<br>`curl checkip.amazonaws.com`<br>`curl eth0.me`<br>`dig +short myip.opendns.com @resolver1.opendns.com`
Expand Down

0 comments on commit b1dfcba

Please # to comment.