Practical Linux Advanced Commands

Source: Internet
Author: User
Tags cpu usage high cpu usage

One, the practical xargs command

Locate/Catalog files that end in. conf and file categories
Command: # Find/-name *.conf-type F-print | Xargs file
Xargs can not only add files to the command, you can also add a lot of other commands, such as a real tar command, you can use the Find command with the TAR command, the special files of the specified path using the Find command, and then with the TAR command will find the file directly packaged, The command is as follows:
# Find/-name *.conf-type F-print | Xargs Tar cjf test.tar.gz

Second, find out the current system memory usage high process

Command: # Ps-aux | SORT-RNK 4 | Head-20
The 4th column of the output is the percentage of memory consumed, and the last column is the corresponding process.

Third, find out the current high CPU usage of the process

Command: # Ps-aux | SORT-RNK 3 | Head-20
The 3rd column of the output is the CPU consumption percentage, and the last one is the corresponding process.
The 3, 4 after the sort command actually represents the 3rd column for sorting, and the 4th column for sorting.

Iv. Viewing the status of TCP connections

Specifies to view the status of TCP connections on port 80, which is useful for analyzing whether a connection is released or for state analysis during an attack.
Command: # Netstat-nat |awk ' {print $6} ' |sort|uniq-c|sort-rn

V. Find the top 20 IPs with the highest number of 80 port requests

# netstat-anlp|grep 80|grep Tcp|awk ' {print $} ' |awk-f: ' {print '} ' |sort|uniq-c|sort-nr|head-n20


Follow up with some advanced commands


This article is from the "Huangyi blog" blog, please be sure to keep this source http://linuxpython.blog.51cto.com/10015972/1961933

Practical Linux Advanced Commands

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.