DEV Community

Cover image for man pages
Mohamed Yahia
Mohamed Yahia

Posted on • Edited on

man pages

man pages or the manual pages is a documentation for commands installed on the system. Each command may or may not come with its manual page. The manual page describes the usage of the command and list all the options(operands) you can use on that command. You can type an option followed by hyphen(s) after the command to change the behavior of that command.

Lets open the manual page for the command ls

nuclearegg69@zenbook-f13:/var$ man ls

less program will run and display the contents of the ls manual page

Alt text

first you will notice (1) afte ls at the first line. 1 indicates that this manual page is part of section 1 of the manual pages. Man pages is classified into 9 sections. You can learn more about them if you did man man

nuclearegg69@zenbook-f13:/var$ man man

As quoted from the manual page of man command

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, e.g. /etc/passwd
       6   Games
       7   Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7), man-pages(7)
       8   System administration commands (usually only for root)
       9   Kernel routines [Non standard]```





Enter fullscreen mode Exit fullscreen mode

So the first section is about executables including shell commands. man, less, ls are executables or shell commands.

How to read the synopsis?



SYNOPSIS
SYNOPSIS
       ls [OPTION]... [FILE]...


Enter fullscreen mode Exit fullscreen mode

[] brackets means that whatever is inside of them is optional.
OPTION means any option -a, -h, -l so any option is optional
FILE means any object so a file or directory or other objects
... means or more so you can add 0 or more options to ls, 0 or more objects

How to navigate less

q to exit the less program of man
up and down arrows up and down a line
b or ^B back one view page
f or ^F forward one view page
/ forward slash to search forward
? to search backward

Top comments (2)

Collapse
 
tailcall profile image
Maria Zaitseva

Thank you for spreading the knowledge about man pages!

Collapse
 
itsmohamedyahia profile image
Mohamed Yahia

You're welcome. I'm glad I could help. Thanks for your lovely comment.