"man", which is short for "manual". To find out how to use man open a Konsole and issue:
which will give you:
What follows is an "overview", examples, options, etc...
Many times a man page will end with suggestions for further reading, as does "man man":
The numbers in the parentheses refer to the section that a particular manual is located.
Hence, "less(1)" is found in section 1 of the man pages, "Executable programs or shell
commands".
Often you want to use a console command but you can't remember its specific spelling,
or its necessary parameters or options. Say you have a CDROM that you want to
unmount. You try
but you get an error message with some suggestions, two of which are umount(2)
and umount( 8 ). You try "man umount(2)" but get an error:
So, you try "man umount" along and get a manual page that begins with "umount(8 )".
Is that the one you want? It may be the same as "umount(2)" but at this point you have
no way of knowing. One is from section 2, related to function calls by the kernel, the
other from section 8, commands used by system administrators. Consulting the man pages
of man you learn that a parameter, "-D", followed by the section number tells the man
command which section to look into. It will look in that section and return the first
"umount" command it encounters.
So, you issue:
and your efforts returns this page:
mmmm....... "umount(2)" looks like coding descriptions for a programmer who may want
to write code calling the umount command. That's now what you wanted, so umount(8 ),
the default returned from the "man umount" request is the correct page. Generally speaking,
the default pages returned from a man request is usually the information the typical user is
asking for.
But, what if you not only don't know how to spell a specific command, you don't even know
the name of a command or even if it exists in the file hierarchy? All you remember is that it
is a command that mounts MSDOS file systems. This is where another valuable Linux
command comes into play. It is called "apropos". You issue
in a Konsole, and here is what is returned:
and, right in the center of the listing, is the command "mmount".
man man
NAME
man - an interface to the on-line reference manuals
SYNOPSIS
man [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale]
[-m system[,...]] [-M path] [-S list] [-e extension]
[-i|-I] [--regex|--wildcard] [--names-only] [-a] [-u] [--no-subpages] [-P pager]
[-r prompt] [-7] [-E encoding] [--no-hyphenation] [--no-justification] [-p string]
[-t] [-T[device]] [-H[browser]] [-X[dpi]] [-Z] [[section] page ...] ...
man -k [apropos options] regexp ...
man -K [-w|-W] [-S list] [-i|-I] [--regex] [section] term ...
man -f [whatis options] page ...
man -l [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale]
[-P pager] [-r prompt] [-7] [-E encoding] [-p string] [-t] [-T[device]] [-H[browser]]
[-X[dpi]] [-Z] file ...
man -w|-W [-C file] [-d] [-D] page ...
man -c [-C file] [-d] [-D] page ...
man [-hV]
DESCRIPTION
man is the system's manual pager. Each page argument given to man is normally
the name of a program, utility or function. The manual page associated with each
of these arguments is then found and displayed. 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 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]
man - an interface to the on-line reference manuals
SYNOPSIS
man [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale]
[-m system[,...]] [-M path] [-S list] [-e extension]
[-i|-I] [--regex|--wildcard] [--names-only] [-a] [-u] [--no-subpages] [-P pager]
[-r prompt] [-7] [-E encoding] [--no-hyphenation] [--no-justification] [-p string]
[-t] [-T[device]] [-H[browser]] [-X[dpi]] [-Z] [[section] page ...] ...
man -k [apropos options] regexp ...
man -K [-w|-W] [-S list] [-i|-I] [--regex] [section] term ...
man -f [whatis options] page ...
man -l [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale]
[-P pager] [-r prompt] [-7] [-E encoding] [-p string] [-t] [-T[device]] [-H[browser]]
[-X[dpi]] [-Z] file ...
man -w|-W [-C file] [-d] [-D] page ...
man -c [-C file] [-d] [-D] page ...
man [-hV]
DESCRIPTION
man is the system's manual pager. Each page argument given to man is normally
the name of a program, utility or function. The manual page associated with each
of these arguments is then found and displayed. 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 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]
Many times a man page will end with suggestions for further reading, as does "man man":
SEE ALSO
mandb( 8 ), manpath(1), manpath(5), apropos(1), whatis(1), catman(8 ), less(1),
nroff(1), troff(1), groff(1), zsoelim(1), setlocale(3), man(7), ascii(7), latin1(7), the
man-db package manual, FSSTND.
mandb( 8 ), manpath(1), manpath(5), apropos(1), whatis(1), catman(8 ), less(1),
nroff(1), troff(1), groff(1), zsoelim(1), setlocale(3), man(7), ascii(7), latin1(7), the
man-db package manual, FSSTND.
Hence, "less(1)" is found in section 1 of the man pages, "Executable programs or shell
commands".
Often you want to use a console command but you can't remember its specific spelling,
or its necessary parameters or options. Say you have a CDROM that you want to
unmount. You try
unmount /mnt/cdrom
and umount( 8 ). You try "man umount(2)" but get an error:
bash: syntax error near unexpected token `('
UMOUNT( 8 ) Linux Programmer's Manual UMOUNT(8 )
NAME
umount - unmount file systems
SYNOPSIS
umount [-hV]
umount -a [-dflnrv] [-t vfstype] [-O options]
umount [-dflnrv] {dir|device}...
DESCRIPTION
The umount command detaches the file system(s) mentioned from the file hierarchy.
A file system is specified by giving the directory where it has been mounted. Giving the
special device on which the file system lives may also work, but is obsolete, mainly
because it will fail in case this device was mounted on more than one directory.
Note that a file system cannot be unmounted when it is `busy' - for example, when
there are open files on it, or when some process has its working directory there, or when a
swap file on it is in use. The offending process could even be umount itself - it opens libc,
and libc in its turn may open for example locale files. A lazy unmount avoids this problem.
Options for the umount command:
-V Print version and exit.
-h Print help message and exit.
-v Verbose mode.
-n Unmount without writing in /etc/mtab.
-r In case unmounting fails, try to remount read-only.
-d In case the unmounted device was a loop device, also free this loop device.
-i Don't call the /sbin/umount.<filesystem> helper even if it exists.
By default /sbin/umount. filesystem> helper is called if one exists.
-a All of the file systems described in /etc/mtab are unmounted. (With umount
version 2.7 and later: the proc filesystem is not unmounted.)
NAME
umount - unmount file systems
SYNOPSIS
umount [-hV]
umount -a [-dflnrv] [-t vfstype] [-O options]
umount [-dflnrv] {dir|device}...
DESCRIPTION
The umount command detaches the file system(s) mentioned from the file hierarchy.
A file system is specified by giving the directory where it has been mounted. Giving the
special device on which the file system lives may also work, but is obsolete, mainly
because it will fail in case this device was mounted on more than one directory.
Note that a file system cannot be unmounted when it is `busy' - for example, when
there are open files on it, or when some process has its working directory there, or when a
swap file on it is in use. The offending process could even be umount itself - it opens libc,
and libc in its turn may open for example locale files. A lazy unmount avoids this problem.
Options for the umount command:
-V Print version and exit.
-h Print help message and exit.
-v Verbose mode.
-n Unmount without writing in /etc/mtab.
-r In case unmounting fails, try to remount read-only.
-d In case the unmounted device was a loop device, also free this loop device.
-i Don't call the /sbin/umount.<filesystem> helper even if it exists.
By default /sbin/umount. filesystem> helper is called if one exists.
-a All of the file systems described in /etc/mtab are unmounted. (With umount
version 2.7 and later: the proc filesystem is not unmounted.)
no way of knowing. One is from section 2, related to function calls by the kernel, the
other from section 8, commands used by system administrators. Consulting the man pages
of man you learn that a parameter, "-D", followed by the section number tells the man
command which section to look into. It will look in that section and return the first
"umount" command it encounters.
So, you issue:
man -D 2 umount
UMOUNT(2) Linux Programmer's Manual UMOUNT(2)
NAME
umount, umount2 - unmount file system
SYNOPSIS
#include <sys/mount.h>
int umount(const char *target);
int umount2(const char *target, int flags);
DESCRIPTION
umount() and umount2() remove the attachment of the (topmost) file system mounted
on target.
Appropriate privilege (Linux: the CAP_SYS_ADMIN capability) is required to unmount
file systems.
Linux 2.1.116 added the umount2() system call, which, like umount(), unmounts a
target, but allows additional flags controlling the behavior of the operation:
MNT_FORCE (since Linux 2.1.116)
Force unmount even if busy. This can cause data loss. (Only for NFS mounts.)
MNT_DETACH (since Linux 2.4.11)
Perform a lazy unmount: make the mount point unavailable for new accesses,
and actually perform the unmount when the mount point ceases to be busy.
MNT_EXPIRE (since Linux 2.6.8 )
Mark the mount point as expired. If a mount point is not currently in use, then an
initial call to umount2() with this flag fails with the error EAGAIN, but marks the
mount point as expired. The mount point remains expired as long as it isn't
accessed by any process. A second umount2() call specifying MNT_EXPIRE unmounts
an expired mount point. This flag cannot be specified with either MNT_FORCE
or MNT_DETACH.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
....
NAME
umount, umount2 - unmount file system
SYNOPSIS
#include <sys/mount.h>
int umount(const char *target);
int umount2(const char *target, int flags);
DESCRIPTION
umount() and umount2() remove the attachment of the (topmost) file system mounted
on target.
Appropriate privilege (Linux: the CAP_SYS_ADMIN capability) is required to unmount
file systems.
Linux 2.1.116 added the umount2() system call, which, like umount(), unmounts a
target, but allows additional flags controlling the behavior of the operation:
MNT_FORCE (since Linux 2.1.116)
Force unmount even if busy. This can cause data loss. (Only for NFS mounts.)
MNT_DETACH (since Linux 2.4.11)
Perform a lazy unmount: make the mount point unavailable for new accesses,
and actually perform the unmount when the mount point ceases to be busy.
MNT_EXPIRE (since Linux 2.6.8 )
Mark the mount point as expired. If a mount point is not currently in use, then an
initial call to umount2() with this flag fails with the error EAGAIN, but marks the
mount point as expired. The mount point remains expired as long as it isn't
accessed by any process. A second umount2() call specifying MNT_EXPIRE unmounts
an expired mount point. This flag cannot be specified with either MNT_FORCE
or MNT_DETACH.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
....
to write code calling the umount command. That's now what you wanted, so umount(8 ),
the default returned from the "man umount" request is the correct page. Generally speaking,
the default pages returned from a man request is usually the information the typical user is
asking for.
But, what if you not only don't know how to spell a specific command, you don't even know
the name of a command or even if it exists in the file hierarchy? All you remember is that it
is a command that mounts MSDOS file systems. This is where another valuable Linux
command comes into play. It is called "apropos". You issue
apropos mount
fdlist (1) - Floppy disk mount utility
fdmount (1) - Floppy disk mount utility
fdmountd (1) - Floppy disk mount utility
fdumount (1) - Floppy disk mount utility
fdutilsconfig ( 8 ) - configure the suid bit of fdmount
filesystem (7) - event signalling that filesystems have been mounted
free (1) - Display amount of free and used memory in the system
fusermount (1) - mount FUSE filesystems
Gnome2::VFS::Monitor (3pm) - Monitors volume mounts and unmounts
Gnome2::VFS::Monitor::Handle (3pm) - Monitors volume mounts and unmounts
Gnome2::VFS::Volume (3pm) - Abstraction for a mounted file system or a network location
Gnome2::VFS::VolumeMonitor (3pm) - Monitors volume mounts and unmounts
ifuse (1) - Mount filesystem of an iPhone/iPod Touch.
local-filesystems (7) - event signalling that local filesystems have been mounted
mdu (1) - display the amount of space occupied by an MSDOS directory
mklost+found ( 8 ) - create a lost+found directory on a mounted Linux second extended file...
mmount (1) - mount an MSDOS disk
mount (2) - mount file system
mount ( 8 ) - mount a filesystem
mount.fuse.ntfs ( 8 ) - Read/Write userspace NTFS driver.
mount.ntfs ( 8 ) - Third Generation Read/Write NTFS Driver
mount.ntfs-3g ( 8 ) - Third Generation Read/Write NTFS Driver
mount.ntfs-fuse ( 8 ) - Read/Write userspace NTFS driver.
mountall ( 8 ) - Mount filesystems during boot
mounted (7) - event signalling that a filesystem has been mounted
mounting (7) - event signalling that a filesystem is mounting
mountpoint (1) - see if a directory is a mountpoint
ntfs-3g.probe ( 8 ) - Probe an NTFS volume mountability
ntfsmount ( 8 ) - Read/Write userspace NTFS driver.
remote-filesystems (7) - event signalling that remote filesystems have been mounted
setup (2) - setup devices and file systems, mount root file system
sleep (1) - delay for a specified amount of time
switch_root ( 8 ) - switch to another filesystem as the root of the mount tree.
umount (2) - unmount file system
umount ( 8 ) - unmount file systems
umount2 (2) - unmount file system
virtual-filesystems (7) - event signalling that virtual filesystems have been mounted
fdmount (1) - Floppy disk mount utility
fdmountd (1) - Floppy disk mount utility
fdumount (1) - Floppy disk mount utility
fdutilsconfig ( 8 ) - configure the suid bit of fdmount
filesystem (7) - event signalling that filesystems have been mounted
free (1) - Display amount of free and used memory in the system
fusermount (1) - mount FUSE filesystems
Gnome2::VFS::Monitor (3pm) - Monitors volume mounts and unmounts
Gnome2::VFS::Monitor::Handle (3pm) - Monitors volume mounts and unmounts
Gnome2::VFS::Volume (3pm) - Abstraction for a mounted file system or a network location
Gnome2::VFS::VolumeMonitor (3pm) - Monitors volume mounts and unmounts
ifuse (1) - Mount filesystem of an iPhone/iPod Touch.
local-filesystems (7) - event signalling that local filesystems have been mounted
mdu (1) - display the amount of space occupied by an MSDOS directory
mklost+found ( 8 ) - create a lost+found directory on a mounted Linux second extended file...
mmount (1) - mount an MSDOS disk
mount (2) - mount file system
mount ( 8 ) - mount a filesystem
mount.fuse.ntfs ( 8 ) - Read/Write userspace NTFS driver.
mount.ntfs ( 8 ) - Third Generation Read/Write NTFS Driver
mount.ntfs-3g ( 8 ) - Third Generation Read/Write NTFS Driver
mount.ntfs-fuse ( 8 ) - Read/Write userspace NTFS driver.
mountall ( 8 ) - Mount filesystems during boot
mounted (7) - event signalling that a filesystem has been mounted
mounting (7) - event signalling that a filesystem is mounting
mountpoint (1) - see if a directory is a mountpoint
ntfs-3g.probe ( 8 ) - Probe an NTFS volume mountability
ntfsmount ( 8 ) - Read/Write userspace NTFS driver.
remote-filesystems (7) - event signalling that remote filesystems have been mounted
setup (2) - setup devices and file systems, mount root file system
sleep (1) - delay for a specified amount of time
switch_root ( 8 ) - switch to another filesystem as the root of the mount tree.
umount (2) - unmount file system
umount ( 8 ) - unmount file systems
umount2 (2) - unmount file system
virtual-filesystems (7) - event signalling that virtual filesystems have been mounted
Comment