The very basic commands and easily implementable ones are known to be the Linux Top commands. These are used to show the processes and their details. It shows the summary of information of all the running processes in the system. This interface of the top command is divided into two parts. One shows the stats value, whereas the lower one shows the list of running processes.

Display all the processes

This shows the process ids and their information. The information like tasks, CPU, and memory is also displayed. The window of the top command can be quit by using the key ‘q’.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/1-14.jpg" data-lazy- height="509" src="data:image/svg xml,” width=”719″>

Processes of the particular user

If we want to know the process of a specific user, we will use the below command to know the details.

As we have a user name aqsayasin so we will try this one to examine all process details.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/2-13.jpg" data-lazy- height="334" src="data:image/svg xml,” width=”711″>

Color the process

To identify or clarify, the running process can be highlighted or colored by using a specific keyword, “z”. This will support identifying the running process very easily. You need to use the command while the process is running. Because once you have quit the process detail and then apply the color. That will never work. It will only work in the existence of the running processes of the user.

Press “z

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/3-12.jpg" data-lazy- height="425" src="data:image/svg xml,” width=”715″>

If you want to remove the color or go back in the previous situation, press the same key.

Color the respective column

To highlight the specific column from the result, you need to use the key ‘b’ in running the top command prompt.

Press ‘b

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/4-11.jpg" data-lazy- height="475" src="data:image/svg xml,” width=”718″>

Change the delay time or add interval

Many processes of the same or different users are running at a time. To speed up the system process or to do it more accurately, we need to add time intervals between the processes. In Linux, this could be done by pressing the ‘d’ option that changes the delay time. By default, it is 3, but we can change it by providing the new number. It is also known to be screen refresh interval.

Press “d

Change delay from 3.0 to 4.0

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/5-10.jpg" data-lazy- height="169" src="data:image/svg xml,” width=”717″>

The output shows that the delay option is changed from 3 to 4. “d” option deals with specifying the delay between the screen updates. This time is again changed back by using again “d” or the key “s”. The negative number is not allowed to enter for the delay time.

If you want to check the delay time between the screens updating and you have to exit the top command. So you can check it by:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/6-10.jpg" data-lazy- height="23" src="data:image/svg xml,” width=”428″>

Kill the task/process

You can kill the task by finding the PID you want to cease working. To abort the process, you may have to do two things. One is to either press enter tab at the PID prompt, or the other is to type O at the signal prompt. This can be done by pressing the option “k” in the top running command. Make sure you have not exited from that window; otherwise, it will not work.

Press K

PID to signal/kill[default pid = 2057] 2095

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/7-7.jpg" data-lazy- height="222" src="data:image/svg xml,” width=”726″>

After pressing the key, the screen will show the line that will want a PID from you so that the system identifies this id and abort it. The output shows that we have provided the recent id 2095 to be ceased.

Search the process

You can filter the process list according to your own choice by providing the criteria like memory usage, CPU process name, etc. For this purpose, you need to press ‘o’ in the running top command prompt.

Press O

When you press the key ‘o’, a line will be shown; this will show the format of the filter.

Add filter #1 (ignoring case) as: [!] FLD? VAL

The field you want to search can write after the line has ended. Suppose we want to filter the result with the help of a command name so that I will write this like.

COMMAND = rcu_ta

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/8-6.jpg" data-lazy- height="172" src="data:image/svg xml,” width=”725″>

After that, hit enter tab. After this, you will see that only the lines having command equals to your searched criteria are shown in the result.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/9-4.jpg" data-lazy- height="113" src="data:image/svg xml,” width=”722″>

Renice a task/process

If you want to change the priority of any process or a task, then use option ‘r’. After entering the key to the prompt, a line will be shown where you need to enter the PID to change the priority.

Press ‘r

PID to renice [default pid = 2057]

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/10-4.jpg" data-lazy- height="211" src="data:image/svg xml,” width=”728″>

If you write a positive number, then it will cause the current process to lose priority. Whereas the negative number will cause the kernel to give it more importance.

Show /Hide the process information

1. Using l

This will hide the average load information from the screen that is present at the top of the description. You can see the output from the image.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/11-3.jpg" data-lazy- height="103" src="data:image/svg xml,” width=”727″>

2.Using m

This key will hide the memory information from the description.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/12-3.jpg" data-lazy- height="109" src="data:image/svg xml,” width=”732″>

3. Using t

This will hide the information of the CPU and tasks present in the system.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/13-4.jpg" data-lazy- height="135" src="data:image/svg xml,” width=”657″>

4. Using f

F implies the columns at the top. By default, the top command shows some columns. Whereas there are many columns behind. You can manage the columns by hiding and showing them by your choice. It is done by pressing f in the top command prompt.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/14-3.jpg" data-lazy- height="368" src="data:image/svg xml,” width=”736″>

Operating Batch-mode

To observe the batch mode, you need to exit the top command prompt and then write the command. This is used to send output to other processes or the file.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/15-2.jpg" data-lazy- height="329" src="data:image/svg xml,” width=”720″>

Top command-line

If you want to see the last state/position of the processes when you have closed at the last time, then we can use the ‘c’ option in the command. The last state is reserved. So when you next time opens the top command prompt, it will start from the same state.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/16-2.jpg" data-lazy- height="386" src="data:image/svg xml,” width=”721″>

Top mode security

If you want to secure your top command resultant value mode, you can do this by using the ‘s’ key in the top command.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/17-1.jpg" data-lazy- height="313" src="data:image/svg xml,” width=”720″>

Idle processes are toggled by a specific key

We will use ‘I’ to toggle the idle or sleepy processes.

Press ‘i

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/18-1.jpg" data-lazy- height="119" src="data:image/svg xml,” width=”721″>

Sort reversely

To arrange the output in reverse order or to display it in ascending order, you need to use the ‘R’ key in the command.

Press ‘R

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/19-1.jpg" data-lazy- height="307" src="data:image/svg xml,” width=”714″>

Display output in different panels

If you want to split the output view, you may use the A key in the top command prompt. Each panel will contain different files and different sets in the display.

Press ‘A

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/20-1.jpg" data-lazy- height="477" src="data:image/svg xml,” width=”716″>

Conclusion

This article is collectively done by adding the simplest to critical examples of the Linux Top commands. These commands show the daily usage in the Linux operating system.

About the author

<img alt="" data-del="avatar" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/Author-Image-150×150.jpg60ef1617e3c52.jpg" height="112" src="data:image/svg xml,” width=”112″>

Aqsa Yasin

I am a self-motivated information technology professional with a passion for writing. I am a technical writer and love to write for all Linux flavors and Windows.