0

A invaluable facet of the Linux demand line is the fact that documents for pretty much all line that is command is easily accessible. These documents are known as man pages, and you can easily access them through the command line using the man command.

In this tutorial, we will discuss the basics of man using some easy to understand examples. But before we do that, it’s worth mentioning that all examples in this article have been tested on Ubuntu 16.04 LTS machine.

Linux man command

The man command gives users access to pages that are manual demand line resources and tools. After could be the syntax with this demand:

man [command/tool name]

And here is just how guy’s very own manual web page defines it*********) that is:(*************) man – an interface to the on-line reference manuals

man is the system’s manual pager. Each page argument given to man is
normally the true title of a course, energy or function. The manual web page
associated with every of the arguments will be displayed and found. A
section, if provided, will direct man to look only in that section of
the manual. The default action is to search in all of the available
sections following a pre-defined order (“1 n l 8 3 2 3posix 3pm 3perl 5
4 9 6 7″ by default, unless overridden by the SECTION directive in
/etc/manpath.config), and to show only the first page found, even if
page exists in several sections.

The table below shows the section numbers of the manual followed by the
types of pages they contain.

1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), e.g.
man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]

A manual page consists of several sections.

Conventional section names include NAME, SYNOPSIS, CONFIGURATION,
DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUE, ERRORS, ENVIRONMENT,
FILES, VERSIONS, CONFORMING TO, NOTES, BUGS, EXAMPLE, AUTHORS, and
SEE ALSO.

Following are some Q&A-styled examples that should give you a idea that is good the way the guy demand works.

Q1. utilizing guy demand?

The fundamental use of guy is simple – simply run the demand utilizing the title associated with the device whoever guide manual you intend to access.

man [command/tool name]

For instance:

man ls

Q2. Making guy show page that is manual specific sections?

As already mentioned in the beginning, all available pages that are manual segregated into parts, and you will find parts containing guy web page entries of exact same title. To help make things easier you directly access manual pages from specific sections, something which you can do by just specifying the section number before the command/tool name.( for you, the man command lets*********)

man [section-num] [command/tool name]

For example:

man 3 printf 

Q3. How to lookup for manual pages and print short descriptions as well?

While going through Q&A 2, one may ask how to remember section numbers for manual entries with the name that is same. Well, it’s not necessary to do this as there is a command line choice ‘f’ which allows guy to produce all pages that are manual match the name in the input.

For example:

man -f printf

Here’s the outptut the above command produced on my system:

How to lookup for manual pages and print short descriptions as well

So you can see all entries with name ‘printf’ – along with section numbers – were displayed in the output.

Q4. How to make man display all pages that are manual a given input?

Now, let’s say you need guy to produce 1 by 1 all manual pages corresponding to certain input? Well, that is feasible, and you should need to use the command that is-a option for it.

For example, if you want to view the next ‘printf’ man page.( if you want to serially view all man pages for ‘printf’, you can do that in the following way:

man -a printf

The above command will first open the printf man page from section 1, and when you quit it, the command will ask you*********)

How to make man display all manual pages for a given input

Q5. Making guy search input that is considering regular expression?

In case you want the man command to search and list manual pages by considering input as a regular expression, you can do that using the -k command line option.

man -k [command/tool name]

For example:

man -k printf

Here’s the output the above command produced on my system:

How to make man search considering input as regular expression

Q6. How to make man display location of manual pages?

In case the requirement is to only know the location of manual pages, you can force man to do this by using the command that is-w choice.

man -w [command/tool name]

For instance:

man -w printf

Following could be the production this demand produced on my system:

/usr/share/man/man1/printf.1.gz

Q7. Making guy show pages that are manual Web browser?

Use the -H command line option for this.

man -H[browser-command] [command/tool name]

For example:

man -Hfirefox printf

Q8. How to make man command case sensitive?

By default, the man command ignores case while searching for manual pages. However, you can enable case-sensitivity using the -I command line option.( if you want,*********)

man -I [command/tool name]

Conclusion

So you can observe guy is an command that is extremely important users – both newbies and pros – should know how to use. We’ve just scratched the surface here, as the tool offers a complete lot of features. Training these very first, when you’re done, check out the person’s manpage to get more info.

An Introduction to DigitalOcean Snapshots

Previous article

Apple’s App shop mysteriously went dark in Iran yesterday

Next article

You may also like

Comments

Leave a Reply

More in Linux