Skip to content

Commit

Permalink
.aliases: Add ifactive
Browse files Browse the repository at this point in the history
This lists only the active network interfaces. Handy for quickly chopping down the wall-of-text that is `ifconfig`.

Credit to g.rocket over at https://unix.stackexchange.com/a/108048/6040.

Closes mathiasbynens#722.
  • Loading branch information
wamatt authored and mathiasbynens committed Oct 31, 2016
1 parent c271ffe commit 2f0d5d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .aliases
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"

# Show active network interfaces
alias ifactive="ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active'"

# Flush Directory Service cache
alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder"

Expand Down

0 comments on commit 2f0d5d6

Please sign in to comment.