Stop Linewrapping in Terminal
If you tail
, less
, cat
or grep
big log files you often encounter lines that contain no usefull information to you but are getting wrapped in your terminal which obscures the information youre looking for.
In this case it would be nice to disable Line- or WordWrapping.
After using tricks like cut -c1-80
for years and encountering different scenarios where this solution doesn't work, I finally found one that should work universally in any terminal regardless of the shell or emulator. The magic words are "automatic margin mode".
I've tested this under Cygwin and Linux and it works just fine!
Note: Keeping AM Mode enabled may cause weird behaviour on long commands that require a line break, so its best to disable AM Mode when done with examining the log.
Enable AM Mode (disable wraps):
tput rmam
Disable AM Mode (default; enable wraps):
tput smam