updated for handling kill command based on dir name search instead of "tomcat"