最も訪問されたIPに基づいてApacheログを並べ替える

最も訪問されたIPに基づいてApacheログを並べ替える
cat access.log | grep -o "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" | sort -n | uniq -c | sort -n

私はこの言葉を理解していません。誰が説明してください。

ベストアンサー1

ログファイルを読み、IPを一致させ、数を数えます。

男grepは言った:

 -o, --only-matching
              Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line.

男の種類は言う:

-n, --numeric-sort
              compare according to string numerical value

マンユニクはこう言った。

-c, --count
              prefix lines by the number of occurrences

おすすめ記事