Word wrap mode of "less" viewer is disabled by default in the system I work on. According to "less" viewer help, it is disabled with -S or --chop-long-lines flags. I did not find how to force word wrap on my system. Is there any known flag, or any other way, for enabling the mode?
Asked
Active
Viewed 1.6k times
11
-
What do you mean by `force word wrap on my system`? – GMichael May 20 '16 at 09:09
-
my system = virtual linux machine in my work (logging in from windows with VNC viewer), cent os 6.5, gnome, tc shell. – user1952686 May 20 '16 at 09:14
2 Answers
26
Word wrapping is disabled using -S
. Following the man page, you can reset that option by passing -+S
to the command line.
Let's say you have $LESS
set to -S
, you can re-enable it on the command line with
less -+S file

hek2mgl
- 152,036
- 28
- 249
- 266
8
You may try using the LESS
environment variable. For example, you can put the following into system-wide shell initialization script (/etc/profile
for bash/ksh):
export LESS="-S "

GMichael
- 2,726
- 1
- 20
- 30
-
1thanks. solved. when i do echo "$LESS" i see "-i-S-q-u-R". That's why word wrap is disabled by default. – user1952686 May 20 '16 at 09:17