In our previous articles, we covered the basics of the ls and cat commands. In this article, we’ll try to explore the topmost command, which is one of the most commonly used commands in our daily system administration tasks.
the above Command (table of processes) shows the processor activity of your Linux box and also shows tasks managed by the kernel in real time. It also shows information about CPU and memory usage from a list of running processes.
You might also be interested in the following tutorials :
- Htop – An interactive process viewer for Linux
- Iotop – Monitor Linux hard drive I / O activity and usage on a per process basis
- bmon – A powerful network bandwidth monitor for Linux
- Find the top 15 processes by memory usage in Linux
1. List all running Linux processes
To list all running Linux processes, just enter above on the command line for information on how to run it tasks, reminder, Central processor, and To deceive. Press ‘
q“To close the window.
2. Sort Linux processes by PID
To sort all running Linux processes by process ID, press
3. Sort Linux processes according to memory and CPU usage
To sort all running Linux processes by memory usage, press
4. Sort Linux processes by runtime
To sort all running Linux processes by runtime, press
5. View Linux processes by specific users
To display all user-specific information on running processes, use the
-u Option will list specifically user Procedural details.
# top -u tecmint
6. Select the running process in Top
z‘Option shows the running process in color, which can help you to easily identify the running process.
7. List the absolute path of the Linux processes running
c‘in the running command top shows the absolute path of the running process.
8. Set the update interval for the command above
By default, the screen refresh interval is set to 3.0 Seconds, the same can be changed by pressing the ‘button.
d‘Option when executing the top command to set the desired interval time.
9. End the running Linux process with the top command
You can kill a process after finding the process’s PID by clicking ‘
k‘when running the top command without closing the top window, as shown below.
10. Sort Linux processes according to CPU usage
To sort all running processes by CPU usage, just press
11. Renice a Linux process
You can use the … ‘
r‘Option to change the priority of the process also called Renice.
12. Check the Linux CPU cores
To list the load information of your CPU cores, just press
1 to list the CPU core details.
13. Save the most important command results to a file
How to save the output of the executed top command to a file /root/.toprc use the following command.
# top -n 1 -b > top-output.txt
14. List Linux idle processes
'i' to get the list of inactive / sleeping processes.
15. How to get help for the top commands
Press the ‘
h‘for supreme command.
16. Exit the top command after a certain repetition
The output of the top command is updated until you ‘
q‘. The following command will automatically exit after 10 repetitions.
# top -n 10
There are a number of arguments for finding out more about that above Command, you can refer to the above Command. Please share if you find this article useful or share your thoughts using our comments box below.