Linux man page entries | different types
Last Updated :
31 Mar, 2018
The man page(manual page) is a documentation manual of different commands available in unix or unix like operating systems.
To check manual entry for any command use,
man command_name
In this article, I'm using command
printf for my demonstrations.
man printf
Output:
PRINTF(1) User Commands PRINTF(1)
NAME
printf - format and print data
SYNOPSIS
printf FORMAT [ARGUMENT]...
printf OPTION
DESCRIPTION
Print ARGUMENT(s) according to FORMAT, or execute according to OPTION:
--help display this help and exit
--version
output version information and exit
FORMAT controls the output as in C printf. Interpreted sequences are:
\" double quote
\\ backslash
\a alert (BEL)
...
If you observe carefully the above output, the top line contains
PRINTF(1), the 1 in braces is type of man entry. The number basically corresponds to section of the manual page.
The manual is split into 8 sections, which are(on Research Unix, BSD, macOS and Linux):
Section |
Description |
1 |
General Commands |
2 |
System Calls |
3 |
Library functions, covering in particular the C standard library |
4 |
Special files (usually devices, those found in /dev) and drivers |
5 |
File formats and conventions |
6 |
Games and screensavers |
7 |
Miscellanea |
8 |
System administration commands and daemons |
Let's continue with the example of
PRINTF, for all entries, try below command:
man -a printf
Output:
PRINTF(1) User Commands PRINTF(1)
NAME
printf - format and print data
SYNOPSIS
printf FORMAT [ARGUMENT]...
printf OPTION
DESCRIPTION
Print ARGUMENT(s) according to FORMAT, or execute according to OPTION:
--help display this help and exit
--version
output version information and exit
FORMAT controls the output as in C printf. Interpreted sequences are:
\" double quote
...
When you type q to exit, the below text appears on terminal, press enter to continue to see another entry of printf
--Man-- next: printf(3) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
Output continued:
PRINTF(3) Linux Programmer's Manual PRINTF(3)
NAME
printf, fprintf, dprintf, sprintf, snprintf, vprintf, vfprintf, vdprintf, vsprintf, vsnprintf - formatted output conversion
SYNOPSIS
#include
int printf(const char *format, ...);
int fprintf(FILE *stream, const char *format, ...);
int dprintf(int fd, const char *format, ...);
int sprintf(char *str, const char *format, ...);
int snprintf(char *str, size_t size, const char *format, ...);
#include
int vprintf(const char *format, va_list ap);
int vfprintf(FILE *stream, const char *format, va_list ap);
...
To check specific entry to printf or any other command, you can directly provide section number, for example:
man 3 printf
Output: It will show man entry corresponding to section 3 of printf.
Some useful man command options:
1)
-f option
man -f printf
Output:
It will display the short description of printf, if available similar to
printf - format and print data
2)
-k option
man -k printf
Output:
It will search the short manual page descriptions for keywords and display any matches.
printf (1) - format and print data
printf (1p) - write formatted output
printf (3) - formatted output conversion
printf (3p) - print formatted output
printf [builtins] (1) - bash built-in commands, see bash(1)
3)
-w option
It prints the location of cat files that will be displayed rather than the content of files.
man -w printf
Output:
/usr/share/man/man1/printf.1.gz
4)
-K option
It will search for text in all manual pages.
man -K printf
Output:
It will display all man entries containing printf keyword, and after each entry is display you can press enter for viewing second entry.
For example:
The below is prompted to view second entry for printf, you can either skip it or quit to terminate the command.
--Man-- next: git-show(1) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
References :
1)
wiki/Man_page
2) Man entry of man
Similar Reads
Architecture of Linux Operating System Linux is an open-source UNIX-based operating system. The main component of the Linux operating system is Linux kernel. It is developed to provide low-cost or free operating system service to personal system users, which includes an X-window system, Emacs editor, IP/TCP GUI, etc.Linux distributionA L
7 min read
How to Find Out File Types in Linux In Linux, everything is considered as a file. In UNIX, seven standard file types are regular, directory, symbolic link, FIFO special, block special, character special, and socket. In Linux/UNIX, we have to deal with different file types to manage them efficiently.Categories of Files in Linux/UNIXIn
7 min read
Linux Directory Structure In Linux, everything is treated as a file even if it is a normal file, a directory, or even a device such as a printer or keyboard. All the directories and files are stored under one root directory which is represented by a forward slash /. The Linux directory layout follows the Filesystem Hierarchy
6 min read
Vim Text Buffers in Linux When it comes to text editing we all have heard of the VIM editor which is widely used in Linux systems. Vim is powerful and versatile which has made it the go-to choice for many linux users and programmers as well. Vim offers many features that set Vim apart and one of them is the text buffer syste
3 min read
Top 20 Linux Applications You Must Use Linux is a free and open-source operating system based on the Linux kernel. It consists of a wide variety of essential applications that can be used to perform many day-to-day tasks. Multiple alternative applications of Linux are available to perform every task. So, it is a tedious job to select the
11 min read
type command in Linux with Examples The type command in Linux is a useful utility for identifying how the shell will interpret a given command. It provides information on whether a command is a shell built-in, external binary, function, or alias, helping users understand the source of the command and its behavior. The command is parti
3 min read