Skip to content

Instantly share code, notes, and snippets.

@kontza
Last active June 11, 2021 07:21
Show Gist options
  • Save kontza/3b696634c859043e8d601f485d6e605e to your computer and use it in GitHub Desktop.
Save kontza/3b696634c859043e8d601f485d6e605e to your computer and use it in GitHub Desktop.
clear && \
sudo netstat -tUlpn|\
awk '/java/{gsub(/\/java/, "", $7);gsub(/^[0-9.]+\:/, "", $4);printf "%6s = ",$4; system("ps -o user,args -p " $7 " --no-headers")}'|\
sort
@kontza
Copy link
Author

kontza commented Jun 11, 2021

This prints out the command lines of Java apps that have a TCP port open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment