Learner
Learner

Reputation: 21425

what is the difference in output for ps -www and ps command in unix

What is the difference between unix commands ps & ps -www, from man pages I saw this statement -w Wide output. Use this option twice for unlimited width., but when I use the -www I don't see any difference in output.

-bash-3.2$ ps 18451
  PID TTY      STAT   TIME COMMAND
18451 ?        Ds     1:02 ora_xxxx

-bash-3.2$ ps -www 18451
  PID TTY      STAT   TIME COMMAND
18451 ?        Ds     1:02 ora_xxxx

Upvotes: 1

Views: 2074

Answers (3)

arkascha
arkascha

Reputation: 42935

Yes, there is a difference. You do not see any in your example, since the output is not wide enough. But if you have an output that exceeds a certain width (terminal width), then you will see a difference: the columns are not chopped any more. The result is that the output is wrapped over the line endings.

Upvotes: 1

Reinstate Monica Please
Reinstate Monica Please

Reputation: 11603

wide in the sense that it doesn't truncate output, not in the sense that it will output extra categories. Try it with ps -eF and ps -ewF and you will likely see the difference (depending on terminal size). If you instead want to display full output with more categories do ps -f or ps -F instead (or ps -o to specify which categories you want displayed)

Upvotes: 2

Maxim Egorushkin
Maxim Egorushkin

Reputation: 136425

Note that -ww gives you unlimited width, adding more ws does not make it longer.

One of my favourites is ps -efHww. It shows all processes as a hierarchy along with start time and consumed CPU time, with complete command lines.

Upvotes: 1

Related Questions