I'm doing:
less -S my_database_dump.sql
In order to see the files with the lines chopped (i.e. line wrapping.) But it's not working, the lines aren't being wrapped and I need to scroll horizontally to see the entire line. What can I do?
bashless
I'm doing:
less -S my_database_dump.sql
In order to see the files with the lines chopped (i.e. line wrapping.) But it's not working, the lines aren't being wrapped and I need to scroll horizontally to see the entire line. What can I do?
Best Answer
Try this:
$COLUMNS
is set to the terminal width by the shell. You can try other widths depending on your needs, of course. If you're running this in a script you may not have either$COLUMNS
or$LINES
defined - in that case you can usetput lines
instead.If you really want lines chopped (in this example, keep the first 80 chars) instead do this: