Results 1 to 9 of 9
How can I create a text file from a man page?
I tried: man -P cat appname > appname.txt
This was pretty close, but it still had a lot of ...
- 07-04-2005 #1Just Joined!
- Join Date
- Mar 2005
- Posts
- 38
Create text file from man page
How can I create a text file from a man page?
I tried: man -P cat appname > appname.txt
This was pretty close, but it still had a lot of formatting codes and duplicate letters (for the bold).
Is there a simple way to simply dump the text with minimal formatting? I assume so because there are many web pages that display the man page for apps.
Thanks.
Pete
- 07-04-2005 #2Linux Newbie
- Join Date
- Feb 2005
- Location
- Texas
- Posts
- 168
Why don't you just copy and paste the text you want?
I would open the man page, highlight the desired text, select copy from the edit menu, and then paste it into an open text editor of your choice.
May not be the most elegant solution but it would work.
JeffRegistered Linux User #391940
- 07-04-2005 #3
Try this:
Code:man [manual] | col -b > file.txt
- 07-04-2005 #4Just Joined!
- Join Date
- Mar 2005
- Posts
- 38
Thanks, that was just what I needed.
As for the Copy/Paste suggestion, that's a real headache when you're working from a terminal and the man page is really long.
Pete
- 07-05-2005 #5Linux Guru
- Join Date
- May 2004
- Location
- forums.gentoo.org
- Posts
- 1,814
I asked a similar question a while back and got a slightly different response: http://www.linuxforums.org/forum/pos...61.html#168961
That gives a postscript output that can be piped to a printer for a nice result./IMHO
//got nothin'
///this use to look better
- 07-05-2005 #6Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
Alternatively, you can pipe it to a PS viewer program for online viewing. That's also quite a nice alternative over a terminal pager for viewing a man page, since it's neatly formatted and all.
For example, to use Gnome's PS viewer, ggv:
Code:man -t ls | ggv -
- 07-05-2005 #7Just Joined!
- Join Date
- Mar 2005
- Posts
- 38
Interesting. Actually, I just wanted plain text so that I could load it into a web browser on my Windoze box, so I could have easy searching and scrolling while being able to use the information in my terminal windows.
My Linux box is my file server/router, and a few other things, but not a desktop box. It's located in a closet in another room, so I only access it from telnet.
My main issue was editing scripts while being able to easily maneuver long a couple very long man pages for a couple apps that I use quite a bit.
Pete
- 07-05-2005 #8Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
In that case, you may be more interested in man2html. Unfortunately, man2html doesn't search for man pages itself, but it can be automated with this shell command:
Code:man -W thecommandyouwant | grep -v cache | head -n1 | xargs zcat | man2html >/path/to/outputfile.html
- 07-05-2005 #9Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
You can use groff to add html formatting to the man page.
bzcat /usr/share/man/man1/nano.1.bz2 | groff -T html -man > nano.1.html


Reply With Quote
