[lug] ps command

D. Stimits stimits at idcomm.com
Wed Feb 14 14:33:48 MST 2001


"Thurston, Jason" wrote:
> 
> Why does the stdout of "ps" get truncated to 80 characters when I pipe or
> redirect it.

I would guess that ps is using termcap or terminfo data to see what your
terminal width is, and that pipes or redirection will cause it to fall
back to a default of 80. You can specifically specify column width,
e.g.:
ps fxa --cols 200 | less

> 
> example of truncated listing:
> ps -ef | grep csurvey
> csurvey  29502 29500  0 Feb13 ?        00:00:00 /bin/sh -c
> /usr/local/jdk1.2.2/b
> csurvey  29503 29502  0 Feb13 ?        00:00:00
> /usr/local/jdk1.2.2/bin/i386/gre
> 
> however, if I use:
> 
> ps -ef >/tmp/test.txt    #will truncate after the 80 char the output to the
> test.txt file.
> 
> ps -ef                         #will not truncate, but can't grep on
> anything after the 80th character.
> 
> Thanks,
> Jason
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list