In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to use the htop command in Linux". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn how to use the htop command in Linux.
Htop command in Linux
The following is an excerpt from the htop manual page:
It is similar to the top command, but allows you to scroll vertically and horizontally, so you can see all the processes running on the system, as well as their complete command line.
You can perform related operations (killing, renicing) on a process without entering its PID.
First of all, understand its output.
The htop command displays information in an intuitive format. Here is a snapshot of the output of HTOP:
If you look at the upper left corner of the window, you will see real-time information about CPU load, memory consumption and swap space, while the upper right corner contains information about tasks, threads, average load, and system elapsed time.
The average load section provides three numbers, which only represents the average load of the system in the past 5 minutes, 10 minutes, and 15 minutes. In a single-core system, an average load of 1 represents CPU utilization. * uptime is the total elapsed time from the start of the system to the current run time.
Next, we will discuss this command further with an example.
1. Edit the configuration with the F2 key
The htop command provides a number of custom options, and all you have to do is press F2 from the main window.
The following shows the available customization options:
Simply use the arrow keys to select and change specific settings.
two。 Send a signal through F9 key
The htop command allows you to easily send arbitrary signals to a process within the htop window. Just press F9.
As you can see, the left part of the window lists all the available signals, and the right part lists the process. Just select the signal, select a process, and then press the enter key, and the selected signal will be sent to that process.
3. Displays a tree view of the process
The htop command also provides a tree view of the process. Press F5 to switch.
Here is an example of how htop displays tree view information:
To exit tree view mode, press F5 again.
4. Search for processes with F3 key
The htop command provides an easy-to-use way to search for processes. Press F3 and a text box appears at the bottom of the window.
Here is an example:
As you can see, a text prompt named 'search' appears at the bottom of the window, where you can enter the name of the process and enter to search. If found, it highlights the process in the list of processes listed.
5. Set the color labeling process entry through the spacebar
In the real-time process view running in the system, it is a big problem to track a process. Because the whole list is constantly refreshing, the order of the processes is also changing. To solve this problem, htop provides a very simple solution: color labeling. Yes, you can mark a process entry, which will be displayed in different colors, so it becomes easy to track it.
To label a process entry, all you need to do is select the entry and press the space key. For example, in the following screenshot example, I have color-marked three process entries:
So in this way, you can easily track the progress you want to see.
6. Command line options
In addition to some of the hotkeys described above, htop provides useful command-line options. Here are some of them:
-s option: sort by the specified column. For example, the htop-s PID command is sorted by the size of the PID column.
-u option: displays a list of process information for the specified user. For example, the htop-u himanshu command shows only related processes with the username himanshu.
-d option: sets the delay time for refresh. For example, the htop-d 100 command causes the output to be refreshed after 1 second (the parameter-d is in 10 microseconds).
The above is all the contents of the article "how to use htop commands in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.