Last active
January 12, 2021 06:36
-
-
Save sar/471e2d1385968f93c2e04834ea363252 to your computer and use it in GitHub Desktop.
Emit diagnostics for all open network connections on Linux systems
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
#!/bin/sh | |
# network:devices:bound ip | |
ip addr | |
# ports:open:bound program/pid | |
netstat -tunlp | |
# active:network:connections:program | |
netstat -atupen | grep ESTABLISHED | |
# active:network:connections | |
# iftop -c ~/.iftoprc | |
lsof -nP -i | |
# listeners:tcp:udp | |
sudo lsof -nP -i | grep 'LISTEN\|UDP' | |
set +x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment