Created
July 25, 2018 08:09
-
-
Save c02y/216b02b82c8588c2d70ef98b1541897b to your computer and use it in GitHub Desktop.
list all the ips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias mpp "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
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'"