7 command-line tools for monitoring Linux systems

Source: Internet
Author: User

One of the best things about Linux is that you can drill into the operating system to explore how it works and look for opportunities to fine tune performance or diagnose problems. Here are some basic command-line tools that allow you to explore and manipulate Linux more easily. Most of these commands are already built into your Linux system, but if they are not, use Google to search for the command name and your distribution name, and you will find which packages need to be installed (note that some commands are bundled with other commands to make a package, and the package you are looking for may be written in a different name). If you know some of the other tools you use, you are welcome to comment.

How do we get started

650) this.width=650; "Src=" http://static.webhek.com/techug-res/uploads/2015/09/ Aa213e02jw1eukoft7gqvj20lo0ebtfb.jpg "alt=" Aa213e02jw1eukoft7gqvj20lo0ebtfb.jpg "/>


Note: This article is taken from a Debian Linux 8.1 ("Jessie"), which runs in a virtual machine in Oracle VirtualBox 4.3.28 under OS X 10.10.3 ("Yosemite") operating system. To build your Debian virtual machine, take a look at my tutorial-"How to install Debian under a VirtualBox VM".

Top

650) this.width=650; "class=" lazy "width=" 690 "height=" 513 "src=" http://static.webhek.com/techug-res/uploads/2015/ 09/aa213e02jw1eukofv14k7j20lo0g4jz1.jpg "style=" border:0px;vertical-align:middle;height:513px;margin-left:-70px ; "/>

As one of the more easy-to-use Linux system monitoring tools, the top command takes us to a glance at almost every part of Linux. The following chart is its default interface, but press the "Z" key to toggle the display color. Other hotkeys and commands have other functions, such as displaying summary information and memory information (second on line fourth), sorting according to different conditions, terminating process tasks, etc. (you can find the complete list here).

Htop

650 ) this.width=650; "Src=" http://static.webhek.com/techug-res/uploads/2015/09/aa213e02jw1eukofxf7djj20lo0g6dq9.jpg "alt=" aa213e02jw1eukofxf7djj20lo0g6dq9.jpg "/>

Compared to top, its alternative htop is more refined. Wikipedia describes this: "Users often deploy htop so that UNIX top does not provide enough information about the system process, such as when you are trying to discover a small memory leak in the application, Htop generally can be used as a system listener. Compared to top, it provides a more convenient cursor control interface to send signals to the process. "(Want to know more details poke here)

Vmstat

650) this.width=650; "class=" lazy "width=" 690 "height=" 552 "src=" http://static.webhek.com/techug-res/uploads/2015/ 09/aa213e02jw1eukofye1n4j20lo0hc792.jpg "style=" border:0px;vertical-align:middle;height:552px;margin-left:-70px ; "/>

Ps

650) this.width=650; "class=" lazy "width=" 690 "height=" 552 "src=" http://static.webhek.com/techug-res/uploads/2015/ 09/aa213e02jw1eukofzcvjfj20lo0hcdk3.jpg "style=" border:0px;vertical-align:middle;height:552px;margin-left:-70px ; "/>

The PS command shows a list of processes that are running. In this case, we use the "-e" option to show each process, that is, all the running processes (I have scrolled the list to the front, otherwise the column name will not be visible). This command has many options to allow you to format the output on demand. Just use a little bit of the regular expression technique above and you'll get a powerful tool. Poke here for more information.

Pstree

650) this.width=650; "class=" lazy "width=" 690 "height=" 552 "src=" http://static.webhek.com/techug-res/uploads/2015/ 09/aa213e02jw1eukog0lbvsj20lo0hctbv.jpg "style=" border:0px;vertical-align:middle;height:552px;margin-left:-70px ; "/>

Pstree "Displays the running process in a tree view. This process tree is based on some PID, and if the PID is omitted, the tree is the root node of init. If you specify a user name, all process trees are displayed for the parent process in the process that the user belongs to. "It's really a very useful tool to sort out the relationships between processes in a tree chart," he adds.

Pmap

650) this.width=650; "class=" lazy "width=" 690 "height=" 550 "src=" http://static.webhek.com/techug-res/uploads/2015/ 09/aa213e02jw1eukog2i4ctj20lo0hagt7.jpg "style=" border:0px;vertical-align:middle;height:550px;margin-left:-70px ; "/>

During debugging, it is important to understand how an application uses memory, and the PMAP is to display relevant information when a process ID is given. The above shows some of the output from using the "-X" option, and you can use the Pmap "-X" option to get more details, but only if you have a wider terminal window.

Iostat

650) this.width=650; "class=" lazy "width=" 690 "height=" 552 "src=" http://static.webhek.com/techug-res/uploads/2015/ 09/aa213e02jw1eukog3871bj20lo0hcwg5.jpg "style=" border:0px;vertical-align:middle;height:552px;margin-left:-70px ; "/>

One of the most important performance metrics for Linux systems is processor and storage usage, which is also what the Iostat command reports. Like the PS command, Iostat has a number of options that allow you to select the output format you want, and you can repeat the sample several times within a certain time frame.


This article is from the Linux Security Advisor blog, so be sure to keep this source http://chengyangyang.blog.51cto.com/9473151/1692777

7 command-line tools for monitoring Linux systems

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.