LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to Easily Read a Linux Man Page (https://www.linuxquestions.org/questions/linux-general-1/how-to-easily-read-a-linux-man-page-4175626591/)

onebuck 03-29-2018 06:23 AM

How to Easily Read a Linux Man Page
 
Hi,

New Gnu/Linux users will find this article helpful when needing to get information from man pages; How to Easily Read a Linux Man Page
Quote:

One of the most important skills you can learn as a Linux user is how to use a manual page, or “man page.”
This article will introduce you to those simple documents. You’ll learn how to open man pages and identify the contents inside, which will include special markings such as bold and underlined text alongside indicators such as ellipses (…) and brackets ([ ]).
Man pages are fairly easy to tackle, and your time is valuable, so let’s not waste another minute.
Man pages are not that complicated to read when one knows how to move through and understanding the semantics along with syntax for each command.

Hope this helps.
Have fun & enjoy!
:hattip:

dugan 03-29-2018 12:56 PM

For colors:
Code:

export PAGER=most

fatmac 03-30-2018 05:05 AM

Also
Code:

man man
may help get to grips with them. :)

rtmistler 03-30-2018 07:12 AM

I've always found manual pages to be of incalculable help to me.

The SECTIONS are some of the most important portions to me, especially NOTES, EXIT STATUS or RETURN VALUE, ERRORS, OPTIONS, as well as SYNOPSIS. SEE ALSO is typically very helpful.

I would note that manual pages are not just for command line commands, but also for library functions, for instance write(2) which is a C library function, as opposed to write(1) which is a command line tool that allows you to write information to a user.

For library functions, you also see the include files needed to allow use of that function in your application or driver, and you also learn if you need to link with a special library.

The -a argument and the -S # arguments are helpful:
Code:

$ man -a write  // this will show all manual pages for write
$ man -S 1 write  // this will show the man page for write(1), the command line utility
$ man -S 2 write  // this will show the man page for write(2), the C library function

I also like the online site linux.die.net which helps to find online manual pages.

What's most important is to really READ the content in the manual page. There are a ton of different points sometimes made about things and about other calls you may make. For instance the write(2) function talks about how you write to a file or descriptor, and the manual page also discusses what certain flags do when you use them in your open(2) call. And similarly, each of those types of functions' manual pages talks about the return value and the possible errors, which become very important the times when you open and then try to read from or write to a file and find that things aren't behaving.


All times are GMT -5. The time now is 02:38 AM.