A separate command to view memory usage: free -m
View memory and cpu usage command: top
Htop tool may be mounted, so that more intuitive,
Installation command is as follows: sudo apt-get install htop
After installation, enter the command directly: htop
You can see the usage of the memory or cpu.
One of Linux system monitoring tool top as the daily management of the most common and most important, the system can process the status of dynamic observation. But its drawback is that only supports keyboard, display too monotonous. Windows to Linux as just for me, there is now a better choice: htop .
- Introduction htop
htop Linux system is a basic text-mode, interactive process viewer, is mainly used for console or shell, can replace the top, or the top of the senior version.
htop command advantages:
1) quickly view critical performance statistics such as CPU (multi-core layout), memory / swap use;
2) can be horizontally or vertically to scroll through the list of processes to see all processes and complete command line;
3) when you can kill the process direct selection process without the need to enter the number;
4) by mouse entry;
5) starts faster than top;
- htop installation
htop command like top command is installed by default, and we need to manually install the contrary, I am here as an example to Centos system installation. Please refer to the original: the Install htop in CentOS .
It can be used directly yum install on Centos, but only if you first need to install rpmforge package repository:
If you are Centos 5.x, then:
//---- 32-bit ----// wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i686.rpm rpm -Uhv rpmforge-release*.rf.i386.rpm //---- 64-bit ----// wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm rpm -Uhv rpmforge-release*.rf.x86_64.rpm
If you are Centos 6.x, then:
//---- 32-bit ----// wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm rpm -Uhv rpmforge-release*.rf.i386.rpm //---- 64-bit ----// wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm rpm -Uhv rpmforge-release*.rf.x86_64.rpm
After the above installation, can be installed directly yum htop of:
yum install htop
- htop commonly used function keys
F1: View htop Instructions F2: Set F3: search process F4: filter, search by keyword F5: display tree F6: Select Sort F7: reduce the nice value, so that you can increase the priority of the corresponding process F8: nice increase in value, so you can lower the priority of the corresponding process F9: kill the selected process F10: exit htop /: Search character h: display help l: show the process open files: If you install lsof, Press to display process the open files u: displays all users, and the user can select a specific process s: strace trace system calls the process of calling t: display tree H: show / Hide user threads I: reverse the sort order K: show / Hide kernel threads M: Sort by memory usage P: CPU Sort by T: Sort by time running up and down keys or PgUP, PgDn: move the selection process keys or Home, End: move list Space (space): Mark / Unmark a process. Command can act on multiple processes, such as "kill", it will be applied to all tagged process
- htop use
Run directly htop, displayed as shown:
Upper left corner of the display usage of CPU, memory, swap area on the right shows the task load, boot time, the following is the process in real-time conditions.
The last line is a function menu F1 ~ F10 and the corresponding letter shortcut.
Press F1, appears to help explain:
To set up, press the F2:
To add a display when this entry, F5 or F6, respectively, may be added to the left or right side of the above, F9 and so may be removed. Each entry supports four display: Text, Bar, Graph, LED, pay attention to the upper right corner show the effect of these four.
Other basic operations and settings in the Windows BIOS is the same, here are the additional support for mouse operation.
To display the tree structure of the process, you can enter "t" or press F5, the function is similar to pstree command.
Note that there are also many operations can be done with the mouse. I do not know, there will be several times more new discoveries. There is no longer one by one example. With the use of it to know.