0

When running ps -ef command on our new solaris server the command outputs the full arguments of the processes including passwords and usernames. It seems the length of characters it is showing is unlimited per process. On the old server the ps -ef command output is being automatically truncated. I cannot find any settings to truncate the output. Changing the COLUMNS variable does not work.

2
  • this is not the behavior of the command ps -ef, this is the behavior of the terminal in which you are working. how did you change columns?
    – zersh
    May 9, 2021 at 16:57
  • 1
    POSIX says about args field: "The implementation may truncate this value to the field width; it is implementation-defined whether any further truncation occurs". It seems the implementation in Solaris does not truncate. If so, ps -ef | cut -c -"$COLUMNS" or something similar may be a workaround. May 9, 2021 at 17:32

1 Answer 1

0

If you are running Solaris 11.4, it depends on which SRU level you are running. Some versions require adding the -W flag to truncate the text, some require adding the -w flag to expand the text.

As shown in the current ps(1) man page, the -W flag was added in 11.4.12, while the -w flag was added in 11.4.27. Section 6 of the blog Teaching an Old ps Command New Tricks also discusses the changes here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .