Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using ps with the user-defined format as shown below:

$ ps ax -o pid,args,psr,pcpu | grep python
2236 /usr/bin/python2.7 -u /home   2  0.0
2452 /usr/bin/python /usr/lib/un   2  0.0
2480 /usr/bin/python /usr/lib/ub   0  0.7
2501 /usr/bin/python /usr/lib/un   2  0.0
4129 /usr/bin/python /usr/bin/up   0  0.1
4792 grep --color=auto python      0  0.0
20665 /usr/bin/python /usr/lib/sy   0  0.0
27022 python                        0  0.0

I specifically want to have an unlimited width for args. I know that I can provided a set width like this:

$ ps axww -o pid,args:100,psr,pcpu | grep python
2236 /usr/bin/python2.7 -u /home/joshua/Applications/eclipse-classic-4.2/plugins/org.python.pydev_2.7.3.2   2  0.0
2452 /usr/bin/python /usr/lib/unity-lens-video/unity-lens-video                                             2  0.0
2480 /usr/bin/python /usr/lib/ubuntuone-client/ubuntuone-syncdaemon                                         3  0.7
2501 /usr/bin/python /usr/lib/unity-scope-video-remote/unity-scope-video-remote                             2  0.0
4129 /usr/bin/python /usr/bin/update-manager --no-focus-on-map                                              2  0.1
4905 grep --color=auto python                                                                               2  0.0

20665 /usr/bin/python /usr/lib/system-service/system-service-d 0 0.0 27022 python 0 0.0

I've tried using the ww option for unlimited width, but it does not work. Here's the command I used when trying ww:

$ ps axww -o pid,args,psr,pcpu | grep python
share|improve this question

1 Answer 1

up vote 4 down vote accepted

Make the variable-length column, args, the last column.

$ ps axww -o pid,psr,pcpu,args | grep python
share|improve this answer
    
That worked! Thanks! –  Joshua Garcia Apr 4 '13 at 23:51

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.