Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have just installed the latest stable version of FreeBSD to a computer and I have the following problem:

If, in Putty, I issue a command like ps uxa which gives long lines of output, they get cropped. ps uxa|more doesn't help. Even if I do ps uxa > file.txt, lines are cropped to 80 chars in the file!

There are some images of how it looks like:

This happens right after clean installation, with everything set to default. Default shell is csh, changing it to bash didn't help. This has never happened to me in Linux.

My uname -a

FreeBSD freebsd.localdomain 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009  i386

How to fix this problem? I have already looked at env vars, .profile, .cshrc, /etc/login.conf.

share|improve this question
What does ps uxa|wc -L tell you? Is the result greater than 80? Also, what does echo $TERM say? – Dennis Williamson Feb 5 '10 at 20:13

Try using the -w option:

From the MAN page:

 -w      Use 132 columns to display information, instead of the default which is your
         window size.  If the -w option is specified more than once, ps will use as
         many columns as necessary without regard for your window size.  When output
         is not to a terminal, an unlimited number of columns are always used.
share|improve this answer
Thanks einstiien, but it doesn't solve the problem. This cropping happens with ANY command, ps is just an example. And the most irritating thing is that when I output the result of a command to a file, the lines still get cropped (it is seen at the picture)! Maybe, there's something wrong with the xterm or shell configuration. – skrostislav Feb 5 '10 at 19:30
hmm, I just tested this on my FreeBSD 7.0 box and when I run it with the -w command the lines wrap instead of getting cut off. I am connecting from MacOS X terminal with my emulation set as VT100 (because of some of the older servers I connect to). It might be an emulation issue. Try VT100. I'll play around with putty on a windows box and see what I can come up with. – einstiien Feb 5 '10 at 19:36
Ok, it works for me through putty with the default putty settings. My freebsd box has $TERM=xterm. I know you said FreeBSD was default but did you change any of the settings in putty? – einstiien Feb 5 '10 at 20:25
This is just the way BSD ps works (same on open and net as well) - no -w's gets you 80 column, one -w gets you 132, -ww gets you unlimited. It does not matter if the output is redirected to a file.… – quadruplebucky Mar 4 '10 at 18:06

This is a feature/bug of putty, not FreeBSD. putty always tells the other OS what its width and height are. You can show this easily by doing one of your truncating ps commands, then widen the putty screen. You can see that the lines were truncated. Now give the ps comand again: you will see more columns.

In essence, what you are asking putty to do is to lie about the width of your window (giving a number larger than what it really is showing) and to wrap the longer lines intelligently. That will work fine for ps and ls -l and so on, and fail miserably for vi or any other full-screen editor. Such lying can also cause display of information that can be misinterpreted because of the wrapping. There may be a mode of putty that does this, but I could not find it.

share|improve this answer
That shouldn't affect output that's redirected to a file. – Dennis Williamson Feb 16 '10 at 8:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.