Piping PS truncates lines?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > Piping PS truncates lines?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Piping PS truncates lines?  
Wally Sanford


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

I noticed that if I try something like:

ps -ux | sort -rk 3 | head -n 25

or

ps f -e | grep perl

I get back the correct lines, but they are always truncated to 80 lines?

It seems to me that this is the doing of the ps command (if it thinks
it's being piped?)

Is there any way to force it to give full lines?

Thanks for any help.







[ Post a follow-up to this message ]



    Re: Piping PS truncates lines?  
Bit Twister


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

On Tue, 25 Nov 2003 13:08:41 -0800, Wally Sanford wrote:
quote:
> I noticed that if I try something like: > > ps -ux | sort -rk 3 | head -n 25 > > or > > ps f -e | grep perl > > I get back the correct lines, but they are always truncated to 80 lines? > > It seems to me that this is the doing of the ps command (if it thinks > it's being piped?) > > Is there any way to force it to give full lines?
I wonder if your ps man page might have something about wide output try man ps




[ Post a follow-up to this message ]



    Re: Piping PS truncates lines?  
Michael Fuhr


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

"Wally Sanford" <wsanford@wallysanford.com> writes:
quote:
> I noticed that if I try something like: > > ps -ux | sort -rk 3 | head -n 25 > > or > > ps f -e | grep perl > > I get back the correct lines, but they are always truncated to 80 lines? > > It seems to me that this is the doing of the ps command (if it thinks > it's being piped?) > > Is there any way to force it to give full lines?
You don't say what flavor of Unix you're using, but it's usually possible to force ps to print wide lines. See the manual page for ps ("man ps") to find out how. -- Michael Fuhr http://www.fuhr.org/~mfuhr/




[ Post a follow-up to this message ]



    Re: Piping PS truncates lines?  
Chris F.A. Johnson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

On Tue, 25 Nov 2003 at 21:08 GMT, Wally Sanford wrote:
quote:
> I noticed that if I try something like: > > ps -ux | sort -rk 3 | head -n 25 > > or > > ps f -e | grep perl > > I get back the correct lines, but they are always truncated to 80 lines?
I think you mean "80 columns".
quote:
> It seems to me that this is the doing of the ps command (if it thinks > it's being piped?)
Do you get long lines when using ps by itself? I doubt it.
quote:
> Is there any way to force it to give full lines?
man ps Look for -w. -- Chris F.A. Johnson http://cfaj.freeshell.org ======================================== =========================== My code (if any) in this post is copyright 2003, Chris F.A. Johnson and may be copied under the terms of the GNU General Public License




[ Post a follow-up to this message ]



    Re: Piping PS truncates lines?  
Wally Sanford


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

Michael Fuhr wrote:
quote:
> "Wally Sanford" <wsanford@wallysanford.com> writes: > > > You don't say what flavor of Unix you're using, but it's usually > possible to force ps to print wide lines. See the manual page for > ps ("man ps") to find out how.
It says nothing about cols or wide lines, thats why I asked It looks like a FreeBSD box but I dont seem to have permission to run uname (I dont own the box.) Could you please just say what the proper args are, as there seem to be some (but I keep getting reffered to the man pages which seem to be incomplete on this box - its the first place I always look.)




[ Post a follow-up to this message ]



    Re: Piping PS truncates lines?  
Wally Sanford


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

Chris F.A. Johnson wrote:
quote:
> On Tue, 25 Nov 2003 at 21:08 GMT, Wally Sanford wrote: > > I think you mean "80 columns".
Thanks my boo-boo ;p
quote:
> > Do you get long lines when using ps by itself? I doubt it.
No only when piped.
quote:
> > man ps > > Look for -w.
Thank you.




[ Post a follow-up to this message ]



    Re: Piping PS truncates lines?  
jpd


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

In article <bq0mmd$1tsjav$1@ID-196529.news.uni-berlin.de>, Wally Sanford wro
te:
[snip: ps -w]
quote:
> > It looks like a FreeBSD box but I dont seem to have permission to run > uname (I dont own the box.)
Then... you could always ask the owner. Or look at the login banner. Or check dmesg, if you have permission to run that.
quote:
> Could you please just say what the proper args are, as there seem to be > some (but I keep getting reffered to the man pages which seem to be > incomplete on this box - its the first place I always look.)
http://www.freebsd.org/cgi/man.cgi FreeBSD has its manual pages (and those for quite a few others as well) online. A few other projects (NetBSD, I think) have theirs online as well. -- j p d (at) d s b (dot) t u d e l f t (dot) n l .




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:18 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register