ps aux not wrapping lines

msknapp picture msknapp · Dec 8, 2013 · Viewed 11.7k times · Source

When I do 'ps aux' a lot of the lines are longer than the width of my terminal, and not wrapping to the next line. At first I thought it was my stty settings, but I noticed that other commands like netstat do wrap lines in my terminal. I would prefer not to be forced to use less or some other pager.

Does anybody know why the lines are not wrapping? and how to fix?

Answer

cinatic picture cinatic · Oct 28, 2016

There is also another simple solution:

echo "$(ps aux)"

The paranthesis will execute the command in a subshell which i guess has no width specification and therefore does not cut the lines, at least on every shell i tried this is the case.

Printing it with Quotes make the print command to keep the Newlines: http://manpages.ubuntu.com/manpages/trusty/en/man1/bash.1.html#contenttoc11