Solved

How to turn off word wrap with "more"

Posted on 2004-08-27
9
718 Views
Last Modified: 2008-03-04
I am running AIX 5. Is there any way to turn off word wrapping when using the "more" command? Or is there a different text viewer tool I can use that can turn off auto text wrap in AIX? Thanks.
0
Comment
Question by:chinhdo1
9 Comments
 
LVL 20

Accepted Solution

by:
tfewster earned 200 total points
ID: 11916505
`pg -f filename` is supposed to prevent wrapping, but doesn't seem to work.

You could use `cut -c1-80 filename |more`

To save hassle, make it a shell script:
# m - Truncate lines to 80 chars & pipe to more
# Usage: `m filename`
cut -1-80 $1 |more

0
 

Assisted Solution

by:michaelato
michaelato earned 50 total points
ID: 11918962
tfewster's suggestion is what I do.  My only change might be to use "79" instead of "80" to prevent long lines putting an extra linefeed in your output -- but try 80 first.

Or use a telnet client that allows more columns, if you know the lines you're viewing are of a limited length eg. 200 characters.
0
 
LVL 4

Author Comment

by:chinhdo1
ID: 11922240
Good suggestions... but is there a tool that would allow to scroll to the right as well? Like Notepad/Textpad on Windows?
0
 
LVL 20

Expert Comment

by:tfewster
ID: 11922393
Check out /usr/bin/dt/dtpad - a full GUI text editor
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 4

Author Comment

by:chinhdo1
ID: 11934694
tfewster: unfortunately /usr/bin/dt/dtpad is not available on my AIX install system.

I am going to keep this thread open a while longer to see if anyone else has a better solution.
0
 
LVL 20

Expert Comment

by:tfewster
ID: 11935381
dtpad is part of the X11 software set - X11.Dt.rte - if you decide to install it
0
 
LVL 9

Expert Comment

by:svs
ID: 12156406
There's a replacement for `more' called `less' -- it will scroll horizontally among other useful things.  You may find that on your system `more' is actually `less' -- try entering `-S' (without the quotes) while viewing a file.
0
 
LVL 20

Expert Comment

by:tfewster
ID: 12162086
Good call, svs!

"less" is only standard with Linux & Solaris, but the GPL sources can be downloaded from http://www.greenwoodsoftware.com/less/  and it's been tested on AIX (and just about every other OS ;-)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now