Solved

How to turn off word wrap with "more"

Posted on 2004-08-27
9
724 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 20

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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

820 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