<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.simcentric.com/sc/"},{"@type":"ListItem","position":2,"name":"15 个强大的 Linux Shell 文本处理技巧","item":"https://www.simcentric.com/sc/hong-kong-dedicated-server-sc/15-powerful-linux-shell-text-processing-hacks/"}]}</script> {"id":13471,"date":"2024-07-11T16:18:08","date_gmt":"2024-07-11T08:18:08","guid":{"rendered":"https:\/\/www.simcentric.com\/uncategorized-sc\/15-powerful-linux-shell-text-processing-hacks\/"},"modified":"2024-07-11T16:47:41","modified_gmt":"2024-07-11T08:47:41","slug":"15-powerful-linux-shell-text-processing-hacks","status":"publish","type":"post","link":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/","title":{"rendered":"15 \u4e2a\u5f3a\u5927\u7684 Linux Shell \u6587\u672c\u5904\u7406\u6280\u5de7"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<p>\u4f5c\u4e3a<a href=\"https:\/\/www.simcentric.com\/sc\/\" target=\"_blank\" rel=\"noopener\">\u9999\u6e2f\u670d\u52a1\u5668<\/a>\u7684\u7528\u6237\uff0c\u638c\u63e1 Linux shell \u6587\u672c\u5904\u7406\u662f\u4e00\u9879\u8d85\u80fd\u529b\uff0c\u5c06\u4f1a\u6781\u5927\u63d0\u9ad8\u60a8\u7684\u5de5\u4f5c\u6548\u7387\u3002\u547d\u4ee4\u884c\u63d0\u4f9b\u4e86\u4e00\u7ec4\u4e30\u5bcc\u7684\u5de5\u5177\u96c6\uff0c\u53ef\u4ee5\u4ee5\u5916\u79d1\u624b\u672f\u822c\u7684\u7cbe\u51c6\u5207\u5272\u548c\u5904\u7406\u6587\u672c\u6570\u636e\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u63a2\u8ba8 15 \u4e2a\u5fc5\u77e5\u7684 Linux shell \u6587\u672c\u5904\u7406\u6280\u5de7\uff0c\u5e2e\u52a9\u63d0\u9ad8\u60a8\u7684\u751f\u4ea7\u529b\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>1. Grep\uff1a\u6587\u672c\u641c\u7d22\u5f3a\u529b\u5de5\u5177<\/strong><\/h2>\n<p>Grep \u662f\u60a8\u8fdb\u884c\u95ea\u7535\u822c\u5feb\u901f\u6587\u672c\u641c\u7d22\u7684\u9996\u9009\u547d\u4ee4\u3002\u5b83\u7684\u57fa\u672c\u8bed\u6cd5\u662f\uff1a<\/p>\n<pre><code>grep \"pattern\" file.txt\r\n<\/code><\/pre>\n<p>\u4f46 grep \u7684\u771f\u6b63\u529b\u91cf\u5728\u4e8e\u5b83\u7684\u9009\u9879\u3002\u4f8b\u5982\uff0c\u8981\u6267\u884c\u4e0d\u533a\u5206\u5927\u5c0f\u5199\u7684\u641c\u7d22\uff1a<\/p>\n<pre><code>grep -i \"pattern\" file.txt\r\n<\/code><\/pre>\n<p>\u8981\u9012\u5f52\u641c\u7d22\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\uff1a<\/p>\n<pre><code>grep -r \"pattern\" directory\/\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>2. Sed\uff1a\u975e\u51e1\u7684\u6d41\u7f16\u8f91\u5668<\/strong><\/h2>\n<p>Sed \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6d41\u7f16\u8f91\u5668\uff0c\u53ef\u4ee5\u6267\u884c\u590d\u6742\u7684\u6587\u672c\u8f6c\u6362\u3002\u5b83\u7684\u57fa\u672c\u66ff\u6362\u8bed\u6cd5\u662f\uff1a<\/p>\n<pre><code>sed 's\/old\/new\/g' file.txt\r\n<\/code><\/pre>\n<p>\u4f46 sed \u53ef\u4ee5\u505a\u66f4\u591a\uff0c\u6bd4\u5982\u5220\u9664\u5305\u542b\u67d0\u4e2a\u6a21\u5f0f\u7684\u884c\uff1a<\/p>\n<pre><code>sed '\/pattern\/d' file.txt\r\n<\/code><\/pre>\n<p>\u6216\u5728\u5339\u914d\u67d0\u4e2a\u6a21\u5f0f\u7684\u884c\u540e\u63d2\u5165\u6587\u672c\uff1a<\/p>\n<pre><code>sed '\/pattern\/a New line' file.txt\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>3. Awk\uff1a\u6587\u672c\u5904\u7406\u745e\u58eb\u519b\u5200<\/strong><\/h2>\n<p>Awk \u662f\u4e00\u79cd\u5b8c\u6574\u7684\u6587\u672c\u5904\u7406\u8bed\u8a00\uff0c\u6253\u5305\u5728\u4e00\u4e2a\u547d\u4ee4\u4e2d\u3002\u5b83\u64c5\u957f\u5904\u7406\u7ed3\u6784\u5316\u6587\u672c\uff0c\u5982 CSV \u6216 TSV \u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u8981\u6253\u5370 CSV \u7684\u7b2c\u4e00\u5217\u548c\u7b2c\u4e09\u5217\uff1a<\/p>\n<pre><code>awk -F',' '{print $1, $3}' file.csv\r\n<\/code><\/pre>\n<p>Awk \u8fd8\u53ef\u4ee5\u6267\u884c\u8ba1\u7b97\u548c\u6761\u4ef6\u5224\u65ad\uff1a<\/p>\n<pre><code>awk '{sum+=$1} END {print sum}' numbers.txt\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>4. Cut\uff1a\u5217\u5207\u5272\u5668<\/strong><\/h2>\n<p>Cut \u5728\u4ece\u7ed3\u6784\u5316\u6587\u672c\u4e2d\u63d0\u53d6\u7279\u5b9a\u5217\u65f6\u5f88\u65b9\u4fbf\u3002\u8981\u5207\u5272 CSV \u7684\u7b2c\u4e00\u5217\u548c\u7b2c\u56db\u5217\uff1a<\/p>\n<pre><code>cut -d',' -f1,4 file.csv\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>5. Sort\uff1a\u884c\u6392\u5e8f\u673a<\/strong><\/h2>\n<p>\u5f53\u60a8\u9700\u8981\u5bf9\u6587\u672c\u884c\u8fdb\u884c\u6392\u5e8f\u65f6\uff0cSort \u662f\u60a8\u7684\u597d\u670b\u53cb\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5b83\u6309\u5b57\u6bcd\u987a\u5e8f\u6392\u5e8f\uff1a<\/p>\n<pre><code>sort file.txt\r\n<\/code><\/pre>\n<p>\u4f46\u60a8\u4e5f\u53ef\u4ee5\u6309\u6570\u5b57\u6392\u5e8f\uff1a<\/p>\n<pre><code>sort -n file.txt\r\n<\/code><\/pre>\n<p>\u6216\u6309\u7279\u5b9a\u5217\u6392\u5e8f\uff1a<\/p>\n<pre><code>sort -k2 -t',' file.csv\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>6. Uniq\uff1a\u91cd\u590d\u9879\u9500\u6bc1\u8005<\/strong><\/h2>\n<p>Uniq \u5bf9\u4e8e\u4ece\u5df2\u6392\u5e8f\u7684\u6587\u4ef6\u4e2d\u5220\u9664\u91cd\u590d\u884c\u81f3\u5173\u91cd\u8981\uff1a<\/p>\n<pre><code>sort file.txt | uniq\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>7. Tr\uff1a\u5b57\u7b26\u8f6c\u6362\u5668<\/strong><\/h2>\n<p>Tr \u975e\u5e38\u9002\u5408\u8f6c\u6362\u6216\u5220\u9664\u5b57\u7b26\u3002\u8981\u5c06\u5c0f\u5199\u8f6c\u6362\u4e3a\u5927\u5199\uff1a<\/p>\n<pre><code>tr 'a-z' 'A-Z' &lt; file.txt\r\n<\/code><\/pre>\n<p>\u6216\u5220\u9664\u6240\u6709\u6570\u5b57\uff1a<\/p>\n<pre><code>tr -d '0-9' &lt; file.txt\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>8. Paste\uff1a\u6587\u4ef6\u5408\u5e76\u5668<\/strong><\/h2>\n<p>Paste \u53ef\u4ee5\u8ba9\u60a8\u5e76\u6392\u7ec4\u5408\u591a\u4e2a\u6587\u4ef6\uff1a<\/p>\n<pre><code>paste file1.txt file2.txt\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>9. Wc\uff1a\u5b57\u6570\u7edf\u8ba1\u5668<\/strong><\/h2>\n<p>Wc \u7edf\u8ba1\u6587\u4ef6\u4e2d\u7684\u884c\u6570\u3001\u5355\u8bcd\u6570\u548c\u5b57\u7b26\u6570\u3002\u8981\u7edf\u8ba1\u884c\u6570\uff1a<\/p>\n<pre><code>wc -l file.txt\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>10. Tee\uff1a\u8f93\u51fa\u5206\u5272\u5668<\/strong><\/h2>\n<p>Tee \u5206\u5272\u547d\u4ee4\u8f93\u51fa\uff0c\u540c\u65f6\u5c06\u5176\u53d1\u9001\u5230\u6587\u4ef6\u548c\u6807\u51c6\u8f93\u51fa\uff1a<\/p>\n<pre><code>command | tee output.txt\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>11. Find\uff1a\u6587\u4ef6\u67e5\u627e\u5668<\/strong><\/h2>\n<p>Find \u662f\u60a8\u6839\u636e\u5404\u79cd\u6761\u4ef6\u5b9a\u4f4d\u6587\u4ef6\u7684\u76df\u53cb\u3002\u8981\u6309\u540d\u79f0\u67e5\u627e\u6587\u4ef6\uff1a<\/p>\n<pre><code>find \/path\/to\/directory -name \"*.txt\"\r\n<\/code><\/pre>\n<p>\u6216\u67e5\u627e\u6700\u8fd1 7 \u5929\u5185\u4fee\u6539\u8fc7\u7684\u6587\u4ef6\uff1a<\/p>\n<pre><code>find \/path\/to\/directory -mtime -7\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>12. Xargs\uff1a\u547d\u4ee4\u6267\u884c\u5668<\/strong><\/h2>\n<p>Xargs \u5141\u8bb8\u60a8\u4ece\u6807\u51c6\u8f93\u5165\u6784\u5efa\u548c\u6267\u884c\u547d\u4ee4\u3002\u4e00\u4e2a\u5e38\u89c1\u7684\u7528\u4f8b\u662f\u5c06\u5176\u4e0e find \u914d\u5bf9\uff1a<\/p>\n<pre><code>find \/path\/to\/directory -name \"*.txt\" | xargs grep \"pattern\"\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>13. Head\uff1a\u6587\u4ef6\u5934\u90e8\u67e5\u770b\u5668<\/strong><\/h2>\n<p>Head \u663e\u793a\u6587\u4ef6\u7684\u7b2c\u4e00\u90e8\u5206\u3002\u8981\u67e5\u770b\u524d 10 \u884c\uff1a<\/p>\n<pre><code>head file.txt\r\n<\/code><\/pre>\n<p>\u6216\u6307\u5b9a\u884c\u6570\uff1a<\/p>\n<pre><code>head -n 5 file.txt\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>14. Tail\uff1a\u6587\u4ef6\u5c3e\u90e8\u67e5\u770b\u5668<\/strong><\/h2>\n<p>Tail \u663e\u793a\u6587\u4ef6\u7684\u6700\u540e\u4e00\u90e8\u5206\u3002\u8981\u67e5\u770b\u6700\u540e 10 \u884c\uff1a<\/p>\n<pre><code>tail file.txt\r\n<\/code><\/pre>\n<p>\u6216\u6301\u7eed\u76d1\u89c6\u6587\u4ef6\u53d8\u5316\uff1a<\/p>\n<pre><code>tail -f log.txt\r\n<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>15. Diff\uff1a\u6587\u4ef6\u6bd4\u8f83\u5668<\/strong><\/h2>\n<p>Diff \u9010\u884c\u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\uff1a<\/p>\n<pre><code>diff file1.txt file2.txt\r\n<\/code><\/pre>\n<p>\u638c\u63e1\u4e86\u8fd9 15 \u4e2a Linux shell \u6587\u672c\u5904\u7406\u5229\u5668\uff0c\u60a8\u5c06\u51c6\u5907\u597d\u5e94\u5bf9\u4efb\u4f55\u6587\u672c\u64cd\u4f5c\u6311\u6218\u3002[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] \u4f5c\u4e3a\u9999\u6e2f\u670d\u52a1\u5668\u7684\u7528\u6237\uff0c\u638c\u63e1 Linux shell \u6587\u672c\u5904\u7406\u662f\u4e00\u9879\u8d85\u80fd\u529b\uff0c\u5c06\u4f1a\u6781\u5927\u63d0\u9ad8\u60a8\u7684\u5de5\u4f5c\u6548\u7387\u3002\u547d\u4ee4\u884c\u63d0\u4f9b\u4e86\u4e00\u7ec4\u4e30\u5bcc\u7684\u5de5\u5177\u96c6\uff0c\u53ef\u4ee5\u4ee5\u5916\u79d1\u624b\u672f\u822c\u7684\u7cbe\u51c6\u5207\u5272\u548c\u5904\u7406\u6587\u672c\u6570\u636e\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u63a2\u8ba8 15 \u4e2a\u5fc5\u77e5\u7684 Linux shell \u6587\u672c\u5904\u7406\u6280\u5de7\uff0c\u5e2e\u52a9\u63d0\u9ad8\u60a8\u7684\u751f\u4ea7\u529b\u3002 [\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] 1. Grep\uff1a\u6587\u672c\u641c\u7d22\u5f3a\u529b\u5de5\u5177 Grep \u662f\u60a8\u8fdb\u884c\u95ea\u7535\u822c\u5feb\u901f\u6587\u672c\u641c\u7d22\u7684\u9996\u9009\u547d\u4ee4\u3002\u5b83\u7684\u57fa\u672c\u8bed\u6cd5\u662f\uff1a grep &#8220;pattern&#8221; file.txt \u4f46 grep \u7684\u771f\u6b63\u529b\u91cf\u5728\u4e8e\u5b83\u7684\u9009\u9879\u3002\u4f8b\u5982\uff0c\u8981\u6267\u884c\u4e0d\u533a\u5206\u5927\u5c0f\u5199\u7684\u641c\u7d22\uff1a grep -i &#8220;pattern&#8221; file.txt \u8981\u9012\u5f52\u641c\u7d22\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\uff1a grep -r &#8220;pattern&#8221; directory\/ [\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] 2. Sed\uff1a\u975e\u51e1\u7684\u6d41\u7f16\u8f91\u5668 Sed \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6d41\u7f16\u8f91\u5668\uff0c\u53ef\u4ee5\u6267\u884c\u590d\u6742\u7684\u6587\u672c\u8f6c\u6362\u3002\u5b83\u7684\u57fa\u672c\u66ff\u6362\u8bed\u6cd5\u662f\uff1a sed &#8216;s\/old\/new\/g&#8217; file.txt \u4f46 sed \u53ef\u4ee5\u505a\u66f4\u591a\uff0c\u6bd4\u5982\u5220\u9664\u5305\u542b\u67d0\u4e2a\u6a21\u5f0f\u7684\u884c\uff1a sed &#8216;\/pattern\/d&#8217; file.txt \u6216\u5728\u5339\u914d\u67d0\u4e2a\u6a21\u5f0f\u7684\u884c\u540e\u63d2\u5165\u6587\u672c\uff1a sed &#8216;\/pattern\/a New line&#8217; file.txt [\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":13441,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[62],"tags":[2343,2344,2345],"class_list":["post-13471","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hong-kong-dedicated-server-sc","tag-linux-shell-sc","tag-text-processing-sc","tag-command-line-sc"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>15 \u4e2a\u5f3a\u5927\u7684 Linux Shell \u6587\u672c\u5904\u7406\u6280\u5de7<\/title>\n<meta name=\"description\" content=\"\u638c\u63e1 15 \u4e2a\u5173\u952e\u7684 Linux shell \u6587\u672c\u5904\u7406\u547d\u4ee4\uff1agrep\u3001sed\u3001awk\u3001find\u3001xargs\u3001sort\u3001uniq\u3001tr\u3001cut\u3001paste\u3001wc\u3001head\u3001tail\u3001diff \u548c tee\u3002\" \/>\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.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/13471\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"company\" \/>\n<meta property=\"og:title\" content=\"15 \u4e2a\u5f3a\u5927\u7684 Linux Shell \u6587\u672c\u5904\u7406\u6280\u5de7\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/13471\" \/>\n<meta property=\"og:site_name\" content=\"\u65b0\u5929\u57df\u4e92\u8054\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-11T08:18:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-11T08:47:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/07\/Picture3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"624\" \/>\n\t<meta property=\"og:image:height\" content=\"351\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"15 \u4e2a\u5f3a\u5927\u7684 Linux Shell \u6587\u672c\u5904\u7406\u6280\u5de7","description":"\u638c\u63e1 15 \u4e2a\u5173\u952e\u7684 Linux shell \u6587\u672c\u5904\u7406\u547d\u4ee4\uff1agrep\u3001sed\u3001awk\u3001find\u3001xargs\u3001sort\u3001uniq\u3001tr\u3001cut\u3001paste\u3001wc\u3001head\u3001tail\u3001diff \u548c tee\u3002","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.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/13471","og_locale":"zh_CN","og_type":"company","og_title":"15 \u4e2a\u5f3a\u5927\u7684 Linux Shell \u6587\u672c\u5904\u7406\u6280\u5de7","og_url":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/13471","og_site_name":"\u65b0\u5929\u57df\u4e92\u8054","article_published_time":"2024-07-11T08:18:08+00:00","article_modified_time":"2024-07-11T08:47:41+00:00","og_image":[{"width":624,"height":351,"url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/07\/Picture3.jpg","type":"image\/jpeg"}],"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/#article","isPartOf":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/"},"author":{"name":"Debbie Ng","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/person\/0bfc8768eb7caacbfab4a0855d805626"},"headline":"15 \u4e2a\u5f3a\u5927\u7684 Linux Shell \u6587\u672c\u5904\u7406\u6280\u5de7","datePublished":"2024-07-11T08:18:08+00:00","dateModified":"2024-07-11T08:47:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/"},"wordCount":318,"publisher":{"@id":"https:\/\/simcentric.com\/tc\/#organization"},"image":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/#primaryimage"},"thumbnailUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/07\/Picture3.jpg","keywords":["Linux shell","\u6587\u672c\u5904\u7406","\u547d\u4ee4\u884c"],"articleSection":["\u9999\u6e2f\u670d\u52a1\u5668"],"inLanguage":"zh-CHN"},{"@type":"WebPage","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/","url":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/","name":"15 \u4e2a\u5f3a\u5927\u7684 Linux Shell \u6587\u672c\u5904\u7406\u6280\u5de7","isPartOf":{"@id":"https:\/\/simcentric.com\/tc\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/#primaryimage"},"image":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/#primaryimage"},"thumbnailUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/07\/Picture3.jpg","datePublished":"2024-07-11T08:18:08+00:00","dateModified":"2024-07-11T08:47:41+00:00","description":"\u638c\u63e1 15 \u4e2a\u5173\u952e\u7684 Linux shell \u6587\u672c\u5904\u7406\u547d\u4ee4\uff1agrep\u3001sed\u3001awk\u3001find\u3001xargs\u3001sort\u3001uniq\u3001tr\u3001cut\u3001paste\u3001wc\u3001head\u3001tail\u3001diff \u548c tee\u3002","breadcrumb":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/#breadcrumb"},"inLanguage":"zh-CHN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/"]}]},{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/#primaryimage","url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/07\/Picture3.jpg","contentUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/07\/Picture3.jpg","width":624,"height":351,"caption":"Linux \u7ec8\u7aef\u663e\u793a grep\u3001sed\u3001awk\u3001find \u548c xargs \u547d\u4ee4\u7684\u8f93\u51fa"},{"@type":"BreadcrumbList","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/15-powerful-linux-shell-text-processing-hacks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.simcentric.com\/sc\/"},{"@type":"ListItem","position":2,"name":"15 \u4e2a\u5f3a\u5927\u7684 Linux Shell \u6587\u672c\u5904\u7406\u6280\u5de7"}]},{"@type":"WebSite","@id":"https:\/\/simcentric.com\/tc\/#website","url":"https:\/\/simcentric.com\/tc\/","name":"Simcentric Solutions","description":"","publisher":{"@id":"https:\/\/simcentric.com\/tc\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simcentric.com\/tc\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-CHN"},{"@type":"Organization","@id":"https:\/\/simcentric.com\/tc\/#organization","name":"Simcentric Solutions","url":"https:\/\/simcentric.com\/tc\/","logo":{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/logo\/image\/","url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2023\/06\/sim-logo-2023.png","contentUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2023\/06\/sim-logo-2023.png","width":800,"height":222,"caption":"Simcentric Solutions"},"image":{"@id":"https:\/\/simcentric.com\/tc\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/person\/0bfc8768eb7caacbfab4a0855d805626","name":"Debbie Ng","image":{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/secure.gravatar.com\/avatar\/9f3420f60d27329ed6e921ddaae5206353d0a7414d1abb6f1f0b32b4fd849965?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9f3420f60d27329ed6e921ddaae5206353d0a7414d1abb6f1f0b32b4fd849965?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9f3420f60d27329ed6e921ddaae5206353d0a7414d1abb6f1f0b32b4fd849965?s=96&d=mm&r=g","caption":"Debbie Ng"}}]}},"_links":{"self":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/13471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/comments?post=13471"}],"version-history":[{"count":2,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/13471\/revisions"}],"predecessor-version":[{"id":13474,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/13471\/revisions\/13474"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/media\/13441"}],"wp:attachment":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/media?parent=13471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/categories?post=13471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/tags?post=13471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}