Linux System Management-Use of the htop command, linux-htop

Source: Internet
Author: User

Linux System Management-Use of the htop command, linux-htop

As one of the most common and important Linux system monitoring tools in daily management, top can dynamically observe the system process status. However, its disadvantage is that it only supports keyboard operations and monotonous display. As I switched from Windows to Linux, now I have a better choice:Htop.

  • Htop Introduction

Htop is an interactive process viewer in the next basic text mode in Linux. It is mainly used in the console or shell to replace top or the advanced version of top.
Advantages of the htop command:

1) Quickly view key performance statistics, such as CPU (multi-core layout) and memory/swap usage;
2) you can scroll through the process list either horizontally or vertically to view all processes and complete command lines;
3) when killing a process, you can directly select it without entering the process number;
4) operate entries with the mouse;
5) faster than top startup;

  • Htop Installation

The htop command is not installed by default like the top Command. Instead, you need to install it manually. Run the command to install apt-get install htop In ubuntu.

  • Common htop function keys 
F1: View htop instructions F2: Set F3: search process F4: filter, search by keyword F5: Display tree structure F6: Select sorting method F7: reduce nice value, in this way, the priority of the corresponding process can be increased by F8: adding the nice value, which can reduce the priority of the corresponding process F9: killing the selected process F10: Exit htop/: search character h: show Help l: display the files opened by the process: If lsof is installed, press this key to display the files opened by the process u: show all users, you can also select a specific user's process s: The system call that calls the strace tracing process t: displays the tree structure H: displays/hides the user thread I: reverses the sorting order K: show/hide kernel thread M: sort by memory usage P: sort by cpu t: sort by running time up/down or PgUP, PgDn: Move the left and right keys of the selected process or Home, End: move list Space (Space): Mark /Unmark a process. Commands can act on multiple processes, such as "kill", and apply to all marked processes.
  • Htop usage

Run htop directly:

The upper-left corner shows the CPU, memory, and swap zone usage, and the right side shows the task, load, and boot time. The following shows the real-time process status.
The last line is F1 ~ F10 function menu and the corresponding letter shortcut.

Press F1 to display the help description:

To set the parameter, press F2:

To add a display entry, press F5 or F6 to add it to the left or right of the top, and F9 to remove it. Each entry supports four display modes: Text, Bar, Graph, and LED. Note that the four effects are displayed in the upper right corner.

Other operations are basically the same as setting BIOS in Windows, and the mouse operation is supported here.

To display the tree structure of a process, enter "t" or press F5, which is similar to the pstree command.


In linux, how do I use system commands?

Disk partition management command: fdisk
Root @ local :~ # Fdisk/dev/sdb (go to disk management and use a USB flash drive for testing)
Command (m for help): p (view all partitions)
Command (m for help): a (set the bootable partition, which is * mark)
Command (m for help): n (create a new partition and allocate space to the new partition. The default starting volume value can be used to avoid space waste and give the space size, for example, + MB indicates that 1 GB of space is to be allocated and the end volume value is automatically calculated)
Command (m for help): t (set the partition type for the new partition. You can use L to display all partition types)
Command (m for help): w (save and exit, but restart to take effect)
Command (m for help): q (exit without saving)

New partitions need to be formatted into the corresponding file system type for use. mkfs is commonly used. ext3 (formatted as ext3, which is commonly used in Linux partitions), mkfs. msdos (formatted as Fat16) and mkfs. vfat (formatted as Fat32), such as mkfs. vfat/dev/sdb1


What are the most basic and frequently used commands in Linux?

60 required commands for Linux (3)-system management
Submitted by zhanjun on Thursday
60 required commands for Linux: system management commands
System Management commands required for Linux
Author: Cao yuan, his posting date: 2004.10.18
For Linux systems, whether it is a central processor, memory, disk drive, keyboard, mouse, or user, it is a file. Linux system management commands are the core of its normal operation. After familiarizing yourself with common Linux File Processing commands, This section describes the commands for managing systems and users.

Cat cd
Chmod chown
Cp cut

Name: cat
Permission: All Users
Usage: cat [-AbeEnstTuv] [-- help] [-- version] fileName
Note: connect the archive string and upload it to the Basic output (screen or add> fileName to another archive)
Parameters:
-N or -- number indicates the number of all output rows starting from 1.
-B or -- number-nonblank is similar to-n, but is not numbered for blank rows.
-S or -- squeeze-blank when there are two consecutive blank rows or more, it is replaced by a blank row
-V or -- show-nonprinting

Example:
Cat-n textfile1> textfile2: add the row number to the file content of textfile1 and enter textfile2.
Cat-B textfile1 textfile2> textfile3 adds the file content of textfile1 and textfile2 to the row number (blank rows are not added) and then attaches the content to textfile3

Name: cd
Permission: All Users

Usage: cd [dirName]

Note: change the working directory to dirName. DirName can be an absolute or relative path. If the directory name is omitted, it is changed to the user's home directory (that is, the directory where the login is located ).

In addition ,"~ "It also indicates the home directory," .. "indicates the current directory, and" .. "indicates the previous directory at the current directory location.

Example: Skip to/usr/bin /:
Cd/usr/bin

Jump to your home directory:
Cd ~

Jump to the top two layers of the current directory:
Cd ../..

Command name: chmod
Permission: All Users

Usage: chmod [-cfvR] [-- help] [-- version] mode file...

Note: file access permissions for Linux/Unix are classified into three levels: file owner, group, and others. Chmod can be used to control how files are accessed by others.

Calculation:

Mode: permission setting string in the following format: [ugoa...] [[+-=] [rwxX]...] [,...], u indicates the owner of the file, g indicates that the owner of the file belongs to the same group, o indicates that the owner of the file belongs to other people, and a indicates that all three are.
+ Adds a permission,-Indicates canceling the permission, and = indicates a unique permission.
R indicates that the file can be read, w indicates that the file can be written, and x indicates that the file can be executed only when the file is a subdirectory or the file has been set to executable.
-C: if the permission of the file has been changed, the change action is displayed.
-F: if the permission for this file cannot be... the remaining full text>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.