cally represented a single person at a single screen. Now you can have many "terminals" on one
screen by opening multiple Terminal windows.
On this shell session, there isn't much happening. The first process shows that the user named
jake
logged in to the login process (which is controlled by the root user). The next process shows
that
jake
is using a bash shell and has just run the
ps au
command. The terminal device
ttyp0
is being used for the login session. The
STAT
column represents the state of the process, with
R
indicating a currently running process and
S
representing a sleeping process.
Several other values can appear under the STAT column. For example, a plus sign (+)
indicates that the process is associated with the foreground operations.
The
USER
column shows the name of the user who started the process. Each process is represented
by a unique ID number referred to as a process ID (PID). (You can use the PID if you ever need to
kill a runaway process.) The
%CPU
and
%MEM
columns show the percentages of the processor and
random access memory, respectively, that the process is consuming.
VSZ
(virtual set size) shows the
size of the image process (in kilobytes), and
RSS
(resident set size) shows the size of the program
in memory.
START
shows the time the process began running, and
TIME
shows the cumulative sys-
tem time used. (Many commands consume very little CPU time, as reflected by 0:00 for processes
that haven't even used a whole second of CPU time.)
Many processes running on a computer are not associated with a terminal. A normal Linux system
has many processes running in the background. Background system processes perform such tasks
as logging system activity or listening for data coming in from the network. They are often started
when Linux boots up and run continuously until it shuts down. To page through all the processes
running on your Linux system, add the pipe (
|
) and the
less
command to
ps aux
, like this:
$ ps aux | less
A pipe (above the backslash character on the keyboard) enables you to direct the output of one
command to be the input of the next command. In this example, the output of the
ps
command (a
list of processes) is directed to the
less
command, which lets you page through that information.
Use the spacebar to page through, and type q to end the list. You can also use the arrow keys to
move one line at a time through the output.
Exiting the Shell
To exit the shell when you are done, type exit or press Ctrl+D.
You've just seen a few commands that can help you quickly familiarize yourself with your Linux
system. There are hundreds of other commands that you can try. You'll find many in the
/bin
and
/usr/bin
directories, and you can use
ls
to see a directory's command list:
ls /bin
, for
example, results in a list of commands in the
/bin
. Then use the
man
command (for example,
man hostname
) to see what each command does. Administrative commands are also in
/sbin
or
/usr/sbin
directory.
NOTE
NOTE
44
Linux First Steps
Part I