Nux The Process management tool to replace top htop
This article turns from: http://www.cnblogs.com/mchina/archive/2013/03/15/2858041.html
introduction of Htop
This is htop, a interactive process viewer for Linux. It is a text-mode application (for console or X terminals) and requires ncurses.
Comparison between Htop and top In ' htop ' can scroll the list of vertically and horizontally to-all processes and complete command lines. In ' top ' you are subject to a delay for each unassigned key and press (especially annoying when multi-key escape sequences are triggered by accident). ' Htop ' starts faster (' top ' seems to collect data for a while before displaying anything). In ' Htop ' and don ' t need to type ' process # to kill a process, in ' top '. In ' Htop ' and don ' t need to type the process number or the priority value to renice a process, in ' top '. ' Htop ' supports mouse operation, ' top ' doesn ' the ' is older, hence, more used and tested.
Htop is an interactive process viewer in a Linux system, a text-mode application (in the console or X terminal) that requires ncurses.
Compared with the Linux traditional top, htop is more humane. It enables users to interact, support color themes, scroll through the list of processes horizontally or vertically, and support mouse operations.
Compared to top, Htop has the following advantages: You can scroll through the list of processes horizontally or vertically to see all the processes and complete command lines. On startup, faster than top. You do not need to enter the process number to kill the process. Htop supports mouse operation. Top is already very old.
Htop Official website: http://htop.sourceforge.net/
Second, htop installation
A. Source Package installation
# tar ZXVF htop-1.0.2.tar.gz
# CD htop-1.0.2
#./configure
# Make && make install
If an error occurs:
Configure:error:You may want to use--disable-unicode or install LIBNCURSESW.
You will need to install Ncurses-devel
# yum Install Ncurses-devel
B. Rhel/centos installation
You can install it by yum install Htop, but only if you want to add Epel yum Source, please refer to CentOS source configuration and use.
# RPM-IVH http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# RPM--import/etc/pki/rpm-gpg/rpm-gpg-key-epel//import KEY
# yum Install Htop
three, htop parameter
Type the htop command to open htop.
# Htop
The upper left corner shows the CPU, memory, swap area usage, the right display task, load, boot time, the following is the process of real-time status.
Below is the function of the F1~F10 and the corresponding letter shortcut keys.
Shortcut Key |
Function Key |
Description |
Chinese description |
H? |
F1 |
Invoke Htop Help |
View Htop Usage Instructions |
S |
F2 |
Htop Setup Menu |
Htop Set |
/ |
F3 |
Search for a Process |
Search process |
\ |
F4 |
Incremental process filtering |
Incremental process Filter |
T |
F5 |
Tree View |
Show tree structure |
> |
F6 |
Sort by a column |
Select a Sort method |
[ |
F7 |
Nice-(change priority) |
Can reduce the nice value so that the priority of the corresponding process can be increased |
] |
F8 |
Nice + (change priority) |
You can increase the nice value so that you can reduce the priority of the corresponding process |
K |
F9 |
Kill a Process |
Can pass signal to process |
Q |
F10 |
Quit Htop |
End Htop |
command line option (Command-Line options)
-C--no-color Use a monochrome color scheme
-D--delay=delay Set delay update time, in seconds
-H--help Display htop command Help information
-U--user=username the process of displaying only a given user
-P--pid=pid,pid ... Show only the given PIDs
-S--sort-key column sorted by
-v–version Display version Information
Interactive Commands (INTERACTIVE COMMANDS)
Up or down key or pgup, PgDn Select the desired process, left or right key or home , end Mobile field, of course, you can select the process directly with the mouse;
Space Mark/Unmark a process. Commands can be used with multiple processes, such as "kill", and will be applied to all marked processes
U Unmark All Processes
s Select a process, press S: System call to track processes with Strace
l Displays the files opened by the process: if Lsof is installed, press this key to display the files opened by the process
I Reverse the sort order, and if the order is positive, it reverses backwards and vice versa.
+, - When in the tree view mode, expand or collapse subtree. When a subtree are collapsed a "+" sign shows to the ' left ' of the process name.
A (on a multiprocessor machine) set CPU affinity: Mark which CPUs a process allows to use
u Show specific user processes
M Press memory to use sort
P by CPU use sort
T Press time+ to use sort
F Trace process: If the sort order causes the selected process to move around the list, let the selected bar follow the process. This is useful for monitoring a process: In this way, you can make a process visible on the screen all the time. Using the arrow keys stops the feature.
K Show/Hide Kernel threads
H Show/Hide User threads
ctrl-l Refresh
Numbers PID lookup: Input PID, the cursor will move to the corresponding process
iv. use of Htop
4.1. Show help with Self
Mouse click Help or press F1 to display its own assistance
4.2. Htop Set
The mouse clicks on the setup or presses the F2 to enter Htop to set the page, Meters page set the top of some information display, the top of the display is divided into the left and right sides, in the end can show what can be added to the rightmost column, to add to the top left (F5) or right (F6) can be, This is the scope of the individual set. There's an extra clock here.
The top left and right two columns of the display mode is divided into text bar graph Led Four kinds, the following figure I will be the CPU memory swap to text mode display, and then the right-hand column of the change to bar display, clock with Led mode display. The data show all the same, but this is a bit out of the habit.
The setting of display options can be set according to the manager's own needs.
Color selection, in addition to the basic color display, Htop also provides the function of changing the panel, in fact, only to change the settings of some color display, although it can not be customized to the details of the color display, but at least provide several styles to choose from.
The final setting is to adjust the display of Columns, that is, in general htop instructions come in hope to see what kind of data and information, the adjustment of the field can be personalized in this setting, the general use of the system default value is good.
4.3. Search process
Mouse click Search or press F3 or enter "/", enter the process name for search, such as search SSH
4.4. Filter
Press F4 to enter the filter, which is equivalent to keyword search, case-insensitive, such as filter dev
4.5. Show tree structure
Enter "T" or press F5, show tree structure, meaning like Pstree, can see the structure of all program tree execution, this is quite convenient for system management, how to clarify the procedure is how to produce, of course, the browsing of the tree-like structure can also be sorted according to other data.
4.6. Select the Sort method
Press F6 can choose according to what to order, the most often sorted content is CPU and memory bar.
4.7 Operational processes
F7, F8 respectively corresponding to the nice-and nice+,f9 corresponding kill to the process signal, select a good signal return to OK
4.8. Display a user's process, select the user on the left
Enter "U" and select User on the left
Five, Alias top
Maybe you used top, we can also use top to open htop.
Edit the/ROOT/.BASHRC file and add the following code
if [-f/usr/local/bin/htop]; Then
alias top= '/usr/local/bin/htop '
fi
# SOURCE/ROOT/.BASHRC Category: Linux