1753290 Members
4967 Online
108792 Solutions
New Discussion юеВ

Man a file

 
SOLVED
Go to solution
wojtek75
Frequent Advisor

Man a file

Hi,

I have a manual in a separate file. How can I see it with man command? The following does not work:

$ man ./mymanfile.1

Thank you in advance.
6 REPLIES 6
Shrikant Lavhate
Esteemed Contributor

Re: Man a file

Hi,

man should be supplied with command not filename.

>I have a manual in a separate file
What does it mean? Does you have that file in text simple file. If so then you can use 'more' command to view its content

>./mymanfile.1
./ notation is used for executing script kinda file. The use demonstrated in above command is irrelevant I guess.
Will it remain a personal, if I broadcast it here!
wojtek75
Frequent Advisor

Re: Man a file

Hi,

I was given a compiled program with a manual attached in typical manual format. How can I see its formatted contents?
TTr
Honored Contributor
Solution

Re: Man a file

Try

nroff -man ./mymanfile.1 | col -b |more

The man pages are usually formatted with the {n|t}roff package and the "man" document style. The "col -b" takes care of some backspace/bolding/underlining escape characters that may affest the screen output.

If the man page is very plain and has minimal formatting commands built in, you can also cat it or more it but you haveto read through the formatting statements.
TTr
Honored Contributor

Re: Man a file

If you have a lot of add-on man pages you can add their location to the $MANPATH (/etc/MANPATH) so that you don't need to run nroff each the time.
Matti_Kurkela
Honored Contributor

Re: Man a file

Shrikant, the command originally shown by wojtek75 is valid in most Linux distributions.

Linux's "man" command allows you to directly view a file that is formatted like a man page but not (yet) placed in the MANPATH directories.

Unfortunately, HP-UX's "man" command does not have that feature: the nroff command (as described by TTr) must be used instead.

MK
MK
Dennis Handly
Acclaimed Contributor

Re: Man a file

Man doesn't take files but man entries. See "man 1 man". (For formatting see "man 5 man".)

If the file is in the right directory layout, you can use MANPATH or the -M option to point to the man tree.

>TTr: nroff -man ./mymanfile.1 | col -b |more

That's:
nroff -man mymanfile.1 | col -x | more -s
If you have tables, there are more programs in the pipe, tbl & neqn.

>TTr: If you have a lot of add-on man pages you can add their location to the $MANPATH

To do this, they have to be in a specific directory tree:
manN.Z/ compressed nroff format
manN/ uncompress nroff
catN.Z/ compressed cat format
catN/ uncompressed cat

>MK: the nroff command must be used instead.

-M is about the closest.