Skip to content

Instantly share code, notes, and snippets.

@shebin512
Created November 7, 2020 21:27
Show Gist options
  • Save shebin512/de9a26724187408364be67060e095a01 to your computer and use it in GitHub Desktop.
Save shebin512/de9a26724187408364be67060e095a01 to your computer and use it in GitHub Desktop.
Get IP details of your system
function myip() {
curl http://icanhazip.com
ip addr | grep inet$IP | \
cut -d"/" -f 1 | \
grep -v 127\.0 | \
grep -v \:\:1 | \
awk '{$1=$1};1'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment