jps - ps just for Java
July 11, 2018
I came across a command today that I didn't know existed. It's part of the JVM and it lists just the java processes running on a given machine:
$ jps 2946 org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar 3144 GradleDaemon 3083 GradleDaemon 24092 Jps
If can also list the command line arguments that were supplied:
$ jps -v 2946 org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar -Dosgi.requiredJavaVersion=1.8 -Dosgi.instance.area.default=@user.home/eclipse-workspace -XX:+UseG1GC -XX:+UseStringDeduplication -Dosgi.requiredJavaVersion=1.8 -Xms256m -Xmx1024m 3144 GradleDaemon -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=GB -Duser.language=en -Duser.variant 24186 Jps -Dapplication.home=/usr/java/jdk-10.0.1 -Xms8m -Djdk.module.main=jdk.jcmd 3083 GradleDaemon -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=GB -Duser.language=en -Duser.variant