Extend ps output to more than 80 characters in Solaris 8 Extend ps output to more than 80 characters in Solaris 8 unix unix

Extend ps output to more than 80 characters in Solaris 8


You can't display them with the default ps (/usr/bin/ps) which is a SVR4 regular one.

To get the full argument line, use the BSD ps (UCB = University of California at Berkeley):

/usr/ucb/ps -alxwww


We have finally fixed this in Solaris; as of Solaris 11.3 SRU 5, all original argument vectors as well as the environment variables can be retrieved from /proc. ps will now print all of the command line.

Fixed in Solaris 11.3 SRU 5


The simple answer is that there is no way to reliably acquire the full arguments to processes on Solaris for processes owned by other users. If you have root or other privileged access you can use /usr/ucb/ps on older versions, and 'pargs' or similar tools on newer versions (there is no tool which works across all versions).

Essentially Solaris stores the original args at process start time, while most other platforms allow ps to access, via some means, the contents of argv at runtime for the process. This stored-copy is in a special kernel data structure with limited (80 byte) size. This also means that it's not possible for a program to modify the args post-start as displayed by ps for useful or nefarious means.

Thus, if you need to access the command line for portable purposes, such as pid checking, you will need to choose between enforcing a short command line via hacks like launching programs controlled execp paths without absolute paths, or you will need to forgo that portable functionality on Solaris.