Using the Command Line | 21




Download 22,59 Mb.
Pdf ko'rish
bet27/225
Sana14.05.2024
Hajmi22,59 Mb.
#232856
1   ...   23   24   25   26   27   28   29   30   ...   225
Bog'liq
learningkalilinux

Using the Command Line | 21


Manual Pages
Historically, the Unix manual has been available online, meaning directly on the
machine. To get the documentation for any command, you would run the program
man
followed by the command you wanted the documentation for. These man pages
have been formatted in a typesetting language called 
troff
. As a result, when you are
reading the man page, it looks like it was formatted to be printed, which is essentially
true. If you need help finding the relevant command-line parameters to get the
behavior you are looking for, you can use the man page to get the details. The man
pages will also provide you with associated commands and information.
The Unix manual was divided into sections, as follows:
• General Commands
• System Calls
• Library Functions
• Special Files
• File Formats
• Games and Screensavers
• Miscellanea
• System Administration Commands and Daemons
When the same keyword applies in several areas, such as 
open
, you just specify which
section you want. If you want the system call open, you use the command 
man 2
open
. If you also need to know relevant commands, you can use the command 
apro‐
pos
, as in 
apropos open
. You will get a list of all the relevant manual entries.
Interestingly, AT&T Unix diverged a bit from BSD Unix. This has resulted in some
command-line parameter variations, depending on which Unix derivation you may
have begun with. For more detailed process listings, including all of the processes
belonging to all users (since without specifying, you get only processes belonging to
your user), you might use either 
ps -ea
or 
ps aux
. Either will provide the complete list,
though there will be differences in the details provided.
The thing about using 
ps
is that it’s static: you run it once and get the list of processes.
Another program can be used to watch the process list change in near-real time.
While it’s possible to also get statistics like memory and processor usage from 
ps
, with
top
, you don’t have to ask for it. Running 
top
will give you the list of processes,
refreshed at regular intervals. You can see sample output in 
Example 1-4
.

Download 22,59 Mb.
1   ...   23   24   25   26   27   28   29   30   ...   225




Download 22,59 Mb.
Pdf ko'rish