Skip to content

Instantly share code, notes, and snippets.

@c02y
Created July 25, 2018 08:09
Show Gist options
  • Save c02y/216b02b82c8588c2d70ef98b1541897b to your computer and use it in GitHub Desktop.
Save c02y/216b02b82c8588c2d70ef98b1541897b to your computer and use it in GitHub Desktop.
list all the ips
alias mpp "ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'"
@c02y
Copy link
Author

c02y commented Jul 25, 2018

This one is better:
alias mpp "ip route get 1.2.3.4 | cut -d' ' -f8 | head -1"
alias mppa "ifconfig | sed -En 's/127.0.0.1//;s/.inet (addr:)?(([0-9].){3}[0-9])./\2/p'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment