Purpose: To view the current 20 of the Web Access, and order the first.
Netstat-atupn|grep ": |awk ' {print $} ' |awk-f: ' {print '} ' |sort-n|uniq-c|sort-nr|head-20
The tools you need:
Netstat:
Used to display various network related information, such as network connection, routing table, interface status (Interface Statistics), masquerade connection, multicast member (multicast memberships) and so on!
Awk:
A powerful text analysis tool, compared to grep lookup, sed editing, awk is especially powerful when it comes to analyzing data and generating reports. to put it simply, awk reads the file line-by-row, using spaces as the default delimiter to slice each row, and then perform various analytical processing of the cut.
grep:
Powerful Text Search tool that can use regular expressions to search for text and print matching lines.
Sort
Sort according to different data types
Uniq
Filter repeating sections to display file contents
Head:
used to display the beginning of the file to the standard output , The default head command prints the beginning 10 lines of its corresponding file!
This article is from the "Ningzhiyuan @it sharing" blog, make sure to keep this source http://renzhiyuan.blog.51cto.com/10433137/1836177
View Web current Access small command record!