Bunny Rabbit
Bunny Rabbit

Reputation: 8411

displaying a long file in one single line in linux commandline

I have a file with one single line which is 800 charcters long. Whenever I use cat or view the file in vim the line is displayed to the length of the terminal and the charters after that are shown in the new line below that. How can I view the content in one long line with a scroll bar maybe?

Upvotes: 1

Views: 706

Answers (5)

kennyy
kennyy

Reputation: 1

There is also the command 'fold' which display long lines in whatever length you want.

Format: fold [ -width ] [ file_list ]

Upvotes: 0

Jean-Marc Valin
Jean-Marc Valin

Reputation: 300

You can use "less" and scroll the line with the left/right arrow

Upvotes: 0

Cercerilla
Cercerilla

Reputation: 1373

In vim you can turn off wrapping with

:set wrap!

Unfortunately it doesn't give you a very clear indication that there are more characters off the screen, so you'll need to know what lines extend beyond the width of your terminal so you can scroll over to see the rest of the line.

Upvotes: 0

JimR
JimR

Reputation: 16153

If you're using vim, you can toggle between wrap and no wrap with :set wrap and :set nowrap

Then use the motion keys in command mode to move around

Upvotes: 1

seriyPS
seriyPS

Reputation: 7112

You can try nano your_file_name but this is not ideal solution...

Upvotes: 0

Related Questions