Extend ps output to over 80 characters in Solaris 8

How do you increase ps -fe output in Solaris to display over 80 characters? My process has several arguments, and the process name can no longer be displayed.

+4
source share
6 answers

You cannot display them by default ps (/ usr / bin / ps), which is regular SVR4.

To get the full line of arguments, use BSD ps (UCB = UC Berkeley):

/usr/ucb/ps -alxwww 
+7
source

The simple answer is that there is no way to reliably get 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 in older versions, as well as "pargs" or similar tools for newer versions (there is no tool that works in all versions).

In fact, Solaris stores the original arguments at the start of the process, while most other platforms allow ps to receive the argv content after a while while the process is running. This saved copy is located in a special kernel data structure with a limited size (80 bytes). This also means that the program cannot modify post-start args, as shown by ps for useful or unreasonable means.

Thus, if you need to access the command line for portable purposes, for example, checking pid, you will need to choose between forcing short commands using hacks such as running managed execp programs without absolute paths, or you need to abandon portable functions on Solaris

+2
source

Finally, we fixed this on Solaris; like Solaris 11.3 SRU 5, all of the original argument arguments as well as environment variables can be obtained from / proc. ps now prints the entire command line.

Fixed in Solaris 11.3 SRU 5

+2
source

you can use pargs pid this will give you more info than ps

+1
source

There are two sets of options for ps. Others will call with the correct names ((maybe BSD and SRVn)?)

With the option not related to the parameters, with the previous version, you can do

ps auxww(w?) | grep ${PID} ps auxww(w?) | grep ${PID} to increase the length of the printed part of the command (again, pay attention to the pointer indicator "-").

Please note that in some cases you will see many environment variable assignments before the actual command, i.e. myPath = ... cfgFile = ... / path / to / command ... args ...

I think that www will print everything on some systems, no matter how long the command takes.

Finally, in my experience using ps to do a lot of crazy things, I would prudently have a PID, and the first 6 would appear on the output? columns, but the space reserved for the team was empty or made any difference to the place holder. In the end, I found out why this is true by searching comp.unix.shell, but it's too long, and I don't have access to Solaris systems right now.

Hope this helps.

0
source

Try ps -efl . If that doesn't work (I don't have a Solaris window), you can also try ps -efl | cat ps -efl | cat (since some programs check to see if they have the terminal select their output width).

0
source

Source: https://habr.com/ru/post/1347191/


All Articles