Created
August 2, 2021 18:39
-
-
Save tball-dev/3171f5bf8c5095af8e4c41a75f775fc1 to your computer and use it in GitHub Desktop.
Print out directory and port of all running tomcat instances
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
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