1

I am working in a company where they use lots of tools and commands for linux (internal and external)

I would like to create a custom manual, with examples per tool.

Thought of using info tool for this:

info CompanyName tool1
info CompanyName tool2
info CompanyName tool3
..

and the output of each should be a simple text of examples and comments added by me.

But as far as I know, the info in Linux is created for a specific tool and not for a your customized needs.

Any idea what would be the best way to achieve the above? Currently I am using sublime with tab per tool and every once and then I update the sublime tab with the new examples.

Any advice will be most appreciated.

user664859
  • 153
  • 2
  • 13

1 Answers1

0

For what it's worth, I am not a fan of info pages. I prefer the good old Unix man pages and it is very simple to write them. You can simply open any man page in an editor, look at it's source and just copy it to suit your needs.

On most systems the man pages are found in a directory like /usr/share/man/{man1,man2,man3,man4,man5,man6,man7,man8}/, or you can use the -w option of the man command to see the location of any man page and then open it. For example

$ man -w ls 
/usr/share/man/man1/ls.1.gz
$ vim /usr/share/man/man1/ls.1.gz

You can see how it is written, and mimic it to write your own man page. In order for anyone to be able to read the man page written by you, the man page has to be installed in one of the directories where the man utility searches for man pages. On Linux, you can usually see this list of directories by running the manpath command (on other systems it might be different and you will have to see the man page of the man command itself). If you store your man pages in one of these directories then any one can read it by using the man utility.

As per POSIX the man utility also respects the environment variable MANPATH, so if you store your man page in a non-standard location, you can set the MANPATH variable, so that man can look it up. Or you can also modify the /etc/man.conf file to add your man page directory to the search path of man.

Now, man pages use a macro language to do the mark up. Linux systems tend to use man(7) macro syntax, for which you can see the manual here

There is another modern macro set for writing man pages, called mdoc(7), which is used extensively in the BSD family of operating systems. You can see its manual here

Abhinav Upadhyay
  • 2,477
  • 20
  • 32