Getting the full command info from ps ?

  • Follow


Guys,

To identify processes to kill we need to view the FULL output from the
ps command (we use the comm field) ie

[senegal]/>  ps -edaf -o user,pid,ppid,comm | grep codaadm
 codaadm 17144     1 /users/support/ora/coda/V8102257/bin/oas_nsv
 codaadm 17146     1 /users/support/ora/coda/V8102257/bin/oas_lsv
 codaadm 26399 26397 -ksh
 codaadm 26912     1 /usr/java/bin/../bin/sparc/native_threads/java

However Solaris is truncating the comm field so we don't get more than
about 46 characters.

On other Unix's we could use the -x flag to get extended output. On
solaris I don't seem to be able to do this. Does anyone know of a way
around this issue ?

TIA,
Mike.

0
Reply mike 2/3/2005 12:02:11 PM

mike.whorley@coda.com wrote:
> Guys,
> 
> To identify processes to kill we need to view the FULL output from the
> ps command (we use the comm field) ie
> 
> [senegal]/>  ps -edaf -o user,pid,ppid,comm | grep codaadm
>  codaadm 17144     1 /users/support/ora/coda/V8102257/bin/oas_nsv
>  codaadm 17146     1 /users/support/ora/coda/V8102257/bin/oas_lsv
>  codaadm 26399 26397 -ksh
>  codaadm 26912     1 /usr/java/bin/../bin/sparc/native_threads/java
> 
> However Solaris is truncating the comm field so we don't get more than
> about 46 characters.
> 
> On other Unix's we could use the -x flag to get extended output. On
> solaris I don't seem to be able to do this. Does anyone know of a way
> around this issue ?
> 
> TIA,
> Mike.

Solaris8:

/usr/ucb/ps -awux


R.

0
Reply RK 2/3/2005 12:23:21 PM


In article <ctt53r$19m$1@phys-news1.kolumbus.fi>,
	RK <rakujala@gmail.com> writes:
> mike.whorley@coda.com wrote:
>> Guys,
>> 
>> To identify processes to kill we need to view the FULL output from the
>> ps command (we use the comm field) ie
>> 
>> [senegal]/>  ps -edaf -o user,pid,ppid,comm | grep codaadm
>>  codaadm 17144     1 /users/support/ora/coda/V8102257/bin/oas_nsv
>>  codaadm 17146     1 /users/support/ora/coda/V8102257/bin/oas_lsv
>>  codaadm 26399 26397 -ksh
>>  codaadm 26912     1 /usr/java/bin/../bin/sparc/native_threads/java
>> 
>> However Solaris is truncating the comm field so we don't get more than
>> about 46 characters.
>> 
>> On other Unix's we could use the -x flag to get extended output. On
>> solaris I don't seem to be able to do this. Does anyone know of a way
>> around this issue ?
>> 
>> TIA,
>> Mike.
> 
> Solaris8:
> 
> /usr/ucb/ps -awux
> 

You may need two "w" options.  From ps(1b):

     -w    Uses a wide output format  (132  columns  rather  than
           80).  If  the option letter is repeated, that is, -ww,
           uses arbitrarily wide output. This information is used
           to decide how much of long commands to print.


-- 
mailto:rlhamil@smart.net  http://www.smart.net/~rlhamil

Lasik/PRK theme music:
    "In the Hall of the Mountain King", from "Peer Gynt"
0
Reply Richard 2/3/2005 3:17:17 PM

I use ps with following option

/usr/ucb/ps -auxwww

you need to add two ww in ps switch to get full command line

SR

0
Reply Sun 2/3/2005 5:00:16 PM

[mike.whorley@coda.com]:
>
>   To identify processes to kill we need to view the FULL output from the
>   ps command (we use the comm field) ie

try args.

>   However Solaris is truncating the comm field so we don't get more than
>   about 46 characters.

you get 80 characters of args.

(note that /usr/ucb/ps mucks around in the process' memory space and
grabs the _current_ value of argv[], which may be considered a feature
or not.).
-- 
Kjetil T.
0
Reply Kjetil 2/3/2005 6:21:51 PM

Kjetil Torgrim Homme wrote:
> [mike.whorley@coda.com]:
> 
>>  To identify processes to kill we need to view the FULL output from the
>>  ps command (we use the comm field) ie
> 
> 
> try args.
> 
> 
>>  However Solaris is truncating the comm field so we don't get more than
>>  about 46 characters.
> 
> 
> you get 80 characters of args.
> 
> (note that /usr/ucb/ps mucks around in the process' memory space and
> grabs the _current_ value of argv[], which may be considered a feature
> or not.).

If you are interested in full args for particular processes, you may 
find pargs(1) useful.


eg

$ pargs 14803
14803:  /usr/dt/bin/dtexec -open 0 -ttprocid 2.11vtsQ 01 681 1289637086 
1 1 90892 129.1
argv[0]: /usr/dt/bin/dtexec
argv[1]: -open
argv[2]: 0
argv[3]: -ttprocid
argv[4]: 2.11vtsQ 01 681 1289637086 1 1 90892 129.158.12.60 5 vesvi_104_1
argv[5]: ksh
argv[6]: -c
argv[7]: host="`cat \\"/usr/dt/share/examples/bookmarks/localhost\\"`"; 
exec dtaction -execHost ${host#@} Terminal

alan.
-- 
Alan Hargreaves - http://blogs.sun.com/tpenta
Kernel/VOSJEC/Performance Engineer
Product Technical Support (APAC)
Sun Microsystems
0
Reply Alan 2/3/2005 10:38:01 PM

5 Replies
1452 Views

(page loaded in 0.126 seconds)

Similiar Articles:













7/20/2012 12:14:32 PM


Reply: