?
Solved

How to turn off word wrap with "more"

Posted on 2004-08-27
9
Medium Priority
?
742 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
8 Comments
 
LVL 21

Accepted Solution

by:
tfewster earned 800 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 200 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 21

Expert Comment

by:tfewster
ID: 11922393
Check out /usr/bin/dt/dtpad - a full GUI text editor
0
 
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 21

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 21

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

850 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