shell script to start and stop tomcat code example Example: how to stop tomcat server in macos $ netstat -an | grep 8080