{"id":51042,"date":"2025-08-10T16:39:08","date_gmt":"2025-08-10T08:39:08","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/51042.html"},"modified":"2025-08-10T16:39:08","modified_gmt":"2025-08-10T08:39:08","slug":"linux-%e7%ae%a1%e9%81%93%e5%91%bd%e4%bb%a4%e5%8f%8a%e7%9b%b8%e5%85%b3%e5%91%bd%e4%bb%a4%e7%bb%83%e4%b9%a0%e4%b8%8e-shell-%e7%bc%96%e7%a8%8b%e3%80%81tomcat-%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/51042.html","title":{"rendered":"Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7ec3\u4e60\u4e0e Shell \u7f16\u7a0b\u3001Tomcat \u5b89\u88c5"},"content":{"rendered":"<table border=\"1\" cellspacing=\"0\" style=\"width:427.6000pt\">\n<tbody>\n<tr>\n<td style=\"height:48.6500pt;vertical-align:top;width:427.6000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">2.\u5b9e\u9a8c\u76ee\u7684<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u638c\u63e1 Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4&#xff08;cut\u3001sort\u3001wc\u3001uniq\u3001tee\u3001tr\u3001split&#xff09;\u7684\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5b66\u4f1a\u4f7f\u7528 Shell \u7f16\u7a0b\u5b9e\u73b0\u57fa\u672c\u7684\u8ba1\u7b97\u5668\u529f\u80fd\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u638c\u63e1\u5728 CentOS 7 \u7cfb\u7edf\u4e2d\u5b89\u88c5 Tomcat \u7684\u65b9\u6cd5\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"height:49.3000pt;vertical-align:top;width:427.6000pt\">\n<li style=\"text-align:justify\">\u5b9e\u9a8c\u5185\u5bb9<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1. Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7ec3\u4e60<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.1 \u7ba1\u9053\u547d\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5b9a\u4e49&#xff1a;\u7ba1\u9053\u547d\u4ee4\u5c06\u4e00\u4e2a\u547d\u4ee4\u7684\u8f93\u51fa\u4f5c\u4e3a\u4e0b\u4e00\u4e2a\u547d\u4ee4\u7684\u8f93\u5165&#xff0c;\u683c\u5f0f\u4e3a \u547d\u4ee4A | \u547d\u4ee4B\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u793a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f7f\u7528 ls -al \/etc | less \u6d4f\u89c8 \/etc \u76ee\u5f55\u7684\u8be6\u7ec6\u5185\u5bb9\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f7f\u7528 cat file.txt | grep &#034;keyword&#034; \u67e5\u627e\u6587\u4ef6\u4e2d\u5305\u542b\u7279\u5b9a\u5173\u952e\u8bcd\u7684\u884c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.2 cut \u547d\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u529f\u80fd&#xff1a;\u4ece\u6587\u4ef6\u6216\u8f93\u5165\u4e2d\u63d0\u53d6\u7279\u5b9a\u5b57\u7b26\u6216\u5b57\u6bb5\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u793a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u63d0\u53d6\u6587\u4ef6\u4e2d\u6bcf\u884c\u7684\u7b2c 5 \u4e2a\u5b57\u7b26&#xff1a;head -2 file.txt | cut -c5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u63d0\u53d6\u4ee5 : \u5206\u9694\u7684\u7b2c 1 \u548c\u7b2c 2 \u4e2a\u5b57\u6bb5&#xff1a;head -2 file.txt | cut -d &#039;:&#039; -f1,2<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.3 sort \u547d\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u529f\u80fd&#xff1a;\u5bf9\u6587\u4ef6\u5185\u5bb9\u8fdb\u884c\u6392\u5e8f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u793a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6309\u5b57\u7b26\u4e32\u6392\u5e8f&#xff1a;sort file.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u53bb\u91cd\u6392\u5e8f&#xff1a;sort -u file.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6309\u6570\u503c\u6392\u5e8f&#xff1a;sort -n file.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6309\u5012\u5e8f\u6392\u5e8f&#xff1a;sort -r file.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.4 wc \u547d\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u529f\u80fd&#xff1a;\u7edf\u8ba1\u6587\u4ef6\u7684\u5b57\u8282\u6570\u3001\u5355\u8bcd\u6570\u3001\u884c\u6570\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u793a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7edf\u8ba1\u6587\u4ef6\u7684\u884c\u6570\u3001\u5355\u8bcd\u6570\u548c\u5b57\u8282\u6570&#xff1a;wc file.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4ec5\u7edf\u8ba1\u884c\u6570&#xff1a;wc -l file.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7edf\u8ba1\u591a\u4e2a\u6587\u4ef6&#xff1a;wc file1.txt file2.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.5 uniq \u547d\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u529f\u80fd&#xff1a;\u53bb\u9664\u91cd\u590d\u884c&#xff0c;\u901a\u5e38\u4e0e sort \u547d\u4ee4\u7ed3\u5408\u4f7f\u7528\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u793a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u53bb\u91cd&#xff1a;sort file.txt | uniq<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7edf\u8ba1\u6bcf\u884c\u51fa\u73b0\u7684\u6b21\u6570&#xff1a;sort file.txt | uniq -c<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.6 tee \u547d\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u529f\u80fd&#xff1a;\u5c06\u547d\u4ee4\u8f93\u51fa\u540c\u65f6\u5199\u5165\u6587\u4ef6\u548c\u6807\u51c6\u8f93\u51fa\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u793a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5c06\u8f93\u51fa\u4fdd\u5b58\u5230\u591a\u4e2a\u6587\u4ef6&#xff1a;sort file.txt | uniq | tee output1.txt output2.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.7 tr \u547d\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u529f\u80fd&#xff1a;\u66ff\u6362\u6216\u5220\u9664\u6587\u4ef6\u4e2d\u7684\u5b57\u7b26\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u793a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u66ff\u6362\u5b57\u7b26&#xff1a;echo &#034;hello&#034; | tr &#039;h&#039; &#039;H&#039;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5220\u9664\u5b57\u7b26&#xff1a;echo &#034;hello123&#034; | tr -d &#039;0-9&#039;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">1.8 split \u547d\u4ee4<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u529f\u80fd&#xff1a;\u5c06\u5927\u6587\u4ef6\u5206\u5272\u6210\u591a\u4e2a\u5c0f\u6587\u4ef6\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u793a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6309\u5b57\u8282\u5206\u5272&#xff1a;split -b 10k largefile.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6309\u884c\u6570\u5206\u5272&#xff1a;split -l 1000 largefile.txt<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"height:49.3000pt;vertical-align:top;width:427.6000pt\">\n<li style=\"text-align:justify\">\u5b9e\u9a8c\u8fc7\u7a0b\u63cf\u8ff0<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u521b\u5efa\u4e00\u4e2a\u6d4b\u8bd5\u6587\u4ef6 file.txt&#xff0c;\u5e76\u8f93\u5165\u4e00\u4e9b\u5185\u5bb9\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">echo -e &#034;apple\\\\nbanana\\\\napple\\\\norange\\\\nbanana&#034; &gt; file.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"># \u793a\u4f8b&#xff1a;\u4f7f\u7528 cut \u547d\u4ee4\u63d0\u53d6\u7b2c 1 \u548c\u7b2c 2 \u4e2a\u5b57\u6bb5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">cat file.txt | cut -d &#039;:&#039; -f1,2<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"># \u793a\u4f8b&#xff1a;\u4f7f\u7528 sort \u547d\u4ee4\u6392\u5e8f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">sort file.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"># \u793a\u4f8b&#xff1a;\u4f7f\u7528 uniq \u547d\u4ee4\u53bb\u91cd<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">sort file.txt | uniq<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"># \u793a\u4f8b&#xff1a;\u4f7f\u7528 tee \u547d\u4ee4\u5c06\u8f93\u51fa\u4fdd\u5b58\u5230\u591a\u4e2a\u6587\u4ef6<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">sort file.txt | uniq | tee output1.txt output2.txt<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"478\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083903-68985aa75324e.png\" width=\"833\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">2. Shell \u7f16\u7a0b\u5b9e\u73b0\u8ba1\u7b97\u5668\u529f\u80fd<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">2.1 \u7f16\u5199 Shell \u811a\u672c<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a calculator.sh \u7684\u811a\u672c\u6587\u4ef6\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7f16\u5199\u811a\u672c\u5b9e\u73b0\u4ee5\u4e0b\u529f\u80fd&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u63d0\u4f9b\u7528\u6237\u9009\u62e9\u8fd0\u7b97\u7b26&#xff08;&#043;\u3001-\u3001*\u3001\/\u3001sqrt\u3001square\u3001cube&#xff09;\u7684\u63d0\u793a\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6839\u636e\u7528\u6237\u8f93\u5165\u7684\u8fd0\u7b97\u7b26\u548c\u64cd\u4f5c\u6570&#xff0c;\u8ba1\u7b97\u5e76\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u811a\u672c\u793a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">#!\/bin\/bash<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">echo &#034;\u6b22\u8fce\u4f7f\u7528 Shell \u8ba1\u7b97\u5668&#034;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">echo &#034;\u8bf7\u9009\u62e9\u8fd0\u7b97\u7b26&#xff1a;&#043; &#8211; * \/ sqrt square cube&#034;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">read operator<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">echo &#034;\u8bf7\u8f93\u5165\u7b2c\u4e00\u4e2a\u6570\u5b57&#xff1a;&#034;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">read num1<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">if [[ &#034;$operator&#034; &#061;&#061; &#034;sqrt&#034; || &#034;$operator&#034; &#061;&#061; &#034;square&#034; || &#034;$operator&#034; &#061;&#061; &#034;cube&#034; ]]; then<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0num2&#061;$num1<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">else<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0echo &#034;\u8bf7\u8f93\u5165\u7b2c\u4e8c\u4e2a\u6570\u5b57&#xff1a;&#034;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0read num2<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">fi<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">case $operator in<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0&#043;)<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result&#061;$(echo &#034;$num1 &#043; $num2&#034; | bc)<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0;;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0-)<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result&#061;$(echo &#034;$num1 &#8211; $num2&#034; | bc)<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0;;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0*)<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0echo &#034;\u672a\u77e5\u8fd0\u7b97\u7b26&#034;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0exit 1<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0;;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">esac<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">echo &#034;\u7ed3\u679c\u662f&#xff1a;$result&#034;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"747\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083903-68985aa7cfa95.png\" width=\"833\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u521b\u5efa calculator.sh \u6587\u4ef6&#xff0c;\u5e76\u590d\u5236\u4e0a\u8ff0\u811a\u672c\u5185\u5bb9\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">nano calculator.sh<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5c06\u4e0a\u8ff0\u811a\u672c\u5185\u5bb9\u7c98\u8d34\u5230\u6587\u4ef6\u4e2d&#xff0c;\u4fdd\u5b58\u5e76\u9000\u51fa\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8d4b\u4e88\u811a\u672c\u6267\u884c\u6743\u9650&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">chmod &#043;x calculator.sh<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8fd0\u884c\u811a\u672c&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">.\/calculator.sh<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6839\u636e\u63d0\u793a\u8f93\u5165\u8fd0\u7b97\u7b26\u548c\u6570\u5b57&#xff0c;\u89c2\u5bdf\u7ed3\u679c\u662f\u5426\u6b63\u786e\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"># \u793a\u4f8b\u8f93\u5165<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8bf7\u9009\u62e9\u8fd0\u7b97\u7b26&#xff1a;&#043; &#8211; * \/ sqrt square cube<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">&#043;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8bf7\u8f93\u5165\u7b2c\u4e00\u4e2a\u6570\u5b57&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">10<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u8bf7\u8f93\u5165\u7b2c\u4e8c\u4e2a\u6570\u5b57&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\"># \u793a\u4f8b\u8f93\u51fa<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7ed3\u679c\u662f&#xff1a;15<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"274\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083904-68985aa896f43.png\" width=\"576\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"205\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083904-68985aa8c7b76.png\" width=\"532\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"435\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083904-68985aa8de941.png\" width=\"501\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<li style=\"text-align:justify\">\u5728 CentOS 7 \u7cfb\u7edf\u4e2d\u5b89\u88c5 Tomcat<\/li>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"293\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083905-68985aa90cdd0.png\" width=\"834\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"699\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083905-68985aa950307.png\" width=\"834\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"231\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083906-68985aaa1525f.png\" width=\"817\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"207\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083906-68985aaa6436b.png\" width=\"754\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"409\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083906-68985aaa8e433.png\" width=\"834\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"434\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083906-68985aaac7763.png\" width=\"833\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"801\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083907-68985aab1b525.png\" width=\"833\" \/><\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3.1 \u5b89\u88c5 JDK<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e0b\u8f7d\u5e76\u5b89\u88c5 JDK 15.0.1\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u914d\u7f6e Java \u73af\u5883\u53d8\u91cf\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e0b\u8f7d JDK \u5b89\u88c5\u5305&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">wget https:\/\/download.oracle.com\/java\/technologies\/javase-jdk15-downloads.html#license-lightbox<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u7531\u4e8e Oracle \u5b98\u65b9\u7f51\u7ad9\u7684\u94fe\u63a5\u53ef\u80fd\u9700\u8981\u767b\u5f55\u6216\u63a5\u53d7\u534f\u8bae&#xff0c;\u5efa\u8bae\u624b\u52a8\u4e0b\u8f7d\u540e\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u89e3\u538b\u5b89\u88c5\u5305&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">tar -zxvf jdk-15.0.1_linux-x64_bin.tar.gz<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5c06\u89e3\u538b\u540e\u7684\u6587\u4ef6\u79fb\u52a8\u5230 \/usr\/local\/java \u76ee\u5f55&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">mkdir \/usr\/local\/java<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">mv jdk-15.0.1 \/usr\/local\/java\/<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4fee\u6539\u914d\u7f6e\u6587\u4ef6 \/etc\/profile&#xff0c;\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">export JAVA_HOME&#061;\/usr\/local\/java\/jdk-15.0.1<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">export CLASSPATH&#061;.:$JAVA_HOME\/lib\/dt.jar:$JAVA_HOME\/lib\/tools.jar<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">export PATH&#061;$PATH:$JAVA_HOME\/bin<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4f7f\u914d\u7f6e\u751f\u6548&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">source \/etc\/profile<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u9a8c\u8bc1 JDK \u662f\u5426\u5b89\u88c5\u6210\u529f&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">java -version<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5982\u679c\u8f93\u51fa JDK \u7684\u7248\u672c\u4fe1\u606f&#xff0c;\u5219\u8868\u793a\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">3.2 \u5b89\u88c5 Tomcat<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e0b\u8f7d\u5e76\u5b89\u88c5 Tomcat 9.0.41\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u914d\u7f6e Tomcat\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u4e0b\u8f7d Tomcat \u5b89\u88c5\u5305&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">wget https:\/\/dlcdn.apache.org\/tomcat\/tomcat-9\/v9.0.102\/bin\/apache-tomcat-9.0.102.tar.gz<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u89e3\u538b\u5b89\u88c5\u5305&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">tar -zxf apache-tomcat-9.0.102.tar.gz<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5c06\u89e3\u538b\u540e\u7684\u6587\u4ef6\u79fb\u52a8\u5230 \/usr\/local\/tomcat \u76ee\u5f55&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">mkdir \/usr\/local\/tomcat<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">mv apache-tomcat-9.0.102 \/usr\/local\/tomcat<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u542f\u52a8 Tomcat&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">cd \/usr\/local\/tomcat\/apache-tom<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"height:41.7000pt;vertical-align:top;width:427.6000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">5.\u5b9e\u9a8c\u7ed3\u8bba\u53ca\u5fc3\u5f97<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5b9e\u9a8c\u7ed3\u8bba&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u6210\u529f\u638c\u63e1\u4e86 Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528&#xff0c;\u5305\u62ec cut\u3001sort\u3001wc\u3001uniq\u3001tee\u3001tr \u548c split&#xff0c;\u8fd9\u4e9b\u547d\u4ee4\u5bf9\u4e8e\u5904\u7406\u6587\u672c\u6570\u636e\u975e\u5e38\u6709\u7528\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5b66\u4f1a\u4e86\u4f7f\u7528 Shell \u7f16\u7a0b\u5b9e\u73b0\u57fa\u672c\u7684\u8ba1\u7b97\u5668\u529f\u80fd&#xff0c;\u8fd9\u6709\u52a9\u4e8e\u7406\u89e3 Shell \u811a\u672c\u7684\u57fa\u672c\u8bed\u6cd5\u548c\u903b\u8f91\u7ed3\u6784\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u638c\u63e1\u4e86\u5728 CentOS 7 \u7cfb\u7edf\u4e2d\u5b89\u88c5 Tomcat \u7684\u65b9\u6cd5&#xff0c;\u5305\u62ec\u5b89\u88c5 JDK \u548c\u914d\u7f6e Tomcat \u73af\u5883\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5fc3\u5f97\u4f53\u4f1a&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u901a\u8fc7\u8fd9\u6b21\u5b9e\u9a8c\u6211\u53d1\u73b0 Linux \u547d\u4ee4\u884c\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177&#xff0c;\u53ef\u4ee5\u9ad8\u6548\u5730\u5904\u7406\u6587\u4ef6\u548c\u6570\u636e\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">Shell \u7f16\u7a0b\u63d0\u4f9b\u4e86\u4e00\u79cd\u81ea\u52a8\u5316\u4efb\u52a1\u548c\u7b80\u5316\u590d\u6742\u64cd\u4f5c\u7684\u65b9\u6cd5&#xff0c;\u8fd9\u5bf9\u4e8e\u7cfb\u7edf\u7ba1\u7406\u548c\u65e5\u5e38\u4efb\u52a1\u975e\u5e38\u6709\u7528\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5b89\u88c5\u548c\u914d\u7f6e\u670d\u52a1\u5668\u8f6f\u4ef6&#xff08;\u5982 Tomcat&#xff09;\u9700\u8981\u5bf9\u7cfb\u7edf\u73af\u5883\u6709\u6df1\u5165\u7684\u7406\u89e3&#xff0c;\u540c\u65f6\u4e5f\u9700\u8981\u8010\u5fc3\u548c\u7ec6\u81f4\u7684\u64cd\u4f5c\u3002<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb265\u6b21\u3002\u6210\u529f\u638c\u63e1\u4e86 Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\uff0c\u5305\u62ec cut\u3001sort\u3001wc\u3001uniq\u3001tee\u3001tr \u548c split\uff0c\u8fd9\u4e9b\u547d\u4ee4\u5bf9\u4e8e\u5904\u7406\u6587\u672c\u6570\u636e\u975e\u5e38\u6709\u7528\u3002\u63d0\u53d6\u4ee5 : \u5206\u9694\u7684\u7b2c 1 \u548c\u7b2c 2 \u4e2a\u5b57\u6bb5\uff1ahead -2 file.txt | cut -d \\&#8217;:\\&#8217; -f1,2\u3002\u638c\u63e1 Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\uff08cut\u3001sort\u3001wc\u3001uniq\u3001tee\u3001tr\u3001split\uff09\u7684\u4f7f\u7528\u65b9\u6cd5\u3002\u63d0\u4f9b\u7528\u6237\u9009\u62e9\u8fd0\u7b97\u7b26\uff08+\u3001-\u3001*\u3001\/\u3001sqrt\u3001square\u3001cube\uff09\u7684\u63d0\u793a\u3002<\/p>\n","protected":false},"author":2,"featured_media":51030,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,223,44],"topic":[],"class_list":["post-51042","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-tomcat","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7ec3\u4e60\u4e0e Shell \u7f16\u7a0b\u3001Tomcat \u5b89\u88c5 - \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\/51042.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7ec3\u4e60\u4e0e Shell \u7f16\u7a0b\u3001Tomcat \u5b89\u88c5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb265\u6b21\u3002\u6210\u529f\u638c\u63e1\u4e86 Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\uff0c\u5305\u62ec cut\u3001sort\u3001wc\u3001uniq\u3001tee\u3001tr \u548c split\uff0c\u8fd9\u4e9b\u547d\u4ee4\u5bf9\u4e8e\u5904\u7406\u6587\u672c\u6570\u636e\u975e\u5e38\u6709\u7528\u3002\u63d0\u53d6\u4ee5 : \u5206\u9694\u7684\u7b2c 1 \u548c\u7b2c 2 \u4e2a\u5b57\u6bb5\uff1ahead -2 file.txt | cut -d &#039;:&#039; -f1,2\u3002\u638c\u63e1 Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\uff08cut\u3001sort\u3001wc\u3001uniq\u3001tee\u3001tr\u3001split\uff09\u7684\u4f7f\u7528\u65b9\u6cd5\u3002\u63d0\u4f9b\u7528\u6237\u9009\u62e9\u8fd0\u7b97\u7b26\uff08+\u3001-\u3001*\u3001\/\u3001sqrt\u3001square\u3001cube\uff09\u7684\u63d0\u793a\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/51042.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T08:39:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083903-68985aa75324e.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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51042.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/51042.html\",\"name\":\"Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7ec3\u4e60\u4e0e Shell \u7f16\u7a0b\u3001Tomcat \u5b89\u88c5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-10T08:39:08+00:00\",\"dateModified\":\"2025-08-10T08:39:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/51042.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/51042.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51042.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7ec3\u4e60\u4e0e Shell \u7f16\u7a0b\u3001Tomcat \u5b89\u88c5\"}]},{\"@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":"Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7ec3\u4e60\u4e0e Shell \u7f16\u7a0b\u3001Tomcat \u5b89\u88c5 - \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\/51042.html","og_locale":"zh_CN","og_type":"article","og_title":"Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7ec3\u4e60\u4e0e Shell \u7f16\u7a0b\u3001Tomcat \u5b89\u88c5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb265\u6b21\u3002\u6210\u529f\u638c\u63e1\u4e86 Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\uff0c\u5305\u62ec cut\u3001sort\u3001wc\u3001uniq\u3001tee\u3001tr \u548c split\uff0c\u8fd9\u4e9b\u547d\u4ee4\u5bf9\u4e8e\u5904\u7406\u6587\u672c\u6570\u636e\u975e\u5e38\u6709\u7528\u3002\u63d0\u53d6\u4ee5 : \u5206\u9694\u7684\u7b2c 1 \u548c\u7b2c 2 \u4e2a\u5b57\u6bb5\uff1ahead -2 file.txt | cut -d ':' -f1,2\u3002\u638c\u63e1 Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\uff08cut\u3001sort\u3001wc\u3001uniq\u3001tee\u3001tr\u3001split\uff09\u7684\u4f7f\u7528\u65b9\u6cd5\u3002\u63d0\u4f9b\u7528\u6237\u9009\u62e9\u8fd0\u7b97\u7b26\uff08+\u3001-\u3001*\u3001\/\u3001sqrt\u3001square\u3001cube\uff09\u7684\u63d0\u793a\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/51042.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-10T08:39:08+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810083903-68985aa75324e.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/51042.html","url":"https:\/\/www.wsisp.com\/helps\/51042.html","name":"Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7ec3\u4e60\u4e0e Shell \u7f16\u7a0b\u3001Tomcat \u5b89\u88c5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-10T08:39:08+00:00","dateModified":"2025-08-10T08:39:08+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/51042.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/51042.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/51042.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Linux \u7ba1\u9053\u547d\u4ee4\u53ca\u76f8\u5173\u547d\u4ee4\u7ec3\u4e60\u4e0e Shell \u7f16\u7a0b\u3001Tomcat \u5b89\u88c5"}]},{"@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\/51042","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=51042"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/51042\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/51030"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=51042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=51042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=51042"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=51042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}