LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-07-2005, 12:53 AM   #1
anindyanuri
Member
 
Registered: Jan 2005
Location: India
Distribution: Kubuntu Gutsy
Posts: 450

Rep: Reputation: 30
Question How to print Man Pages


How do I print Man pages?
Regards
anindyanuri
 
Old 05-07-2005, 12:57 AM   #2
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
Well... I usually just send them to a file first...

man ls > lsmanpage.txt

I guess you could send it to your printer like this:

man ls > /dev/lp0

but that may not work on some printers unless you have an old DM printer.

KC
 
Old 05-07-2005, 01:32 AM   #3
anindyanuri
Member
 
Registered: Jan 2005
Location: India
Distribution: Kubuntu Gutsy
Posts: 450

Original Poster
Rep: Reputation: 30
I used the same option u have given in your first example but got a bad formatting of the .txt file.

I used man fstab > mfstab.txt and the output is as follows :

FSTAB(5) Linux Programmer’s Manual FSTAB(5)



NNAAMMEE
fstab - static information about the filesystems

SSYYNNOOPPSSIISS
##iinncclluuddee <<ffssttaabb..hh>>

DDEESSCCRRIIPPTTIIOONN
The file ffssttaabb contains descriptive information about the various file
systems. ffssttaabb is only read by programs, and not written; it is the
duty of the system administrator to properly create and maintain this
file. Each filesystem is described on a separate line; fields on each
line are separated by tabs or spaces. Lines starting with ’#’ are com-
ments. The order of records in ffssttaabb is important because ffsscckk(8),
mmoouunntt(8), and uummoouunntt(8) sequentially iterate through ffssttaabb doing their
thing.

Now please guide me, how to proceed....

Regards
anindyanuri
 
Old 05-07-2005, 01:42 AM   #4
epoo
Member
 
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Rep: Reputation: 30
hmm, this sounds oddly like a class assignment i had...
 
Old 05-07-2005, 01:52 AM   #5
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
Try this in root:

man fstab | col -b > fstab.txt

KC
 
Old 05-07-2005, 02:21 AM   #6
anindyanuri
Member
 
Registered: Jan 2005
Location: India
Distribution: Kubuntu Gutsy
Posts: 450

Original Poster
Rep: Reputation: 30
Yes, the problem has gone but not completely. MAN page includes a lot of single quote marks. In case of single quotes, there is still garbage letters.

Original fstab man page says...
For ordinary mounts it will hold (a link to) a block special device
node (as created by mknod(8)) for the device to be mounted, like
‘/dev/cdrom’ or ‘/dev/sdb7’. For NFS mounts one will have
<host>:<dir>, e.g., ‘knuth.aeb.nl:/’. For procfs, use ‘proc’.

Now the formatted output in the .txt file...
For ordinary mounts it will hold (a link to) a block special device
node (as created by mknod(8)) for the device to be mounted, like
‘/dev/cdrom’ or ‘/dev/sdb7’. For NFS mounts one will have
<host>:<dir>, e.g., ‘knuth.aeb.nl:/’. For procfs, use ‘proc’.


How to get rid off?

Regards
anindyanuri
 
Old 05-07-2005, 02:52 AM   #7
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
To print man pages:
In this example, using tar man pages.

man -t tar | lpr -Pdraft

Print man pages for tar (will be formatted by troff or groff,
usually for PostScript)
Pipe to lpr
Send to printer <draft> [optional]. The command will
print to the default printer if given as:
man -t tar | lpr

===============================

To print info pages:
In this example, using tar info pages.

cp /usr/share/info/tar.info.gz /home/<user>

Copy the info page to another location to avoid breaking
your on-line documentation.

gunzip /home/<user>/tar.info.gz

After decompressing the file, use a2ps to convert to PostScript.

a2ps tar.info

This produces a PostScript formatted file called tar.info.
Open in your favorite editor and print from there.

===============================

To convert output to PDF format

man -t tar | ps2pdf > tar.pdf

===============================

I've tried info2html and didn't like the result.
 
Old 05-12-2005, 03:54 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
What I do is use
man -Tdvi <topic> >topic.dvi
or
man -Tps <topic> >topic.ps
and print the .dvi or .ps file from ghostview.

Some distros don't have the -T option for man, but you can use -t instead.
man -t man >man.ps
kghostview man.ps

Last edited by jschiwal; 05-12-2005 at 03:57 AM.
 
Old 05-13-2005, 09:38 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I just used a similar method with the tex info pages for coreutils and bashref.

I needed to install the source package (rpm based)
Then I CDed to the SPECS directory and ran:
rpmbuild -bp bash.spec # This applies patches which might contain corrections
rpmbuild -bs bash.spec # This builds a new source package

Then in Midnight commander I opened the .src.rpm file created and copied the DOC directory to a working directory. After CDing to the DOC directory, I ran 'tex bashref.texi' to create a print worthy document 'bashref.dvi'.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ man pages Guest1234 Linux - Newbie 2 06-29-2008 09:12 AM
C man pages sono2 Linux - General 1 09-09-2005 10:36 AM
C++ man pages Guest1234 Ubuntu 0 05-11-2005 02:45 AM
What do you mean by MAN pages? inspectreo Linux - Newbie 2 05-08-2005 02:12 PM
How to print man pages? fclifton Linux - Newbie 3 09-25-2004 06:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration