tags:

views:

472

answers:

4

How obtain the running process with absolute path name from ps command

13598 ?        Ssl    0:00 /opt/something --run-id 2 -n /home/laks/f1 -l l.log

I need the output as -

/opt/something --run-id 2 -n /home/laks/f1 -l l.log
+2  A: 

Okay I got the answer ,

cat /proc/13598/cmdline

HTH

lakshmipathi
+1  A: 
which `ps aux | cut -c 66- | cut -d\  -f 1`

will list absolute paths of all of the processes, you could work with that.

Tomislav Nakic-Alfirevic
+1  A: 

If i understand the question correctly, just use awk.

ps aux | awk '{print $11}'

Otherwise just do man awk and look at the field separator.

Anders
+2  A: 

Using user-defined format in ps:

ps xa -o cmd

Dmitry Yudakov