Created
February 2, 2021 01:17
-
-
Save timhughes/ea9c8a2f0be4e384bb0480f0989ca0ec to your computer and use it in GitHub Desktop.
list ports opened in processes namespace
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
cat /proc/721/net/tcp |awk 'NR>1 {print $2}' | while read line ; do printf "%d.%d.%d.%d:%d\n" "0x${line:6:2}" "0x${line:4:2}" "0x${line:2:2}" "0x${line:0:2}" "0x${line:9:4}" ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Converts the hex ip:port to decimal