Linux Top Command- Monitor Linux System Resources Cpu, Memory, Network – POFTUT

Linux Top Command- Monitor Linux System Resources Cpu, Memory, Network


Monitoring Linux systems is one of the most important for system administrators. There are a lot of different monitoring tools that provide different features. We will look in detail those Linux system monitoring software in this tutorial.

Start top Command

The top is the most used, fast simple tool to monitor Linux system resources. It can be easily invoked like below. top command is provided by procps-ng package.

$ top
Top
Top

By default, processes are sorted by their PID number.

top Command Help

To get help h is used. top command help page provides simple and fast information about commands. Information like kill, renice, locate column, toggle sorting, toggle summary, add remove fields

h
Help
Help

Sorting Processes

To sort according to CPU usage use c. The calculation of CPU usage is done withing 2-second intervals. So some process may change position according to their load for 2 second period.

c
Sorting
SortingS

Show Memory Usage As Graph

Show memory information in different ways like bar graph use m.

m
Memory Graph
Memory Graph

Filter Process According To Username

Filter process according to their owner user use u and put user name like. We will get the following line after pressing u and then enter a username where in this example ismail.

u
Which user (blank for all) ismail
Filter Process According To Username
Filter Process According To Username

Kill Process

Kill process with <strong>k and PID. Keep in mind that we need to have the required privileges to kill the process. We will get following like to enter PID and 3555 is our PID.

k
PID to signal/kill [default pid = 4122] 3555
Kill Process
Kill Process

Change To The Color Mode

Toggle to color mode to see a colorful table with z. We can see that the white colors are turned into red. By pressing the z command again the color mode will be changed and turned off to the standard colors.

z
Color Mode
Color Mode

Forest View

Change view of process table like with V to forest view. In the forest, the view provides a hierarchical process view with parent and child processes. This can be useful to get the hierarchy of processes and services. In the following example, we will see that the sshd as a parent-child relationship with the bash where the bash is forked by sshd daemon.

V
Forest View
Forest View

Show Process Absolute Path

While showing the process only the name of the executable is shown by default. To show the absolute path of the process c can be used as below. For example, in the following screenshot running python process is called from the /usr/bin/python with some parameters like -Es .

c
Show Process Absolute Path
Show Process Absolute Path

LEARN MORE  Monitor Linux Cpu, Memory Performance with Htop

2 thoughts on “Linux Top Command- Monitor Linux System Resources Cpu, Memory, Network”

Leave a Comment