Monitoring System Processes with top
Having created a new user, the next step is to learn how to monitor running processes in the Kali Linux container using the top
command. This tool is essential for understanding system performance and identifying resource usage.
The top
command provides a real-time, interactive view of processes running on your system. It shows details like CPU usage, memory usage, and process status, which are helpful for troubleshooting performance issues. As the root
user, you can run this command directly without additional privileges.
Install top
if it's not already installed.
apt install -y procps
Type the following command in the terminal and press Enter to start monitoring processes:
top
After executing this command, the terminal will display a continuously updating table of information. The output will look something like this (specific processes and values will vary):
%Cpu(s): 1.0 us, 0.5 sy, 0.0 ni, 98.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 2048.0 total, 512.3 used, 1535.7 free, 10.2 shared, 200.1 buff/cache
MiB Swap: 512.0 total, 0.0 used, 512.0 free
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 12345 2345 1234 S 0.0 0.1 0:01.23 init
123 root 20 0 54321 9876 4321 S 0.0 0.5 0:00.45 bash
Key sections in the top
output include %Cpu(s)
for CPU usage breakdown, MiB Mem
for memory usage, PID
for process ID, %CPU
and %MEM
for resource usage percentages, and COMMAND
for the process name. This information helps you see what is running on your system and identify any resource-intensive processes.
To exit the top
display and return to the terminal prompt, press the q
key on your keyboard. Monitoring processes is a vital skill for system administration, allowing you to maintain system health. With this knowledge, you are prepared to explore system logs in the next step.