Chapter 38.
Gathering System Information
Before you learn how to configure your system, you should learn how to gather essential system
information. For example, you should know how to find the amount of free memory, the amount of
available hard drive space, how your hard drive is partitioned, and what processes are running. This
chapter discusses how to retrieve this type of information from your Red Hat Enterprise Linux system
using simple commands and a few simple programs.
38.1. System Processes
The ps ax command displays a list of current system processes, including processes owned by other
users. To display the owner alongside each process, use the ps aux command. This list is a static
list; in other words, it is a snapshot of what was running when you invoked the command. If you want a
constantly updated list of running processes, use top as described below.
The ps output can be long. To prevent it from scrolling off the screen, you can pipe it through less:
ps aux | less
You can use the ps command in combination with the grep command to see if a process is running.
For example, to determine if Emacs is running, use the following command:
ps ax | grep emacs
The top command displays currently running processes and important information about them
including their memory and CPU usage. The list is both real-time and interactive. An example of output
from the top command is provided as follows:
top - 15:02:46 up 35 min,
Tasks: 110 total,
1 running, 107 sleeping,
Cpu(s): 41.1% us,
2.0% sy,
Mem:
775024k total,
Swap:
1048568k total,
PID USER
PR
NI
4624 root
15
4926 mhideo
15
6475 mhideo
16
4920 mhideo
15
1 root
16
2 root
34
19
3 root
5 -10
4 root
6 -10
5 root
5 -10
29 root
5 -10
47 root
16
50 root
11 -10
30 root
15
49 root
16
To exit top, press the q key.
4 users,
load average: 0.17, 0.65, 1.00
0.0% ni, 56.6% id,
772028k used,
176k used,
1048392k free,
VIRT
RES
SHR S %CPU %MEM
0 40192
18m 7228 S 28.4
0 55564
33m 9784 S 13.5
0
3612
968
760 R
0 20872
10m 7808 S
0
1732
548
472 S
0
0
0 S
0
0
0 S
0
0
0 S
0
0
0 S
0
0
0 S
0
0
0
0 S
0
0
0 S
0
0
0
0 S
0
0
0
0 S
0 stopped,
2 zombie
0.0% wa,
0.3% hi,
2996k free,
68468k buffers
441172k cached
TIME+
COMMAND
2.4
1:23.21 X
4.4
0:25.96 gnome-terminal
0.7
0.1
0:00.11 top
0.3
1.4
0:01.61 wnck-applet
0.0
0.1
0:00.23 init
0.0
0.0
0:00.00 ksoftirqd/0
0.0
0.0
0:00.03 events/0
0.0
0.0
0:00.02 khelper
0.0
0.0
0:00.00 kacpid
0.0
0.0
0:00.00 kblockd/0
0.0
0.0
0:01.74 pdflush
0.0
0.0
0:00.00 aio/0
0.0
0.0
0:00.05 khubd
0.0
0.0
0:01.44 kswapd0
0.0% si
525
Need help?
Do you have a question about the ENTERPRISE LINUX 5 - DEPLOYMENT and is the answer not in the manual?
Questions and answers