Posted by Christian Pelczarski in
Saturday, January 27. 2007
Problem:
One thing that always drove me crazy was not being able to get the full listing from the ps command. For example when doing ps -elf it will cut off the command column. Even dumping it to file is no help, as the command column will get cut off if it goes beyond the 80 char width.
Solution:
Use the width switch:
ps -elf --width 500 | grep java.*encode
-o switch is handy too
ps -u apache --width 1000 -o "%p|%a" | grep java.*# the -u switch only shows processes with the user of apache
Here is are a list of other column descriptors that can be used with the -o switch
%C pcpu %CPU
%G group GROUP
%P ppid PPID
%U user USER
%a args COMMAND
%c comm COMMAND
%g rgroup RGROUP
%n nice NI
%p pid PID
%r pgid PGID
%t etime ELAPSED
%u ruser RUSER
%x time TIME
%y tty TTY
%z vsz VSZ