Informing the IBM Community

Man – Where’s that Manual Gone?

0
(0)

IBM has released quite a few big hitters lately, MariaDB etc., and some of the not so well known utilites have slipped under the cover. 

Let me take you through one of them in this article.

This great utility stops you being told to RTFM (Read the manual)!

So this is where this open source offering comes to the forefront.

Man-DB (Short for manual) is used to format and display the user manual of any command that we can run in a shell terminal. 

It is an interface to the system reference manuals.

It is particually useful for finding out the syntax of command, or the layout of any configuration files.

A real hidden secret this one.

All available manual pages are separated into sections.

To make things simpler, the man command lets you directly access manual pages from specific sections.  We can just specifying the section number before the command/tool name.

How do we install it?

Like all the open-source offerings made available by IBM, installation is easy, by using either the Access for Client Solutions (ACS) or using Yum. 

Once again, I will use Yum to install these packages.

yum install man-db

No dependencies for this one – that makes a change!

How do we use it?

Nice and easy, each man-db command starts with man, could not have been anything else really! Let us look at what man says about man, from our shell session, by typing the following command.

man man

The syntax of man is, type in ‘man command’ or ‘man section command’

Let me start with a simple example.

To get the manual for the echo command, type man echo

Note the start and the end of each manuals section. In the figure above. The screen shows that we are in the echo manual for section 1, programs or shell commands.

There are man pages for commands, programs and programming functions, but you do not see all of these headings on every page, because some of them only apply to certain types of commands.

Each section relates to different types of information, in a manual. These sections are explained in the table below.

SectionContents
1Programs or shell commands
2System calls
3Library calls
4Special files
5File formats and conventions
6Games
7Miscellaneous
8System administration commands
9Kernel routines

Navigation

Navigation around the man pages is performed with shortcut keys.

Use the table below as a reference guide.

ShortcutDescription
EForward one line
YBackward one line
FForward one window
BBackward one window
HHelp
QQuit

There are other shortcuts, which can be found by using the h (help) key.

Search the Manuals

Let’s move onto something a bit more involved.

We can use man’s -k switch to search for a string in all the manuals on the system.

For example, if we want to search all the manuals for occurrences of node, we will enter,

man -k node

this returns the following figure.

Here we can see that node is referenced in the following manuals where there are library calls (section 3).

Let me choose one of these OpenSSL manuals.

man OPENSSL_LH_node_stats

which states there is even further information that can be found about library calls (section 3) of OPENSSL_LH_COMPFUNC and a BIO miscellaneous (section 7) entry.

Conclusion

Man is an extremely important command that users, both newbies and us older ones, should know how to use.

It is worth looking at man-db, even with commands you think you know well, it is a safe bet there are other options you have never heard of.

While we are talking open-source, join me at the next i-UG UK user group meeting in March, where I will be adding my two bobs-worth on open source on IBM i.

If you have any questions, either on this article, or anything else open source, use the comments below, or send me a message on twitter @AndyYouens

Andy Youens is an IBM i consultant/instructor at Milton Keynes, UK-based FormaServe Systems with over 40 years IBM midrange experience. 

IBM Champion 2021

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.


Comments

5 responses to “Man – Where’s that Manual Gone?”

  1. Hi,

    I installed man-db but I still get “man: not found” ?

    1. Does your path statement point to /QOpenSys/pkgs/bin/ ?

      if not, in a terminal, run

      PATH=$PATH:/QOpenSys/pkgs/bin/
      EXPORT PATH

      Hope this helps.

  2. Nice one Andy, very useful article mate.

    One thing, sure RTFM must stand for Read The “Friendly” Manual??? 😉

    I can’t think of any other suitable substitute words that start with an F, can you?

    1. Chris Moore avatar
      Chris Moore

      May be it stands for ‘free’ 🙂

  3. None of the alternatives sound as good, lets leave it as intended 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *