Over a million developers have joined DZone.

Killing Tomcat On Linux

DZone's Guide to

Killing Tomcat On Linux

Free Resource


#args to pass to kill

for file in `find /proc -regex /proc/[0-9]+ 2> /dev/null`; do

    # FIXME: this will execute the command but I don't think that grep 
    # if `grep org.apache.catalina.startup.Bootstrap $file/cmdline`; then 

    if `grep --silent org.apache.catalina.startup.Bootstrap $file/cmdline 2> /dev/null`; then 

        #get the localname of this process id.
        #cat $file/cmdline

        #now go ahead and kill this guy
        base=`basename $file`
        echo kill $ARG $base
        kill $ARG $base



Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}