Getting Help From Linux - Part 2 Info

Well here we are again, at part two of the 'Getting Help from Linux' series.  In this blog post I'll be talking about using Info to get help from Linux.  In my previous post I spoke about how Info came about, but just in case you missed it I'll give you another quick lesson.  Gnu Info was created by the Free Software Foundation and in my experience is used by all of Gnu's software for their version of 'man' pages.  Info may contain much more information than what you can find in Man pages, and sometimes contains much more than you ever really need.  The good thing about Info is that it is a hypertext markup utility.  This makes it much easier to navigate through via hyperlinks embedded in emacs, than simply using arrow keys to navigate through information.  While Man uses the Less utility to control the display, the info utility itself is designed to display Info pages.  For those of you familiar with emacs, it appears the layout may be the same, along with some of the basic navigation. But that's where the two applications can differ.  If you're using the Info application then your commands will be different than if you're viewing info files in Emacs.  This article is about reading Info pages inside of info.

Layout and Navigation

Okay, I won't lie, navigation in emacs makes my head spin.  For some people this may come naturally, for those of us that have lived on vi all their lives the old adage 'you can't teach an old dog new tricks' really hits home when it comes to figuring out all of the emacs tips and tricks.  If anyone has actually gone through gnu.org's website on the Texinfo manual you know what I'm talking about.  The document on how to use Texinfo is 36 pages long, quite a bit longer than navigating Man pages in Less.   As far as layout goes, sections are broken down into what Info considers 'nodes', so if you see the reference to nodes in here then that's what I'm talking about.  As stated earlier, the info documents are written in hypertext, which makes it easier to navigate through than Man pages.  When you first execute 'info <name>' you are presented with the index for the subject that you are looking for.  Now before you start hyperventilating, think of the Info layout as a Tree (Top Node) with various branches spanning from the tree (Individual Nodes). The Branches just point back to the main 'branch'.

Before I get ahead of myself, let me first explain the main window.

At the bottom of your window is what is called the Mode Line.  The mode line just describes what you are viewing above, including information about the file, the node, number of lines, compression information, etc.  Here are some examples and explanations of Mode Lines:

 zz-Info: (festival.info.gz)Top, 58 lines --Top-- Subfile:
festival.info-1.gz-


*zz=Compressed file, Info=Using Info to Navigate, festival.info.gz=name of
compressed files, 58 lines=Number of lines in node, festival.info-1.gz=Subfile
containing more information

zz-Info: (screen.info.gz)Commands, 27 lines --All-- Subfile: screen.info-1.gz

*zz=Compressed file, Info=Using Info, screen.info.gz=name of compressed file,
27 lines=number of lines in node, screen.info-1.gz=Subfile containing more
information


This might be useful to some, especially if you want to get your hands on the info file for further analysis.   When you first open the document, at the top of the document you will see something like this: File: festival.info,  Node: Top,  Up: (dir).  File is festival.info, Node is Top, Up is main directory.

That takes care of the layout portion of Info, there are many more advanced layout portions that you can get into if you wish to explore this further, such as moving windows and texts, echo areas, and so on and so forth.  But as this is just a basic guide to getting information with Info, I won't be covering that here. However, if you do want more information on this, some of your basic emacs commands work just as well in Info, so if you're familiar with emacs you
won't have a problem with windowing with your info pages

How about navigation? If you know how to navigate around vim or emacs then this will be a piece of cake.  I haven't gone into the advanced topics of navigation for a reason.  Advanced topics include windowing, manipulating windows, moving text in windows, and so on and so forth. 

Below is a table that outlines your basic navigation.  The 'C' character is your Ctrl key, and 'M' stands for Meta. For some people Meta is Alt, and for some it's the Esc key.  So if a key binding calls for 'C-n' that would mean hold down your Ctrl key and push the letter n.


Next Line:                     C-n or <Down> arrow key
Previous Line:               C-p or <Up> arrow key
Beginning of Line:        C-a or <Home> key
End of Line:                   C-e or <End> key
Forward 1 Character:    C-f or <Right> arrow key
Backward 1 Character:    C-b or <Left> arrow key
Forward 1 Word:           M-f or C-<Right> arrow key
Backward 1 Word:        M-b or C-<Left> arrow key
Beginning of Node:      M-<
End of Node:                M->
End of Current Node:    e Quit q

Selecting Nodes:
Next Node:               n
Previous Node:        p
Up a Node:               u
Last Node Viewed:  l
Top Node:                 t
Directory Node:      d
First Node:              <
Last Node:               >
Global Next Node:    ]
Global Previous Node:    [


From this table you can see that Man navigation and Info navigation can both be navigated with arrow keys, but then there are added commands for moving around nodes. Keep in mind though, hypertext language is being used and there is a lot more information in Info pages than there are in Man pages.  So because of this, there had to be a way of navigating the complex labyrinths of indexes.

Searching Info Pages

Well now that you've figured out how to get around Info pages, it's time to find what you're looking for.  Just like with Man, you can do apropos searches from the command line to search every index of all Info files for keywords with: info --apropos=string , or info -x string.  This will list all instances where the string is listed.  Now what do you do once you're actually in the lengthly Info page and need to find information? Well there's an app command for that! 

Search Forward:                           s(string) or /(string)
Search Backwards:                       ?(string)
Search Case-Sensitive:                S(string)
Next word in Search:                   n
Next word Case-Sensitive:         N
Interactively Search Forwards:    C-s(string)
Interactively Search Backwards: C-r(string)
Index Search:                                i(string)

Next Index Search:                        ,

As you can see, some of the search keywords are just like vim commands, so if you're familiar with Vim, this should be a piece of cake. One of the gems to searching Info was given to me by some resourceful people in #linuxjournal that were more educated in emacs than myself.. I'll confess, if you can't tell, I'm a beginner at emacs as I have spent my entire Linux career in vi. So it goes without saying that I'll take any and every hint that I can when it comes to learning new and interesting things. Daddoo pointed out that he jumps to a named node in info pages by doing the following:

1. m - Brings up Menu Item (info specific)

2. Type in First letter of what you are looking for 'ex' for example

3. Tab 1 or 2 times to search Info for the node you are looking for, then select the node to view the page

Maybe to you veteran emacs users out there this might seem trivial, but this ended up being such an awesome and easy command. Before I would just arrow key down to what I was looking for and push enter to bring up the node. Ah, the simple joys in life.

Conclusion

Well there you have it, the end of a two part series on getting help from Linux with Man/Info. As you can see each one of these utilities has their strengths and weaknesses. If I was a betting man I would think that more and more help pages are going to be included in Info pages as it contains more information than your typical Man page, and eventually manpages will be pointers to Info. Do I think that is going to happen any time soon? Doubtful, as I'm a crusty old bugger when it comes to Man Pages. I do realize that when that day comes I'll need plenty of time to adapt to Info and emacs.

______________________

www.jaysonbroughton.com

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thank you

leetch299's picture

This has been very helpful. Great article

You think this will turn people on to Linux?....

Keith Daniels's picture

What is this? Some kind of forced initiation rite? A version of hazing like sororities and fraternities put their applicants through before they get to join the "IN click?

How many people still use Emacs? Less than 5% of total Linux users would be my guess and for all practical purposes 0% of the people who have switched to Linux in last 10 years--which are the majority of Linux users.

Most Linux applications, even many Command Line apps have settled on a common command key syntax that is used for things you have to do in all apps like; copy, paste, find, select, open, close, print, etc., etc., etc. Why can't programs that are the main source of help information for Linux do this?

I was a ham radio operator in the 70s and in the 80s when cell phones and then computers became common--at that time the kids were interested in packet radio and experimenting with what you could do with computers and radio. The old hams were not... and up until the late 90s were still insisting you had to learn 15 words a minute of Morse code before they would give you a license with full privileges.

At this point in time there was no practical reason for new hams to know Morse code because of the evolution of communication technology. Unfortunately the "Young" never like being forced to do anything, especially if it is difficult, so by the late 90s the majority of ham radio operators were in their 80s and the number of young people wanting to "join the club" was almost zero compared to the 1970s or so. They have finally changed most of those old Morse code requirements--but it was too late.

The old guard with their "They forced me to learn it, now it's my turn to torture you" attitude destroyed the interest in at least 2 generations in ham radio and hobby electronics. Is that what you are trying to do with "new" Linux and Unix users? What you are saying is: "You gotta learn Emacs and Vi commands before you can use help files"--just like I did--instead of being able to use all the commands they learned browsing the net, writing emails and playing with their digital camera files.

I thought Linux man pages were retarded 12 years ago when I switched from Windows to Linux and I think man pages and the "new" info format are even more stupid today.

It seems like the modern attitude by programmers toward users in general is "Don't worry, they will figure it out!" (their justification for never writing documentation I think). But the reality is they will more than likely go back to Windows. Especially since Windows 7 more or less seems to work now, unlike all the older versions (I'm ignoring security and privacy issues).

What do I suggest? The HTML format since every computer in the world can display it and it has lots of features that make it easier to read--or if you want a more compact integral solution use the epub format. Either choice would make far more sense to the latest generation of users, than something that was created in the 1970s and earlier--by engineers for engineers.

"I have always wished that my computer would be as easy to use as my telephone.
My wish has come true. I no longer know how to use my telephone."
-- Bjarne Stroustrup

Greatest lot of rubbish....

Anonymous's picture

Whoever came up with info needs counselling. Seriously.

I use man because it provides a quick and easy summary. If I want more, I'll use the html docs, either online, or increasingly showing up in package downloads. They provide a structured set of information that you can actually use without a university degree in the subject of getting help.

What I don't want to do is learn a whole new command set just to be able to access some documentation. Has anybody actually done "info info"? Great tutorial, guys.

"If you want to go somewhere else, just press the control and shift keys three times in backward sequences, stand on your head, and recite the names of all the Nobel prizewinners in chemistry since 1930. See how easy it is!!"

May have been ok in the 1970's. Not now.

also check out 'pinfo' package

Brendan Kidwell's picture

If you don't like Info's Emacs-style navigation, also check out "Pinfo" (find a package in your distro by that name and install it). Like Info, it looks first for an Info document matching your request, then falls back on a Man page, but it displays it in a "lynx-style" browser instead of Emacs.

For help, run `pinfo pinfo` and navigate to Keybindings.

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix