Saturday, 8 December 2012

Demystifying Man

Demystifying Man
  This is super short guide to tackle the dreaded "man" pages in Linux. I think getting comfortable with "man" pages is the first thing any Linux newbie should aim for. I first came across man on a "sco unix" dumb terminal and I had to restart my machine to exit "man" :-(. I found "man" to be unwieldy at the same time very informative.
Is Man for Man possible ?
 Yes you do have a Manual for Man command. When you open a terminal and run the command "man man" it will throw a tantrum and ask "What do you want man ?". After a few seconds it relents and begins to show the manual / help info for "man".
Command :- man man
What do you want buddy ?
Man Man
And then it relents and shows manual for man
Man Man
Can we save and read Man later ?
 If you don't like to read man pages in a terminal or command line (cli) and you want to read it from a file then you can redirect the man output to as text file using the symbol (>) . You can read Manual from a text file now instead of terminal. The command that needs to be run in the terminal is:-
Command :- man grep>ManualGrep.txt
Save Man in Text File
Can we Search in Man ?
 Once you open man for any command you can easily search for any particular piece of information by typing a forward slash (/) and typing in the search string. For example you are running a man on zypper and want to find the option to "force" a reinstall of an existing package,then all you need to do is run the command "man zypper " and then type "/force" to find the relevant option.
Command :- /force or /<SearchString>
Man Search
Can we open Man outside terminal ?
 If you want to read manual for a particular command (eg:-zypper) outside terminal then all you need to do is open Quick Launch window(press Alt+F2 ) in GNOME and then type in "gnome-help" followed by a space and then "man" and then the relevant command. "Man" and the "command" should be separated by a colon. Doing this will open the Manual for zypper in a more appealing GNOME help reader. This approach works under GNOME 3.4.2/ openSUSE 12.2.
Command :- gnome-help man:grep or xdg-open man:grep
If run the man command inside application launcher like this
Man Quick Launch
I can see man for zypper inside gnome-help like this
Man Gnome Help
How can I quit man?
 It is very frustrating that man doesn't support the commands like CTRL + C which usually Cancels most of the currently running and CTRL + D which would usually close the terminal windows. As I have said before only a simple command 'q' (without apostrophes) will help us exit an open Manual.

No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...