Get pid of running Apache Tomcat process

ps -eo pid,args | grep -v grep | grep catalina | awk '{print $1}'

-2
By: evandrix
2011-06-27 14:29:49

These Might Interest You

  • Must be run as root. The 'tomcat' user must have access to the .keystore file. The key and keystore passwords must be the same. The password must be entered into the server.xml config file for Tomcat. Show Sample Output


    2
    ${JAVA_HOME}/bin/keytool -genkey -alias tomcat [-validity (# of days valid)] -keyalg RSA -keystore (Path to keystore)
    ShadowCat8 · 2011-10-13 19:40:35 0
  • I cannot run Tomcat from Eclipse. It says that there?s other process that is running on port 8080, but I don?t know what is the process, and how to stop it from the Services manger in Windows. So here?s how you can kill and find out what is that process: To find out what PID 8080 was (hopefully not a trojan) I typed tasklist /FI ?PID eq 8080″ taskkill /F /PID 2600


    0
    netstat -a -o -n | grep 8080
    evandrix · 2011-04-28 09:58:59 0
  • Tomcat webapps are often remote links


    0
    ssh tomcat-server ls -l webapp-dir | grep -- '->' | awk ' { print $(NF-2) " " $(NF-1) " " $NF; }'
    igorfu · 2011-05-23 08:38:28 0
  • This command allows you to find the effective uid and gid of the Apache process regardless of process name (which can be apache2 or httpd depending on distro).


    -1
    ps -o euid,egid --ppid `netstat --inet --inet6 -pln|awk '/:80 / { split($7,tmp, "/"); print tmp[1]; }'`|sort |uniq|grep -v EUID
    chx · 2010-11-18 21:22:29 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: