Created
June 28, 2025 05:53
-
-
Save EastArctica/dd006e2a39c16a675afecc8c1954d2ec to your computer and use it in GitHub Desktop.
Clean docker networks from `ip a`
This file contains hidden or 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
# Add to ~/.bashrc or ~/.bash_profile | |
ipa() { | |
ip a "$@" | awk ' | |
/^[0-9]+:.*(veth|br-|docker0)/ { | |
p=0 | |
} | |
/^[0-9]+:/ { | |
if (!/veth|br-|docker0/) { | |
p=1 | |
} | |
} | |
p' | |
} |
This file contains hidden or 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
# ~/.config/fish/functions/ipa.fish | |
function ipa | |
# Runs `ip a` and filters out docker/virtual interfaces | |
ip a $argv | awk ' | |
/^[0-9]+:.*(veth|br-|docker0)/ { | |
p=0 | |
} | |
/^[0-9]+:/ { | |
if (!/veth|br-|docker0/) { | |
p=1 | |
} | |
} | |
p' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment