Skip to content

Instantly share code, notes, and snippets.

@tball-dev
Created August 2, 2021 18:39
Show Gist options
  • Save tball-dev/3171f5bf8c5095af8e4c41a75f775fc1 to your computer and use it in GitHub Desktop.
Save tball-dev/3171f5bf8c5095af8e4c41a75f775fc1 to your computer and use it in GitHub Desktop.
Print out directory and port of all running tomcat instances
ps -ef | grep tomcat | grep -oE 'catalina.home([^\s]+)' | cut -d " " -f 1 | cut -d "=" -f 2 | while read x; do echo $x && grep "Connector port" $x/conf/server.xml | grep "HTTP" | cut -d "=" -f 2 | cut -d " " -f 1; done | xargs -n2 | column -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment