shell foundation fourth title

Filter the log
if the log format is as follows:
beginning with IP and IP statistics need to filter out the number
xxxx - bkljkl + flkdjjj
x.xxx -lglk + gkljmfklh

awk command prints out the IP address of the first segment
-F to specify the separator, if not specified default to start with a blank
awk '{print $ 1}'
print-out IP can be set for duplicate needs to be sorted are arranged in the same IP adjacent to
sort -n past and sort numbers represented in the form if not N is the ASCII code ordering places
the same weight to the number of simultaneous IP statistics
uniq -c uniq -c weight is the number of rows to repeat the calculation

awk '{print $1}'|sort -n|uniq -c |sort -n

Guess you like

Origin blog.51cto.com/13492528/2411288