Open jbeadling opened 1 year ago
The top & htop commands are used for monitoring system processes and resource usage in a Unix-like operating system. the htop
command is an improved and more user friendly version of top
with additional features and an interactive interface.
Below we use top to identify the top 5 CPU-consuming processes, the top
command automatically show the top 5 CPU-consuming processes for all cores. It updates in real time.
Below we use htop to sort the process by memory. htop displays process by CPU usage by default so when htop is running you press f6 which opens the sortby menu, you then use the arrow keys to select the "PERCENT_MEM" option. htop will then sort processes by memory usage
Below we use top to do the same thing (sort processes by MEM) by using the -o to specify we want to sort by a different parameter (in this case memory) and the -n to select how many times we want to update the display (in this case 10)
Below we use htop to kill a process, when htop is running simply use the arrow keys to select the specific process you want, press F9 which will open a menus to select which signal you want to send the process, at which point you can send a SIGKILL to that process to kill it.
Summary
Learn how to monitor system health in real-time using
top
andhtop
on a Unix-like operating system. Gain insights into CPU, memory usage, running processes, and other system metrics.Description
Objective: Acquire the skills to effectively monitor system health, resources, and performance using
top
andhtop.
Scope:
top
andhtop
Learning Tasks
Introduction to
top
andhtop
:top
andhtop
and how they differ.Key Metrics:
Using Flags and Options:
Best Practices:
Hands-on Practice:
top
and identify the top 5 CPU-consuming processes.htop
to sort processes by memory usage.top
to show only specific metrics.htop
to kill a specific process.Troubleshooting:
top
andhtop
and how to resolve them.Learning Goals
top
andhtop
features.Priority