Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 a huge xml file which I want to look at with cat some.xml | less but the gnome terminal truncates the lines making it difficult to read the output.

How do I get gnome-terminal not to truncate lines? Or, Is there a better way to scroll through files too big to fit in memory?

share|improve this question
Could you elaborate or add a screenshot? I just looked at an XML file with very long lines in the terminal and they don't get truncated, they wrap like they should. BTW, unnecessary use of cat. less takes a filename as parameter. – nem75 Jun 23 '11 at 7:49
up vote 6 down vote accepted

As mem75 already said, gnome-terminal doesn't truncate, but wrap long lines. But you're using less anyway, in which case it's that which is doing the wrapping.

To tell less not to wrap long lines, use the --chop-long-lines (or -S for short) option. (They're only chopped as far as the display is concerned, and you can scroll left and right with the arrow keys.)

share|improve this answer

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.