Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Eclipsed launched a process for me, and I'd like to see the full command line used.

I tried "ps auxwww", but it seems to truncate the path to 4096 characters, is there any way to get PS to stop truncating the path, or to use another tool to find the full path?

share|improve this question
    
Hmm, maybe the answer is to recompile the kernel? wtf. stackoverflow.com/questions/199130/… –  Alex Black Mar 1 '12 at 19:11
    
For my case, which is a java app, you can use jconsole to get the full classpath it looks like –  Alex Black Mar 1 '12 at 19:13
    
Is it possible to redirect it to a file and get the entire command line? –  James Mar 1 '12 at 23:21
    
I don't think so, it looks like /proc/{PID}/cmdline is truncated at 4096 characters, a hard limit set in the kernel –  Alex Black Mar 2 '12 at 2:16

3 Answers 3

cat /proc/{PID}/cmdline

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

share|improve this answer
    
/proc/*/cmdline doesn't contain a trailing newline, so echo $(< /proc/7851/cmdline ) gives more legible output. –  Barton Chittenden Mar 1 '12 at 20:51
2  
Arg. just read the stack overflow link that Alex Black posted... looks like proc/.../cmdline has the same 4096 character limit. –  Barton Chittenden Mar 1 '12 at 21:22

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

share|improve this answer
    
piping it into less doesn't solve the truncation issue. –  Alex Black Mar 2 '12 at 2:16
    
huh, that worked for me. anyway, it looks like using proc (suggested above) looks like a great solution :) –  ejes Mar 2 '12 at 14:37
    
The problem I hit was that proc is truncated to 4096 characters, did you find a way to get past that limit? –  Alex Black Mar 2 '12 at 17:57

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.

       [...]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.