Shell Documentation In Linux & Unix Systems

unnamed (1)

Prerequisites

All you require for this guide in particular is a VPS or server running a Linux operating system. If you are in need of hosting services Hoverdata provide afforable payment plans for shared hosting, VPS hosting, or dedicated server hosting.

Introduction

Linux system administrators spend much time and effort learning commands of all kinds to work in and around the shell. One group of resources that play a sometimes understated role in this learning are the shell manual pages. All accessible through the same means as the commands they document.

1 — man

Usually the first port of call when querying a command and its capabilities. It’s a great place to start if you’re unsure as to what a program’s purpose even is or if you need it to achieve something specific (parameters).

On the most simplest of levels typing “man” followed by a space and the name of a command will bring up the manual page in question for said command.

Typing “man ping” like in our example below shows the purpose of the command, shorthand parameters, more parameters, sometimes prefixes, and anything of detailed importance you may need to know.

To quit the page and return to the command line press q


2 — man (/)

Whilst browsing through a man page you can press slash and type a string you want to search for. Confirm the entry with ENTER to highlight occurrences of the string throughout the document.

Pressing n cycles through the selections on screen.


3 — man -k

Using the -k parameter with man works like a regular expression search in that whatever you pass with this is matched against manual page names and their description.

If we search for man pages containing grep like this the next example we get every variation of grep that has a man page available.

This option works much in the same way as the apropos command.


4 — whatis

Breaking away from man for a while we see there are other commands at your disposal.

This one is self explanatory in name and much more concise in nature.

The above command (whatis) explains usually in only one line the precise purpose of whatever command you provide.

Much more effective for those who don’t have time to read in depth man pages.


5 — whereis

Ever wondered where some of the command you use are stored? If so this one might be of use to you.

If you know the file system well enough you’ll probably know most programs are stored in /bin/ .

The whereis program is by no means limited to this directory though. It works on every “program” not just inbuilt shell ones.

No matter where they reside in the file system.


6 — info

This one works similarly to the original man command we showed. The content provided is different depending on the page you request.

The list command (ls) info page to pick one of many has an alternative format to its man counterpart, and all provided information is laid out differently with new content on how to use list.

Not all commands have alternative wording and layout however.


7 — man section file

Back to the man command that we know and love as it has more utility to provide.

As you become more familiar with certain pages you may want to open them at the numbered sections within.

The only caveat to remember with this is you have to know the section and are sure that it exists inside a page to use it.

bab6b466c0b7c386d8198a1892ee78cf

Man Section Numbers

 

Many command man pages do not have designated sections like the ones above.

Basically if your page in mind adheres to any of these sections then you can make use of this “section file” command.


8 — man configfile

Interestingly many of the various configuration files you find attached to programs, scripts, binaries, etc. come complete with their own manual pages.

Try this out on configuration files, it works mostly on internal system config files.


9 — man deamon

There’s still more to come from man.

The background processes more aptly named daemons on your OS can be queried for man pages to confirm or determine their purpose.

So you can check what service these are actually upholding if you’re unsure.


10 —  man man

To end this post I’ll make the point of saying it’s worth checking out once or twice the manual page for man itself.

In here there’s the answer to any further inquiries concerning the use of man including as per the norm more parameters and what they’re defined for.


Conclusion

These diverse commands especially the variations of man will serve you well when administrating and learning about the Linux command line. Do not forget also that piping, redirecting, replacing and more of the universal shell mechanics work by and large with these tools too. So use this to your advantage.

We look forward to any questions in the comments you may have.

Thanks.

Leave a Reply

Logged in as Scarlz. Log out?

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">