Free Republic
Browse · Search
General/Chat
Topics · Post Article

Skip to comments.

The man Command
Linux Information Project ^ | 22 July 2006 | LINFO

Posted on 02/14/2019 12:23:54 PM PST by ShadowAce


The man command is used to format and display the man pages.

The man pages are a user manual that is by default built into most Linux distributions (i.e., versions) and most other Unix-like operating systems during installation. They provide extensive documentation about commands and other aspects of the system, including configuration files, system calls, library routines and the kernel (i.e., the core of the operating system). A configuration file is a type of simple database that contains data that tells a program or operating system how to behave. A system call is a request made via a software interrupt (i.e., a signal to the kernel initiated by software) by an active process for a service performed by the kernel. A library routine is a subprogram that is used by programmers to simplify the development of software.

The man pages are tailored to the particular operating system, and version thereof, on which they are installed. This is beneficial because there can be slight differences in commands and other items according to the particular system.

The descriptions are rather terse, and they can seem somewhat cryptic to new users. However, users typically find them to be increasingly useful as they become more familiar with them and gain experience in the use of Unix-like operating systems.

The man command itself is extremely easy to use. Its basic syntax is

man [option(s)] keyword(s)

man is most commonly used without any options and with only one keyword. The keyword is the exact name of the command or other item for which information is desired. For example, the following provides information about the ls command (which is used to list the contents of any specified directory):

man ls

As another example, the following displays the man page about the man pages:

man man

man automatically sends its output through a pager, usually the program less. A pager is a program that causes the output of any program to be displayed one screenful at a time, rather than having a large amount of text scroll down the screen at high (and generally unreadable) speed.

less writes a colon at the bottom of the screen to indicate the end of the on-screen page. The user can move to the next page by pushing the space bar and can return to the previous page by pressing the b key. Pressing the q exits the man pages and returns the user to the shell program.

Each man page is a self-contained article that is divided into a number of sections, the headers for which are labeled with upper case letters. The sections for commands are typically something like NAME, SYNOPSIS, DESCRIPTION, OPTIONS, AUTHOR, BUGS, COPYRIGHT, HISTORY and SEE ALSO, although there may be some differences according to the particular command. Some of these might be broken down into subsections, particularly OPTIONS in the case of a command that has numerous options.

Also, the man pages as a whole are organized into sections, each containing pages about a specific category of topics as shown below. The section to which an article belongs is indicted in parenthesis in the top line, before the NAME header.

1. executable programs or shell commands
2. system calls
3. library routines
4. special files (i.e., devices in the /dev directory)
5. file formats
6. games
7. macro packages
8. system administration commands
9. kernel routines
n. Tcl/Tk (a programming language)

Some topic names will have multiple articles, depending on context. For instance, there are two articles for mount, one corresponding to its use as a command in system management (i.e., to logically attach partition or other devices to the main filesystem) and the other for use in the C programming language. Generally, the most commonly used topic is displayed by default, and there are references to any other topics with the same name in the SEE ALSO section at the bottom of the final on-screen page.

The syntax to specify an article from a particular section is:

man section_number keyword

Thus, for example, the following would display the article about mount from Section 2 instead of from the default Section 8:

man 2 mount

The -w and -W options tell man to not actually display the man pages, but to provide the location(s) of the file(s) that would be formatted or displayed. If no arguments (i.e., input files) are provided, a list of directories that is searched by man for man pages is returned.

The -f option produces the same output as the whatis command. whatis provides very brief descriptions of commands from a database that is automatically created from the first line of the NAME section of each relevant man page. The -h option displays a terse summary of man's syntax and options.

A simpler version of a man page, i.e., without backspaces and underscores, can be obtained by piping (i.e., transferring) its output to the col command used with its -b option. Thus, for example, the following would write such a version of the man page about the pstree command (which shows the processes currently on the system in a tree diagram) to a text file called pstree.txt (and create a file with this name if it did not already exist):

man pstree | col -b > pstree.txt

Unix-like operating systems often also have an additional built-in manual referred to as the Info documents, the content of which is largely identical to that of the man pages. These documents can be accessed with the info command.

Although the man pages are usually viewed in a console (i.e., all-text mode) or terminal window (i.e., a text-mode window in a GUI), they can also be viewed in the Konquerer web browser, which is included with many Linux distributions. Some users might find that this provides enhanced usability, including the ability to scroll up and down an entire article regardless of its length and greater ease of changing font sizes. Any man article can be displayed in Konquerer by typing man followed by a colon and the name of the program.

Thus, for example, the following would tell Konquerer to display the man page for pstree:

man:pstree

The Linux Information Project (LINFO) is providing an on-line alternative to the man pages with its series of articles about commonly used commands and other aspects of Linux. One major difference is that the LINFO articles are designed to be useful to users of all levels, including absolute beginners. In particular, emphasis is placed on the most useful options for commands and specific examples are often provided. An index, along with brief descriptions, of such articles about commands that have been provided to date is Index of Linux Commands.



TOPICS: Computers/Internet
KEYWORDS: linux
Navigation: use the links below to view more comments.
first 1-2021-23 next last

1 posted on 02/14/2019 12:23:54 PM PST by ShadowAce
[ Post Reply | Private Reply | View Replies]

To: rdb3; Calvinist_Dark_Lord; JosephW; Only1choice____Freedom; Ernest_at_the_Beach; martin_fierro; ...

Posted by request

2 posted on 02/14/2019 12:24:24 PM PST by ShadowAce (Linux - The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 1 | View Replies]

To: ShadowAce

meanwhile the woman command remembers every compilation error and reminds you constantly about it for the next forty years


3 posted on 02/14/2019 12:26:39 PM PST by thoughtomator (Nobody is coming to save the day)
[ Post Reply | Private Reply | To 1 | View Replies]

To: thoughtomator

50


4 posted on 02/14/2019 12:34:04 PM PST by sasquatch
[ Post Reply | Private Reply | To 3 | View Replies]

To: ShadowAce

Would man:beer:pizza work?


5 posted on 02/14/2019 1:14:14 PM PST by dynachrome (Build the wall, deport them all.)
[ Post Reply | Private Reply | To 1 | View Replies]

To: ShadowAce
$ man dildo
No manual entry for dildo

Somebody had to say it.

6 posted on 02/14/2019 1:20:45 PM PST by dayglored ("Listen. Strange women lying in ponds distributing swords is no basis for a system of government."`)
[ Post Reply | Private Reply | To 1 | View Replies]

To: thoughtomator
meanwhile the woman command remembers every compilation error and reminds you constantly about it for the next forty years

You owe me a new keyboard.

7 posted on 02/14/2019 1:35:19 PM PST by zeugma (Power without accountability is fertilizer for tyranny.)
[ Post Reply | Private Reply | To 3 | View Replies]

To: ShadowAce
Many years ago, the first Unix system that I ever supported was DEC-Unix running on an 8810. We actually had a full printed man set. I don't know why. At the time I didn't know much of anything about Unix. In order to find a command, (even using the 'man' program), I first had to know what the command was. I remember the first time I found the 'apropos' command. Suddenly, I could actually search man pages for what I was looking for! OMG, it was like a revelation from God.

I'll admit that man is useful, but it was apropos that finally turned Unix into something other than a bashing-head-on-keyboard event for me.

For Unix virgins, the 'apropos' command searches the titles of man pages for keywords for you. So, if you want to know what commands have something to do with "swap", you might say something like this...

$ apropos swap
all-swaps (7)        - event signalling that all swap partitions have been activated
ecryptfs-setup-swap (1) - ensure that any swap space is encrypted
mkswap (8)           - set up a Linux swap area
swaplabel (8)        - print or change the label or UUID of a swap area
swapoff (8)          - enable/disable devices and files for paging and swapping
swapon (8)           - enable/disable devices and files for paging and swapping

'man -k' will do the same thing, but I still use apropos to this day.

$ man -k swap
all-swaps (7)        - event signalling that all swap partitions have been activated
ecryptfs-setup-swap (1) - ensure that any swap space is encrypted
mkswap (8)           - set up a Linux swap area
swaplabel (8)        - print or change the label or UUID of a swap area
swapoff (8)          - enable/disable devices and files for paging and swapping
swapon (8)           - enable/disable devices and files for paging and swapping

8 posted on 02/14/2019 1:47:12 PM PST by zeugma (Power without accountability is fertilizer for tyranny.)
[ Post Reply | Private Reply | To 1 | View Replies]

To: zeugma
$ man woman
No manual entry for woman
$ apropos woman
woman: nothing appropriate.

9 posted on 02/14/2019 1:48:54 PM PST by zeugma (Power without accountability is fertilizer for tyranny.)
[ Post Reply | Private Reply | To 8 | View Replies]

To: ShadowAce

It’s The Man Show!

It was fun...


10 posted on 02/14/2019 1:51:25 PM PST by W. (Natty Light: The beer so nice, you'll taste it twice!)
[ Post Reply | Private Reply | To 1 | View Replies]

To: ShadowAce

Ping


11 posted on 02/14/2019 3:40:42 PM PST by zeestephen
[ Post Reply | Private Reply | To 1 | View Replies]

To: zeugma
"$ man woman"
"No manual entry for woman"
"$ apropos woman"
"woman: nothing appropriate."


$> man woman
$> Segmentation fault (dumped core)



$> cd /pub
$> more beer

There's no place like 127.0.0.1

12 posted on 02/14/2019 5:36:46 PM PST by Paal Gulli
[ Post Reply | Private Reply | To 9 | View Replies]

To: ShadowAce

Mansplaining?


13 posted on 02/14/2019 6:11:34 PM PST by disclaimer
[ Post Reply | Private Reply | To 1 | View Replies]

To: thoughtomator

Hilarious! Even my wife chuckled at this one. lol


14 posted on 02/15/2019 3:47:39 AM PST by Openurmind
[ Post Reply | Private Reply | To 3 | View Replies]

To: ShadowAce

Thanks Ace! While one with Linux can go hit the help button while online, this could help greatly when offline.


15 posted on 02/15/2019 3:50:23 AM PST by Openurmind
[ Post Reply | Private Reply | To 1 | View Replies]

To: zeugma

Thanks for the bonus “apropos” command here! I have mentioned this before, but the cool thing about the command line is it interacts back with a explanation reply of some kind like it did for you here. As where a DOS prompt doesn’t help at all, just starts flashing again leaving you guessing.


16 posted on 02/15/2019 4:07:10 AM PST by Openurmind
[ Post Reply | Private Reply | To 9 | View Replies]

To: ShadowAce

Please add me to your Linux list.

Quick question: With Ubuntu loaded is there an Fdisk (Windows) equivalent so I can delete ANY partition on an IDE/ATA? Hard Drive (Not SATA).

Thanks for the add to your list in advance - I’ve been lurking for too long. You’re really doing a good job.

Thanks!


17 posted on 02/21/2019 6:16:04 AM PST by Tunehead54 (Nothing funny here ;-)
[ Post Reply | Private Reply | To 1 | View Replies]

To: Tunehead54
You've been added. Welcome!

With Ubuntu loaded is there an Fdisk (Windows) equivalent so I can delete ANY partition on an IDE/ATA? Hard Drive (Not SATA).

I'm not sure I understand you question. Are you looking for a Windows program that will perform the equivalent of fdisk? or are you looking for a GUI fdisk frontend for Ubuntu?

18 posted on 02/21/2019 8:02:36 AM PST by ShadowAce (Linux - The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 17 | View Replies]

To: ShadowAce
"Are you looking for a Windows program that will perform the equivalent of fdisk? or are you looking for a GUI fdisk frontend for Ubuntu? "
Either-Or?

My bench/test PC had Win 10 for testing but I did not like the forced upgrades.

I skipped the "free" upgrade and it just plugged along with occasional notices to upgrade but then the boot drive failed.

Having a box of some 25 drives I just wanted one to boot with Win98SE, just for fun, Win ME or Win 7.

A 250GB drive looked good but the install with Win 98SE removed the partition but then could not proceed.

Win 7 or ME are baffled as well.

I thought Ubuntu might have an Fdisk equivalent to remove a partition and leave a completely clean drive as WIN 98 doesn't understand larger drives and partitioning the drive failed.

I'd probably just go with Win 7 and then set up a multiple boot system options so I could learn Linux.

Short story: I can boot off an Ubuntu USB thumb drive but want a command line (or GUI) method to remove any partition on the SATA drive.

Thanks for putting me on your list.

Charlie

19 posted on 02/22/2019 2:38:57 PM PST by Tunehead54 (Nothing funny here ;-)
[ Post Reply | Private Reply | To 18 | View Replies]

To: Tunehead54
Sure--just run "fdisk "
20 posted on 02/22/2019 2:41:05 PM PST by ShadowAce (Linux - The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 19 | View Replies]


Navigation: use the links below to view more comments.
first 1-2021-23 next last

Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.

Free Republic
Browse · Search
General/Chat
Topics · Post Article

FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson