[lug] ps command

Sean Reifschneider jafo at tummy.com
Wed Feb 14 16:15:43 MST 2001


On Wed, Feb 14, 2001 at 02:48:14PM -0500, Thurston, Jason wrote:
>Why does the stdout of "ps" get truncated to 80 characters when I pipe or
>redirect it.

"ps -ef" without the "--columns" option will use the width of your
terminal to limit the length of lines.  If you redirect stdout, it
assumes 80-columns.  Try "ps efw", or "ps -ef --columns=999".

>ps -ef >/tmp/test.txt    #will truncate after the 80 char the output to the
>ps -ef                         #will not truncate, but can't grep on
>anything after the 80th character.

The later truncates to the width of your terminal, but if you add a "grep"
on there it truncates at 80 cols.  See the difference between "ps -ef"
and "ps -ef | cat"

Sean
-- 
 "Emilio Lizardo is a top scientist, dumbkopf."  "So was Mr. Wizard."
                 -- _Buckaroo_Banzai_
Sean Reifschneider, Inimitably Superfluous <jafo at tummy.com>
tummy.com - Linux Consulting since 1995. Qmail, KRUD, Firewalls, Python



More information about the LUG mailing list