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