{"id":124267,"date":"2026-11-18T18:49:03","date_gmt":"2026-11-18T10:49:03","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/124267.html"},"modified":"2026-11-18T18:49:03","modified_gmt":"2026-11-18T10:49:03","slug":"mac-%e5%bd%93%e4%b8%bb%e6%9c%ba%ef%bc%8clinux-%e5%bd%93%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8826%ef%bc%89%e7%bb%84%e5%90%88%e6%8b%b3-grep-awk-sed-%e4%b8%89%e4%bb%b6%e5%a5%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/124267.html","title":{"rendered":"Mac \u5f53\u4e3b\u673a\uff0cLinux \u5f53\u670d\u52a1\u5668\uff0826\uff09\u7ec4\u5408\u62f3\u2014\u2014grep + awk + sed \u4e09\u4ef6\u5957"},"content":{"rendered":"<p>\u6458\u8981\uff1a\u4e09\u628a\u5200\u90fd\u5b66\u4f1a\u4e86\uff0c\u4f46\u771f\u6b63\u5e72\u6d3b\u65f6\u8981\u628a\u5b83\u4eec\u4e32\u8d77\u6765\u3002\u8fd9\u7bc7\u7528\u4e00\u4efd\u300c\u65e5\u5fd7\u65e5\u62a5\u300d\u7684\u4e03\u6761\u9700\u6c42\uff0c\u628a grep \u7684\u7b5b\u3001awk \u7684\u7b97\u3001sort | uniq -c \u7684\u7edf\u8ba1\u4e32\u6210\u4e00\u6761\u7ba1\u9053\uff1a\u8bbf\u95ee\u603b\u91cf\u3001Top IP\u3001Top URL\u3001\u72b6\u6001\u7801\u5206\u5e03\u30015xx \u5b9a\u4f4d\u3001\u5e73\u5747\u54cd\u5e94\u5927\u5c0f\u3001\u6392\u9664\u5185\u7f51\u540e\u7684\u8bbf\u95ee\u91cf\u3002\u7136\u540e\u662f\u4e24\u4e2a\u66f4\u503c\u94b1\u7684\u6280\u80fd\u2014\u2014\u5982\u4f55\u7528\u300c\u5206\u6bb5\u6267\u884c\u300d\u8c03\u8bd5\u4e00\u6761\u7ed3\u679c\u4e0d\u5bf9\u7684\u7ba1\u9053\uff0c\u4ee5\u53ca**\u300c\u7a7a\u7ed3\u679c\u300d\u672c\u8eab\u5c31\u662f\u4e00\u79cd\u7ed3\u8bba**\u3002<\/p>\n<p>\u627f\u63a5\u4e0a\u7bc7\uff1ased \u7ec3\u719f\u4e86\uff0c\u80fd\u8131\u654f IP\u3001\u63d0\u53d6\u65f6\u95f4\u6bb5\u3001\u5220\u9664\u7a7a\u884c\u548c\u6ce8\u91ca\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261118104853-6afd82950ae93.png\" alt=\"Mac \u5b66 Linux \u7b2c 26 \u7bc7\uff1a\u4e09\u628a\u5200\uff0c\u4e32\u8d77\u6765\u624d\u662f\u771f\u529f\u592b\u3002\"><\/p>\n<hr>\n<h3>\u4e00\u3001\u8001\u5468\u7684\u4efb\u52a1\uff1a\u65e5\u62a5<\/h3>\n<p>\u5468\u4e00\u65e9\u4e0a\uff0c\u8001\u5468\u4e22\u7ed9\u5c0f\u6797\u4e00\u5f20\u7eb8\u3002\u4e0a\u9762\u5199\u7740\uff1a<\/p>\n<p>\u65e5\u5fd7\u5206\u6790\u65e5\u62a5<br \/>\n1. \u8bbf\u95ee\u603b\u91cf<br \/>\n2. Top 10 IP<br \/>\n3. Top 10 URL<br \/>\n4. \u72b6\u6001\u7801\u5206\u5e03<br \/>\n5. 5xx \u9519\u8bef\u5bf9\u5e94\u7684 URL<br \/>\n6. \u5e73\u5747\u54cd\u5e94\u5927\u5c0f<br \/>\n7. \u6392\u9664\u5185\u7f51 IP \u540e\u7684\u8bbf\u95ee\u91cf<\/p>\n<p>\u300c\u4f60\u4ee5\u540e\u6bcf\u5929\u8981\u51fa\u4e00\u4efd\u3002\u8001\u677f\u8981\u770b\uff0c\u6211\u4e5f\u8981\u770b\u3002\u300d\u8001\u5468\u8bf4\uff0c\u300c\u4f60\u624b\u52a8\u505a\uff0c\u8fd8\u662f\u5199\u811a\u672c\uff1f\u300d<\/p>\n<p>\u300c\u5199\u811a\u672c\u3002\u300d<\/p>\n<p>\u300c\u5bf9\u3002\u4f46\u4f60\u5199\u811a\u672c\u4e4b\u524d\uff0c\u5f97\u5148\u77e5\u9053\u6bcf\u6761\u600e\u4e48\u7b97\u3002\u4eca\u5929\u628a\u4e03\u6761\u547d\u4ee4\u5199\u51fa\u6765\uff0c\u660e\u5929\u518d\u6574\u5408\u6210\u811a\u672c\u3002\u300d<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261118104900-6afd829cb04ac.png\" alt=\"\u4e00\u4efd\u65e5\u62a5\uff0c\u4e03\u6761\u547d\u4ee4\"><\/p>\n<hr>\n<h3>\u4e8c\u3001\u7b2c\u4e00\u6b65\uff1a\u8bbf\u95ee\u603b\u91cf<\/h3>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">\\&#8217;END {print NR}\\&#8217;<\/span> \/var\/log\/nginx\/access.log<\/p>\n<p>\u8f93\u51fa\uff1a<\/p>\n<p>102347<\/p>\n<p>\u300c\u548c wc -l \u4e00\u6837\u3002\u300d\u5c0f\u6797\u8bf4\u3002<\/p>\n<p>\u300c\u5bf9\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u65e5\u5fd7\u6ca1\u6709\u7a7a\u884c\u3002\u300d\u8001\u5468\u8bf4\uff0c\u300c\u4f46\u4f60\u8981\u517b\u6210\u4e60\u60ef\u2014\u2014\u7edf\u8ba1\u7528 awk\uff0c\u4e0d\u7528 wc\u3002awk \u66f4\u7075\u6d3b\uff0c\u540c\u4e00\u5957\u8bed\u6cd5\u968f\u65f6\u80fd\u52a0\u6761\u4ef6\u3002\u300d<\/p>\n<p><span class=\"token comment\"># \u53ea\u770b 200 \u7684\u6570\u91cf<\/span><br \/>\n<span class=\"token function\">awk<\/span> <span class=\"token string\">\\&#8217;$9 == 200\\&#8217;<\/span> \/var\/log\/nginx\/access.log <span class=\"token operator\">|<\/span> <span class=\"token function\">wc<\/span> <span class=\"token parameter variable\">-l<\/span><\/p>\n<hr>\n<h3>\u4e09\u3001\u7b2c\u4e8c\u6b65\uff1aTop IP<\/h3>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">\\'{print $1}\\&#8217;<\/span> \/var\/log\/nginx\/access.log <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">uniq<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> <span class=\"token parameter variable\">-rn<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">head<\/span> <span class=\"token parameter variable\">-5<\/span><\/p>\n<p>\u8f93\u51fa\uff1a<\/p>\n<p>  68000 192.168.1.100<br \/>\n  12000 192.168.1.101<br \/>\n   8000 192.168.1.102<br \/>\n   6000 192.168.1.103<br \/>\n   4000 192.168.1.104<\/p>\n<p>\u300c\u7b49\u7b49\uff0c\u8fd9\u4e9b\u5168\u662f\u5185\u7f51 IP\u3002\u300d\u5c0f\u6797\u8bf4\uff0c\u300c\u6211\u535a\u5ba2\u4e0d\u662f\u7ed9\u5916\u9762\u770b\u7684\u5417\uff1f\u300d<\/p>\n<p>\u300c\u4f60\u672c\u5730\u865a\u62df\u673a\uff0c\u54ea\u6765\u7684\u5916\u7f51\uff1f\u300d\u8001\u5468\u8bf4\uff0c\u300c\u4f60\u4ee5\u540e\u4e0a\u751f\u4ea7\uff0c\u5c31\u4f1a\u770b\u5230\u771f\u5b9e\u516c\u7f51 IP\u3002\u73b0\u5728\u5148\u7ec3\u624b\u3002\u300d<\/p>\n<p>\u6ce8\u610f\u8fd9\u53ea\u662f Top 5\u3002 \u5185\u7f51\u8fd8\u6709\u4e00\u5c0f\u6279\u8bbe\u5907\u5404\u5237\u4e86\u51e0\u5341\u5230\u51e0\u767e\u6b21\u2014\u2014\u300cTop N \u7684\u5408\u8ba1\u300d\u4e0d\u7b49\u4e8e\u300c\u603b\u6570\u300d\u3002\u65e5\u62a5\u91cc\u4e4b\u6240\u4ee5\u300c\u603b\u91cf\u300d\u548c\u300cTop N\u300d\u90fd\u8981\u7ed9\uff0c\u5c31\u662f\u56e0\u4e3a\u4e00\u4e2a\u8bf4\u89c4\u6a21\u3001\u4e00\u4e2a\u8bf4\u7ed3\u6784\u3002\u8fd9\u4e5f\u662f\u540e\u9762\u7b2c\u4e03\u6b65\u300c\u6392\u9664\u5185\u7f51\u300d\u6709\u610f\u4e49\u7684\u6839\u672c\u539f\u56e0\u3002<\/p>\n<hr>\n<h3>\u56db\u3001\u7b2c\u4e09\u6b65\uff1aTop URL<\/h3>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">\\'{print $7}\\&#8217;<\/span> \/var\/log\/nginx\/access.log <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">uniq<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> <span class=\"token parameter variable\">-rn<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">head<\/span> <span class=\"token parameter variable\">-10<\/span><\/p>\n<p>\u8f93\u51fa\uff1a<\/p>\n<p>   3000 \/posts\/my-first-post\/<br \/>\n   1500 \/<br \/>\n   1100 \/posts\/old-post\/<br \/>\n    900 \/posts\/hello-world\/<br \/>\n    800 \/tags\/hugo\/<br \/>\n    500 \/about\/<br \/>\n    300 \/images\/hugo-logo.png<br \/>\n    200 \/favicon.ico<br \/>\n    100 \/archives\/<br \/>\n     50 \/categories\/<\/p>\n<p>\u300c\u4f60\u7684\u6587\u7ae0\u6700\u9ad8\uff0c\u9996\u9875\u7b2c\u4e8c\u3002\u300d\u8001\u5468\u8bf4\uff0c\u300c\u6ce8\u610f\u7b2c\u4e09\u540d \/posts\/old-post\/\u2014\u2014\u8fd9\u7bc7\u6587\u7ae0\u4f60\u4e0d\u662f\u5220\u4e86\u5417\uff1f1100 \u6b21\u8bbf\u95ee\uff0c\u5168\u662f 404\u3002\u300d<\/p>\n<p>\u300c\u6709\u4eba\u4ece\u5916\u9762\u94fe\u8fc7\u6765\u4e86\uff1f\u300d<\/p>\n<p>\u300c\u5bf9\u3002\u8fd9\u5c31\u662f Top URL \u7684\u4ef7\u503c\uff1a\u5b83\u4f1a\u544a\u8bc9\u4f60\u300c\u7528\u6237\u5b9e\u9645\u5728\u8bbf\u95ee\u4ec0\u4e48\u300d\uff0c\u5305\u62ec\u90a3\u4e9b\u5df2\u7ecf\u4e0d\u5b58\u5728\u7684\u9875\u9762\u3002 \u4f60\u4ee5\u540e\u8981\u5b9a\u671f\u770b\u4e00\u773c\uff0c\u628a\u6b7b\u94fe\u4fee\u6389\uff0c\u6216\u8005\u505a 301 \u8df3\u8f6c\u3002\u300d<\/p>\n<hr>\n<h3>\u4e94\u3001\u7b2c\u56db\u6b65\uff1a\u72b6\u6001\u7801\u5206\u5e03<\/h3>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">\\'{print $9}\\&#8217;<\/span> \/var\/log\/nginx\/access.log <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">uniq<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> <span class=\"token parameter variable\">-rn<\/span><\/p>\n<p>\u8f93\u51fa\uff1a<\/p>\n<p>  95000 200<br \/>\n   5000 404<br \/>\n   1500 301<br \/>\n    500 500<br \/>\n    347 502<\/p>\n<p>\u987a\u624b\u5bf9\u4e2a\u8d26\uff1a 95000 + 5000 + 1500 + 500 + 347 = <\/p>\n<p>            <span id=\"quality-guide-article-end\" aria-hidden=\"true\" style=\"display:block;height:1px;margin-bottom:-1px\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6458\u8981\uff1a\u4e09\u628a\u5200\u90fd\u5b66\u4f1a\u4e86\uff0c\u4f46\u771f\u6b63\u5e72\u6d3b\u65f6\u8981\u628a\u5b83\u4eec\u4e32\u8d77\u6765\u3002\u8fd9\u7bc7\u7528\u4e00\u4efd\u300c\u65e5\u5fd7\u65e5\u62a5\u300d\u7684\u4e03\u6761\u9700\u6c42\uff0c\u628a grep \u7684\u7b5b\u3001awk \u7684\u7b97\u3001sort | uniq -c \u7684\u7edf\u8ba1\u4e32\u6210\u4e00\u6761\u7ba1\u9053\uff1a\u8bbf\u95ee\u603b\u91cf\u3001Top IP\u3001Top URL\u3001\u72b6\u6001\u7801\u5206\u5e03\u30015xx \u5b9a\u4f4d\u3001\u5e73\u5747\u54cd\u5e94\u5927\u5c0f\u3001\u6392\u9664\u5185\u7f51\u540e\u7684\u8bbf\u95ee\u91cf\u3002\u7136\u540e\u662f\u4e24\u4e2a\u66f4\u503c\u94b1\u7684\u6280\u80fd\u2014\u2014\u5982\u4f55\u7528\u300c\u5206\u6bb5\u6267\u884c\u300d\u8c03\u8bd5\u4e00\u6761\u7ed3\u679c\u4e0d\u5bf9\u7684\u7ba1\u9053\uff0c\u4ee5\u53ca**\u300c\u7a7a\u7ed3\u679c\u300d\u672c\u8eab\u5c31\u662f\u4e00\u79cd\u7ed3\u8bba**\u3002 \u627f\u63a5\u4e0a\u7bc7\uff1ased \u7ec3\u719f\u4e86\uff0c\u80fd\u8131\u654f IP\u3001\u63d0\u53d6\u65f6\u95f4\u6bb5\u3001\u5220\u9664\u7a7a\u884c\u548c\u6ce8\u91ca\u3002 \u4e00\u3001\u8001\u5468\u7684\u4efb\u52a1\uff1a\u65e5\u62a5<br \/>\n\u5468\u4e00\u65e9\u4e0a<\/p>\n","protected":false},"author":2,"featured_media":124265,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[52,58,330,43,44],"topic":[],"class_list":["post-124267","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-aigc","tag-linux","tag-macos","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Mac \u5f53\u4e3b\u673a\uff0cLinux \u5f53\u670d\u52a1\u5668\uff0826\uff09\u7ec4\u5408\u62f3\u2014\u2014grep + awk + sed \u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/124267.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mac \u5f53\u4e3b\u673a\uff0cLinux \u5f53\u670d\u52a1\u5668\uff0826\uff09\u7ec4\u5408\u62f3\u2014\u2014grep + awk + sed \u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6458\u8981\uff1a\u4e09\u628a\u5200\u90fd\u5b66\u4f1a\u4e86\uff0c\u4f46\u771f\u6b63\u5e72\u6d3b\u65f6\u8981\u628a\u5b83\u4eec\u4e32\u8d77\u6765\u3002\u8fd9\u7bc7\u7528\u4e00\u4efd\u300c\u65e5\u5fd7\u65e5\u62a5\u300d\u7684\u4e03\u6761\u9700\u6c42\uff0c\u628a grep \u7684\u7b5b\u3001awk \u7684\u7b97\u3001sort | uniq -c \u7684\u7edf\u8ba1\u4e32\u6210\u4e00\u6761\u7ba1\u9053\uff1a\u8bbf\u95ee\u603b\u91cf\u3001Top IP\u3001Top URL\u3001\u72b6\u6001\u7801\u5206\u5e03\u30015xx \u5b9a\u4f4d\u3001\u5e73\u5747\u54cd\u5e94\u5927\u5c0f\u3001\u6392\u9664\u5185\u7f51\u540e\u7684\u8bbf\u95ee\u91cf\u3002\u7136\u540e\u662f\u4e24\u4e2a\u66f4\u503c\u94b1\u7684\u6280\u80fd\u2014\u2014\u5982\u4f55\u7528\u300c\u5206\u6bb5\u6267\u884c\u300d\u8c03\u8bd5\u4e00\u6761\u7ed3\u679c\u4e0d\u5bf9\u7684\u7ba1\u9053\uff0c\u4ee5\u53ca**\u300c\u7a7a\u7ed3\u679c\u300d\u672c\u8eab\u5c31\u662f\u4e00\u79cd\u7ed3\u8bba**\u3002 \u627f\u63a5\u4e0a\u7bc7\uff1ased \u7ec3\u719f\u4e86\uff0c\u80fd\u8131\u654f IP\u3001\u63d0\u53d6\u65f6\u95f4\u6bb5\u3001\u5220\u9664\u7a7a\u884c\u548c\u6ce8\u91ca\u3002 \u4e00\u3001\u8001\u5468\u7684\u4efb\u52a1\uff1a\u65e5\u62a5 \u5468\u4e00\u65e9\u4e0a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/124267.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-18T10:49:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261118104853-6afd82950ae93.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/124267.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/124267.html\",\"name\":\"Mac \u5f53\u4e3b\u673a\uff0cLinux \u5f53\u670d\u52a1\u5668\uff0826\uff09\u7ec4\u5408\u62f3\u2014\u2014grep + awk + sed \u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-18T10:49:03+00:00\",\"dateModified\":\"2026-11-18T10:49:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/124267.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/124267.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/124267.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mac \u5f53\u4e3b\u673a\uff0cLinux \u5f53\u670d\u52a1\u5668\uff0826\uff09\u7ec4\u5408\u62f3\u2014\u2014grep + awk + sed \u4e09\u4ef6\u5957\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mac \u5f53\u4e3b\u673a\uff0cLinux \u5f53\u670d\u52a1\u5668\uff0826\uff09\u7ec4\u5408\u62f3\u2014\u2014grep + awk + sed \u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/124267.html","og_locale":"zh_CN","og_type":"article","og_title":"Mac \u5f53\u4e3b\u673a\uff0cLinux \u5f53\u670d\u52a1\u5668\uff0826\uff09\u7ec4\u5408\u62f3\u2014\u2014grep + awk + sed \u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6458\u8981\uff1a\u4e09\u628a\u5200\u90fd\u5b66\u4f1a\u4e86\uff0c\u4f46\u771f\u6b63\u5e72\u6d3b\u65f6\u8981\u628a\u5b83\u4eec\u4e32\u8d77\u6765\u3002\u8fd9\u7bc7\u7528\u4e00\u4efd\u300c\u65e5\u5fd7\u65e5\u62a5\u300d\u7684\u4e03\u6761\u9700\u6c42\uff0c\u628a grep \u7684\u7b5b\u3001awk \u7684\u7b97\u3001sort | uniq -c \u7684\u7edf\u8ba1\u4e32\u6210\u4e00\u6761\u7ba1\u9053\uff1a\u8bbf\u95ee\u603b\u91cf\u3001Top IP\u3001Top URL\u3001\u72b6\u6001\u7801\u5206\u5e03\u30015xx \u5b9a\u4f4d\u3001\u5e73\u5747\u54cd\u5e94\u5927\u5c0f\u3001\u6392\u9664\u5185\u7f51\u540e\u7684\u8bbf\u95ee\u91cf\u3002\u7136\u540e\u662f\u4e24\u4e2a\u66f4\u503c\u94b1\u7684\u6280\u80fd\u2014\u2014\u5982\u4f55\u7528\u300c\u5206\u6bb5\u6267\u884c\u300d\u8c03\u8bd5\u4e00\u6761\u7ed3\u679c\u4e0d\u5bf9\u7684\u7ba1\u9053\uff0c\u4ee5\u53ca**\u300c\u7a7a\u7ed3\u679c\u300d\u672c\u8eab\u5c31\u662f\u4e00\u79cd\u7ed3\u8bba**\u3002 \u627f\u63a5\u4e0a\u7bc7\uff1ased \u7ec3\u719f\u4e86\uff0c\u80fd\u8131\u654f IP\u3001\u63d0\u53d6\u65f6\u95f4\u6bb5\u3001\u5220\u9664\u7a7a\u884c\u548c\u6ce8\u91ca\u3002 \u4e00\u3001\u8001\u5468\u7684\u4efb\u52a1\uff1a\u65e5\u62a5 \u5468\u4e00\u65e9\u4e0a","og_url":"https:\/\/www.wsisp.com\/helps\/124267.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-18T10:49:03+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261118104853-6afd82950ae93.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/124267.html","url":"https:\/\/www.wsisp.com\/helps\/124267.html","name":"Mac \u5f53\u4e3b\u673a\uff0cLinux \u5f53\u670d\u52a1\u5668\uff0826\uff09\u7ec4\u5408\u62f3\u2014\u2014grep + awk + sed \u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-18T10:49:03+00:00","dateModified":"2026-11-18T10:49:03+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/124267.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/124267.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/124267.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Mac \u5f53\u4e3b\u673a\uff0cLinux \u5f53\u670d\u52a1\u5668\uff0826\uff09\u7ec4\u5408\u62f3\u2014\u2014grep + awk + sed \u4e09\u4ef6\u5957"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/124267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=124267"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/124267\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/124265"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=124267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=124267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=124267"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=124267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}