Skip to content

Instantly share code, notes, and snippets.

@EastArctica
Created June 28, 2025 05:53
Show Gist options
  • Save EastArctica/dd006e2a39c16a675afecc8c1954d2ec to your computer and use it in GitHub Desktop.
Save EastArctica/dd006e2a39c16a675afecc8c1954d2ec to your computer and use it in GitHub Desktop.
Clean docker networks from `ip a`
# 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'
}
# ~/.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