Solaris ps output truncated at 80 columns
| 10-Jun-2010 | Posted by Sonia Hamilton under Solaris |
When running the ps command on Solaris, the output is truncated at 80 columns – really annoying when the command line to start up a process (typically a daemon) is really long. This has been annoying me for ages, and I finally found a (sort of) solution – use a different ps, and run as root:
# uname -a SunOS fubar 5.9 Generic_118558-24 sun4u sparc SUNW,UltraAX-i2 # which ps /usr/bin/ps # /usr/ucb/ps auxwww 2> /dev/null | grep 22480 root 22480 0.0 0.1 1896 1232 ? S 10:22:11 0:00 ptymonitor --oob-fd 49 --stderr-mode MUX --pty --term screen --rows 47 --cols 177 --termios 38400:38400:3.1C.7F.15.4.FF.FF.11.13.1A.100.12.17.16.100.100.100.F:B40:E3B:544505:8 --ttlg --gid 0 --uid 0 --wait-time 60 bash --rcfile /home/fubar/deployment/bin/dotbashrc_install.sh
This can also be made to work for non-root users by granting the account the proc_owner privilege. For example, for the user fred:
/etc/security/prof_attr Process Query:::Query Processes as Root: /etc/security/exec_attr Process Query:suser:cmd:::/usr/ucb/ps:privs=proc_owner;uid=0;euid=0;gid=0;egid=0 /etc/user_attr fred::::type=normal;profiles=Process Query passwd -e fred /usr/bin/pfksh cd ~fred echo "export PS1='% '" >> .profile
Share This
Very detailed steps. Excellent!
It helped solve my problem.
You’re welcome Kirti.
Hey Just wanted to say this definitely saved me from pulling my hair. Thanks for the explanation.
[...] found the answer on the following blog<br> <http://www.snowfrog.net/2010/06/10/solaris-ps-output-truncated-at-80-columns/> This entry was posted in Uncategorized by admin. Bookmark the [...]
Thanks for linking!