On Red Hat Enterprise Linux 7 terminal, limited to 113 characters per line

CharsPerLine

New Member
Joined
Aug 4, 2023
Messages
2
Reaction score
0
Credits
25
Hello,

Whenever I "cat" files with more than 113 characters on a line, the line is broken at character 113. And, the remaining characters are wrapped to the next line. The terminal has no limit to its size.

Is there anything I can do about this? Is there an easy way? I'd like to get more than 113 characters on a line.

I don't have superuser/root privileges.

Thanks,
Mike
 
Last edited:


Code:
fmt file
This pretty aggressively reformats your text, so it may do more than what you want.
Alternatively, the cut command can cut text to a specific column width, discarding text beyond the right margin:
Code:
cat file | cut -c1-80
Another handy option is the less -S command, which displays a file in a full screen window with left/right scrolling for long lines:
Code:
less -S file

HERE

???
 

Sorry, maybe I should have explained that I was using "grep" piped into "more."

As stated, I can't use "cut" or "less."

The "grep -wn XyZ * | cut -c1-140" code gives me only 96 characters followed by some kind of weird character:
00
1B

The "grep -wn XyZ * | less -S" code gives me "a lot more" control characters with for example "ESC" etc. after an arbitrary point but one always as the first character. Some lines have control characters starting at the same character and other lines have control characters starting at another point.

Eg: ESC[35mESC [Ka b cd efg XyZ ... A b cd ESC[mESC[KESC[36mESC[K:ESC ...

But, some lines don't have the control characters and are much longer than 113 characters per line. But, this is unreliable overall.
 
Last edited:
Moving this to Redhat and derivatives.

Good luck.

Chris Turner
wizardfromoz
 

Members online

No members online now.

Top