Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
2  
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

1 Answer 1

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

 
discard

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.