How to get the full command line used to launch a process

cat /proc/{PID}/cmdline

Where {PID} is the process ID of the process in question.


The example is about a java process, here's a tool that can show some additional process details: jps. Just try, you probably have it - it's part of JDK

It's similar to a basic ps command - but underestands some java-speciffics. The main use is to identify running java processes, which then are inspected with other java analysis tools, like jstack.

$ jps -ml  
31302 com.intellij.rt.execution.application.AppMain com.example.Foo some.properties
26590 com.intellij.idea.Main nosplash
31597 sun.tools.jps.Jps -ml

An extract from the man page regarding the options:

jps - Java Virtual Machine Process Status Tool

jps [ options ] [ hostid ]

[...]

-q  Suppress  the  output of the class name, JAR file name, and argu‐
    ments passed to the main method, producing only a list  of  local
    VM identifiers.

-m  Output the arguments passed to the main method. The output may be
    null for embedded JVMs.

-l  Output the full package name for the application's main class  or
    the full path name to the application's JAR file.

-v  Output the arguments passed to the JVM.

-V  Output  the  arguments  passed  to the JVM through the flags file
    (the   .hotspotrc   file   or   the   file   specified   by   the
    -XX:Flags=<filename> argument).

-Joption
    Pass  option  to  the  java  launcher called by jps. For example,
    -J-Xms48m sets the startup memory to 48 megabytes. It is a common
    convention  for -J to pass options to the underlying VM executing
    applications written in Java.

[...]

pipe it into 'less' you should have no problems scrolling left and right :)