{"id":117645,"date":"2026-10-25T04:33:14","date_gmt":"2026-10-24T20:33:14","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/117645.html"},"modified":"2026-10-25T04:33:14","modified_gmt":"2026-10-24T20:33:14","slug":"%e5%8f%aa%e5%ad%a6%e5%a4%9f%e7%94%a8%e7%9a%84linux%ef%bc%81%e9%9b%b6%e5%9f%ba%e7%a1%80%e6%a0%b8%e5%bf%83%e7%9f%a5%e8%af%86%e7%82%b9%ef%bc%88%e4%b8%8b%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/117645.html","title":{"rendered":"\u53ea\u5b66\u591f\u7528\u7684Linux\uff01\u96f6\u57fa\u7840\u6838\u5fc3\u77e5\u8bc6\u70b9\uff08\u4e0b\uff09"},"content":{"rendered":"<p>\u76ee\u5f55<\/p>\n<p style=\"margin-left:40px\">\u5f15\u8a00&#xff1a;<\/p>\n<p style=\"margin-left:40px\">2.1 \u7f51\u7edc\u4e0b\u8f7d wget \/curl\/aria2c<\/p>\n<p style=\"margin-left:80px\">wget&#xff08;\u6700\u7b80\u5355&#xff0c;\u9002\u5408\u666e\u901a\u4e0b\u8f7d&#xff09;<\/p>\n<p style=\"margin-left:80px\">curl&#xff08;\u901a\u7528 http \u5de5\u5177&#xff0c;\u4e0d\u4ec5\u80fd\u4e0b\u8f7d&#xff0c;\u8fd8\u80fd\u53d1\u7f51\u7edc\u8bf7\u6c42&#xff09;<\/p>\n<p style=\"margin-left:80px\">aria2c&#xff08;\u591a\u7ebf\u7a0b\u4e0b\u8f7d\u795e\u5668&#xff0c;\u5927\u6587\u4ef6\u5f3a\u70c8\u63a8\u8350&#xff09;<\/p>\n<p style=\"margin-left:40px\">2.2 \u6253\u5305\u548c\u538b\u7f29 tar \/zip\/unzip \/7z<\/p>\n<p style=\"margin-left:80px\">tar \u547d\u4ee4<\/p>\n<p style=\"margin-left:80px\">zip \/unzip&#xff08;\u548c Windows \u4e92\u901a&#xff09;<\/p>\n<p style=\"margin-left:80px\">7z&#xff08;\u9ad8\u538b\u7f29\u7387&#xff09;<\/p>\n<p style=\"margin-left:40px\">2.3 \u6587\u6863\u5904\u7406\u8865\u5145 wc \/grep\/sed<\/p>\n<p style=\"margin-left:80px\">wc \u6587\u672c\u7edf\u8ba1<\/p>\n<p style=\"margin-left:80px\">grep \u6587\u672c\u641c\u7d22&#xff0c;\u67e5\u627e\u65e5\u5fd7\u5173\u952e\u5b57<\/p>\n<p style=\"margin-left:80px\">sed \u6587\u672c\u66ff\u6362&#xff0c;\u6279\u91cf\u5b57\u7b26\u4e32\u66ff\u6362<\/p>\n<p style=\"margin-left:40px\">2.4 \u7b26\u53f7\u94fe\u63a5\u548c\u786c\u94fe\u63a5 ln<\/p>\n<p style=\"margin-left:80px\">\u7b26\u53f7\u94fe\u63a5&#xff08;\u8f6f\u94fe\u63a5&#xff0c;Windows \u5feb\u6377\u65b9\u5f0f&#xff09;<\/p>\n<p style=\"margin-left:80px\">\u786c\u94fe\u63a5 ln&#xff08;\u4e0d\u5e26 &#8211; s&#xff09;<\/p>\n<p style=\"margin-left:40px\">2.5 \u540e\u53f0\u4efb\u52a1\u548c\u7ec8\u7aef\u590d\u7528\u5668 bg\/fg\/jobs\/nohup\/screen\/tmux<\/p>\n<p style=\"margin-left:80px\">\u4f20\u7edf\u540e\u53f0\u4efb\u52a1\u7ba1\u7406<\/p>\n<p style=\"margin-left:80px\">\u4e0d\u88ab\u6302\u65ad\u7684\u4efb\u52a1<\/p>\n<p style=\"margin-left:80px\">\u7ec8\u7aef\u590d\u7528\u5668 &#xff08;tmux\u00a0 \u00a0screen&#xff09;<\/p>\n<p style=\"margin-left:40px\">2.6 \u7cfb\u7edf\u8d44\u6e90\u67e5\u8be2<\/p>\n<p style=\"margin-left:80px\">\u4efb\u52a1\u7ba1\u7406\u5668 top \/htop<\/p>\n<p style=\"margin-left:80px\">\u8fdb\u7a0b\u4e2d\u6b62 kill \/pkill\u00a0<\/p>\n<p style=\"margin-left:80px\">\u78c1\u76d8\u76f8\u5173<\/p>\n<p style=\"margin-left:80px\">\u7f51\u7edc\u72b6\u6001\u67e5\u770b<\/p>\n<p style=\"margin-left:40px\">2.7 \u78c1\u76d8\u6302\u8f7d mount \/umount<\/p>\n<p style=\"margin-left:80px\">\u4ec0\u4e48\u662f\u6302\u8f7d&#xff1f;<\/p>\n<p style=\"margin-left:40px\">2.8 \u73af\u5883\u53d8\u91cf<\/p>\n<p style=\"margin-left:80px\">export \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/p>\n<p style=\"margin-left:80px\">PATH&#xff08;\u6700\u91cd\u8981\u73af\u5883\u53d8\u91cf&#xff09;<\/p>\n<p style=\"margin-left:80px\">LD_LIBRARY_PATH \u52a8\u6001\u5e93\u8def\u5f84<\/p>\n<p style=\"margin-left:40px\">2.9 Bash \u914d\u7f6e\u6587\u4ef6&#xff5e;\/.bashrc source<\/p>\n<p style=\"margin-left:40px\">2.10 \u62fe\u9057\u8865\u7f3a<\/p>\n<p style=\"margin-left:80px\">watch&#xff1a;\u5b9a\u65f6\u91cd\u590d\u6267\u884c\u547d\u4ee4<\/p>\n<p style=\"margin-left:80px\">tee&#xff1a;\u540c\u65f6\u8f93\u51fa\u5230\u7ec8\u7aef\u00a0&#043; \u4fdd\u5b58\u6587\u4ef6<\/p>\n<p style=\"margin-left:80px\">diff&#xff1a;\u6bd4\u8f83\u6587\u4ef6\u5dee\u5f02<\/p>\n<p style=\"margin-left:80px\">uname \u67e5\u770b\u7cfb\u7edf\u5185\u6838\u4fe1\u606f<\/p>\n<p style=\"margin-left:80px\">\u7ec8\u7aef\u5bb9\u6613\u8bef\u89e6\u5feb\u6377\u952e\u6c47\u603b<\/p>\n<p style=\"margin-left:40px\">\u7ed3\u8bed&#xff1a;<\/p>\n<hr \/>\n<p>\u00a0<\/p>\n<h3>\u5f15\u8a00&#xff1a;<\/h3>\n<p>\u4e0a\u7bc7\u6587\u7ae0\u8bb2\u4e86\u5173\u4e8e\u5b66\u4e60Linux\u65f6\u5fc5\u987b\u4e86\u89e3\u7684\u6838\u5fc3\u57fa\u7840\u77e5\u8bc6&#xff0c;\u611f\u5174\u8da3\u7684\u53ef\u4ee5\u9605\u8bfb&#xff1a;\u53ea\u5b66\u591f\u7528\u7684Linux&#xff01;\u96f6\u57fa\u7840\u6838\u5fc3\u77e5\u8bc6\u70b9&#xff08;\u4e0a&#xff09;-CSDN\u535a\u5ba2&#xff0c;<\/p>\n<p>\u8fd9\u4e00\u7ae0\u5c06\u7ee7\u7eed\u4ecb\u7ecd\u4e00\u4e9b\u5b9e\u9645\u4f7f\u7528\u4e2d\u975e\u5e38\u5e38\u89c1\u7684\u529f\u80fd&#xff0c;\u4e0d\u8fc7\u5b83\u4eec\u662f\u5426\u9700\u8981\u5b66\u4e60\u56e0\u4eba\u800c\u5f02\u3002\u5982\u679c\u4f60\u8ba4\u4e3a\u5b8c\u5168\u7528\u4e0d\u5230\u67d0\u4e2a\u5c0f\u8282\u7684\u5185\u5bb9&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u8df3\u8fc7\u3002<\/p>\n<p>\u53e6\u5916&#xff0c;\u9605\u8bfb\u7b2c 1 \u7ae0\u540e\u8bfb\u8005\u5e94\u8be5\u5df2\u7ecf\u5bf9 Linux \u521d\u6b65\u719f\u6089\u4e86&#xff0c;\u56e0\u6b64\u4ece\u7b2c 2 \u7ae0\u5f00\u59cb&#xff0c;\u672c\u6559\u7a0b\u7684\u5199\u4f5c\u98ce\u683c\u5c06\u4f1a\u53d8\u5f97\u7cbe\u7b80\u3002<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203301-6add15fd6b2c1.jpg\" \/><\/p>\n<hr \/>\n<h3>2.1 \u7f51\u7edc\u4e0b\u8f7d wget \/curl\/aria2c<\/h3>\n<p>\u8fd9\u4e00\u8282\u5c06\u4ecb\u7ecd\u4e09\u4e2a\u5de5\u5177wget\u3001curl \u548c aria2c&#xff0c; \u670d\u52a1\u5668\u73af\u5883\u6ca1\u6709\u6d4f\u89c8\u5668&#xff0c;\u4e0b\u8f7d\u6587\u4ef6\u5168\u90e8\u4f9d\u9760\u547d\u4ee4\u884c\u5de5\u5177&#xff0c;\u5176\u4e2dwget \u6700\u6613\u7528&#xff0c;aria2c \u6700\u5f3a\u5927&#xff0c;\u4e09\u4e2a\u5de5\u5177\u719f\u6089\u5176\u4e2d\u4e00\u4e2a\u5c31\u591f\u7528\u3002<\/p>\n<h4>wget&#xff08;\u6700\u7b80\u5355&#xff0c;\u9002\u5408\u666e\u901a\u4e0b\u8f7d&#xff09;<\/h4>\n<p># \u5b89\u88c5<br \/>\nsudo apt install wget -y<\/p>\n<p># \u57fa\u7840\u4e0b\u8f7d&#xff0c;\u4fdd\u5b58\u4e3a\u539f\u6587\u4ef6\u540d<br \/>\nwget https:\/\/example.com\/file.zip<\/p>\n<p># -O \u6307\u5b9a\u4fdd\u5b58\u6587\u4ef6\u540d<br \/>\nwget -O myfile.zip https:\/\/example.com\/file.zip<\/p>\n<p># -P \u6307\u5b9a\u4e0b\u8f7d\u4fdd\u5b58\u5230\u67d0\u4e2a\u76ee\u5f55<br \/>\nwget -P \/data\/downloads https:\/\/example.com\/file.zip<\/p>\n<p># -c \u65ad\u70b9\u7eed\u4f20&#xff0c;\u5927\u6587\u4ef6\u7f51\u7edc\u4e2d\u65ad\u540e\u63a5\u7740\u4e0b<br \/>\nwget -c https:\/\/example.com\/file.zip<\/p>\n<h4>curl&#xff08;\u901a\u7528 http \u5de5\u5177&#xff0c;\u4e0d\u4ec5\u80fd\u4e0b\u8f7d&#xff0c;\u8fd8\u80fd\u53d1\u7f51\u7edc\u8bf7\u6c42&#xff09;<\/h4>\n<p>#\u5b89\u88c5<br \/>\nsudo apt install curl -y<\/p>\n<p># -O\u5927\u5199&#xff0c;\u4f7f\u7528\u8fdc\u7a0b\u539f\u6587\u4ef6\u540d\u4fdd\u5b58<br \/>\ncurl -O https:\/\/example.com\/file.zip<\/p>\n<p># -o\u5c0f\u5199&#xff0c;\u81ea\u5b9a\u4e49\u4fdd\u5b58\u6587\u4ef6\u540d<br \/>\ncurl -o myfile.zip https:\/\/example.com\/file.zip<\/p>\n<p># -L \u8ddf\u968f\u7f51\u9875\u91cd\u5b9a\u5411&#xff0c;\u7edd\u5927\u591a\u6570\u4e0b\u8f7d\u94fe\u63a5\u5fc5\u987b\u52a0\u8fd9\u4e2a\u53c2\u6570<br \/>\ncurl -L -O https:\/\/example.com\/file.zip<\/p>\n<p># \u65ad\u70b9\u7eed\u4f20<br \/>\ncurl -L -C &#8211; -O https:\/\/example.com\/file.zip<\/p>\n<h4>aria2c&#xff08;\u591a\u7ebf\u7a0b\u4e0b\u8f7d\u795e\u5668&#xff0c;\u5927\u6587\u4ef6\u5f3a\u70c8\u63a8\u8350&#xff09;<\/h4>\n<p>\u7c7b\u4f3c Windows IDM \u4e0b\u8f7d\u5668&#xff0c;\u652f\u6301\u591a\u7ebf\u7a0b\u5e76\u53d1\u4e0b\u8f7d&#xff0c;\u9ed8\u8ba4\u81ea\u5e26\u65ad\u70b9\u7eed\u4f20<\/p>\n<p>#\u5b89\u88c5<br \/>\nsudo apt install aria2 -y<\/p>\n<p>#\u57fa\u7840\u4e0b\u8f7d<br \/>\naria2c https:\/\/example.com\/file.zip<\/p>\n<p># -x -s \u8bbe\u7f6e\u5e76\u53d1\u7ebf\u7a0b&#xff0c;16\u7ebf\u7a0b\u52a0\u901f\u4e0b\u8f7d<br \/>\naria2c -x 16 -s 16 https:\/\/example.com\/file.zip<\/p>\n<p># -o \u6307\u5b9a\u6587\u4ef6\u540d<br \/>\naria2c -o myfile.zip https:\/\/example.com\/file.zip<\/p>\n<p># -d \u6307\u5b9a\u4fdd\u5b58\u76ee\u5f55<br \/>\naria2c -d \/data\/downloads https:\/\/example.com\/file.zip<\/p>\n<p>\u5c0f\u63d0\u793a&#xff1a;AI \u5927\u6a21\u578b\u6743\u91cd\u6587\u4ef6\u4f53\u79ef\u5de8\u5927&#xff0c;\u4f18\u5148\u4f7f\u7528aria2c\u3002<\/p>\n<hr \/>\n<h3>2.2 \u6253\u5305\u548c\u538b\u7f29 tar \/zip\/unzip \/7z<\/h3>\n<p>\u672c\u8282\u5c06\u4ecb\u7ecd\u4ee5\u4e0b\u5de5\u5177&#xff1a;tar, zip, unzip, 7z\u3002<\/p>\n<p>tar&#xff1a;Linux \u539f\u751f\u6253\u5305\u5de5\u5177&#xff0c;\u53ef\u4ee5\u4fdd\u7559\u6743\u9650\u3001\u6240\u6709\u8005\u5143\u4fe1\u606f&#xff1b;zip&#xff1a;\u8de8 Windows \u6700\u901a\u7528&#xff1b;7z&#xff1a;\u538b\u7f29\u7387\u6700\u9ad8\u3002<\/p>\n<p>tar \u662f\u4e00\u4e2a\u6253\u5305\u5de5\u5177&#xff0c;\u4f46\u5b83\u53ef\u4ee5\u5e2e\u5fd9\u8c03\u7528 gzip, zstd \u7b49\u538b\u7f29\u5de5\u5177\u5b9e\u73b0\u6253\u5305&#043;\u538b\u7f29\u3002\u540c\u65f6 tar \u53ef\u4ee5\u5c06 Linux \u6587\u4ef6\u7cfb\u7edf\u91cc\u7684\u5bf9\u8c61\u5143\u6570\u636e\u50a8\u5b58&#xff08;\u4f8b\u5982\u6240\u6709\u8005\u3001\u6240\u5c5e\u7528\u6237\u7ec4\u3001\u5bf9\u8c61\u6743\u9650\u7b49&#xff09;&#xff0c;\u56e0\u6b64\u5728 Linux \u91cc tar \u662f\u6700\u5730\u9053\u7684\u6253\u5305\u65b9\u5f0f\u3002<\/p>\n<h4>tar \u547d\u4ee4<\/h4>\n<p>\u8fd9\u51e0\u4e2a\u53c2\u6570\u51e0\u4e4e\u6c38\u8fdc\u90fd\u4e00\u8d77\u4f7f\u7528&#xff0c;\u56e0\u6b64\u53ef\u4ee5\u76f4\u63a5\u80cc\u4e0b\u6765&#xff0c;\u5b83\u4eec\u7684\u542b\u4e49\u5206\u522b\u662f&#xff1a;<\/p>\n<ul>\n<li>c&#xff1a;\u521b\u5efa\u5f52\u6863<\/li>\n<li>x&#xff1a;\u89e3\u5305\u5f52\u6863<\/li>\n<li>v&#xff1a;\u663e\u793a\u6b63\u5728\u5904\u7406\u7684\u6587\u4ef6<\/li>\n<li>z&#xff1a;\u4f7f\u7528 gzip \u538b\u7f29\/\u89e3\u538b<\/li>\n<li>f&#xff1a;\u540e\u9762\u7d27\u8ddf\u5f52\u6863\u6587\u4ef6\u540d<\/li>\n<\/ul>\n<p># \u4ec5\u6253\u5305&#xff08;\u4e0d\u538b\u7f29&#xff09;<br \/>\ntar -cvf archive.tar dir\/<\/p>\n<p># \u89e3\u5305<br \/>\ntar -xvf archive.tar<\/p>\n<p># \u6253\u5305&#043;gzip\u538b\u7f29 .tar.gz<br \/>\ntar -cvzf archive.tar.gz dir\/<\/p>\n<p># \u89e3\u538btar.gz<br \/>\ntar -xvzf archive.tar.gz<\/p>\n<p>\u9ad8\u7ea7\u63d0\u901f\u7528\u6cd5&#xff1a;<\/p>\n<p># 1. \u591a\u7ebf\u7a0b gzip \u538b\u7f29<br \/>\n# tar \u9ed8\u8ba4\u8c03\u7528\u7684 gz \u538b\u7f29\u5668\u4ec5\u652f\u6301\u5355\u7ebf\u7a0b\u538b\u7f29&#xff0c;pigz \u538b\u7f29\u5668\u652f\u6301\u591a\u7ebf\u7a0b&#xff0c;\u901f\u5ea6\u66f4\u5feb<br \/>\n# \u9996\u5148\u786e\u4fdd\u5b89\u88c5\u4e86 pigz \u8fd9\u4e2a\u8f6f\u4ef6\u5305<br \/>\nsudo apt install pigz -y<br \/>\n# \u7136\u540e\u538b\u7f29\/\u89e3\u538b\u65f6\u53bb\u9664 -z \u53c2\u6570&#xff0c;\u4f7f\u7528 -I \u6307\u5b9a\u538b\u7f29\u5668\u4e3a pigz<br \/>\ntar -I pigz -cvf archive.tar.gz dir\/<br \/>\ntar -I pigz -xvf archive.tar.gz<\/p>\n<p># 2. zstd \u538b\u7f29<br \/>\n# zstd \u662f\u76f8\u6bd4 gzip \u66f4\u597d\u7684\u538b\u7f29\u7b97\u6cd5&#xff0c;\u5b83\u66f4\u5feb&#xff0c;\u800c\u4e14\u901a\u5e38\u538b\u7f29\u7387\u66f4\u9ad8<br \/>\n# \u9996\u5148\u786e\u4fdd\u5b89\u88c5\u4e86 zstd \u8fd9\u4e2a\u8f6f\u4ef6\u5305<br \/>\nsudo apt install zstd -y<br \/>\n# \u7136\u540e\u538b\u7f29\/\u89e3\u538b\u65f6\u53bb\u9664 -z \u53c2\u6570&#xff0c;\u4f7f\u7528 &#8211;zstd \u6307\u5b9a\u4f7f\u7528 zstd \u7b97\u6cd5<br \/>\ntar &#8211;zstd -cvf archive.tar.zst dir\/<br \/>\ntar &#8211;zstd -xvf archive.tar.zst <\/p>\n<h4>zip \/unzip&#xff08;\u548c Windows \u4e92\u901a&#xff09;<\/h4>\n<p>#\u5b89\u88c5<br \/>\nsudo apt install zip unzip -y<\/p>\n<p>#\u538b\u7f29\u76ee\u5f55 -r\u9012\u5f52<br \/>\nzip -r archive.zip dir\/<\/p>\n<p>#\u89e3\u538b<br \/>\nunzip archive.zip<\/p>\n<h4>7z&#xff08;\u9ad8\u538b\u7f29\u7387&#xff09;<\/h4>\n<p>sudo apt install p7zip-full -y<\/p>\n<p>#\u538b\u7f29 a\u4ee3\u8868add\u6dfb\u52a0<br \/>\n7z a archive.7z dir\/<\/p>\n<p>#\u89e3\u538b x\u4ee3\u8868\u89e3\u538b<br \/>\n7z x archive.7z<\/p>\n<p>\u6ce8\u610f&#xff1a;7z \u538b\u7f29\u901f\u5ea6\u6162&#xff0c;\u9002\u5408\u5f52\u6863\u5907\u4efd&#xff0c;\u4e0d\u9002\u5408\u65e5\u5e38\u5feb\u901f\u6253\u5305\u3002<\/p>\n<hr \/>\n<h3>2.3 \u6587\u6863\u5904\u7406\u8865\u5145 wc \/grep\/sed<\/h3>\n<p>\u670d\u52a1\u5668\u6392\u67e5\u65e5\u5fd7\u3001\u6279\u91cf\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5fc5\u7528\u4e09\u4ef6\u5957\u3002<\/p>\n<h4>wc \u6587\u672c\u7edf\u8ba1<\/h4>\n<p>\u5982\u679c\u4f60\u6709\u4e00\u4e2a\u7eaf\u6587\u672c&#xff0c;\u9700\u8981\u7edf\u8ba1\u5b83\u7684\u957f\u5ea6\u548c\u884c\u6570\u4fe1\u606f&#xff0c;\u53ef\u4ee5\u4f7f\u7528 wc \u547d\u4ee4\u3002<\/p>\n<ul>\n<li>\u547d\u4ee4&#xff1a;wc&#xff08;\u610f\u4e3a word count&#xff09;<\/li>\n<li>\u7528\u9014&#xff1a;\u7edf\u8ba1\u6587\u672c\u4fe1\u606f<\/li>\n<li>\u6838\u5fc3\u53c2\u6570&#xff1a;\n<ul>\n<li>\u4f4d\u7f6e\u53c2\u6570&#xff1a;\u60f3\u7edf\u8ba1\u6587\u4ef6\u7684\u8def\u5f84<\/li>\n<li>-l&#xff1a;\u53ea\u7edf\u8ba1\u884c\u6570<\/li>\n<li>-w&#xff1a;\u53ea\u7edf\u8ba1\u5355\u8bcd\u6570<\/li>\n<li>-c&#xff1a;\u53ea\u7edf\u8ba1\u5b57\u8282\u6570<\/li>\n<li>-m&#xff1a;\u53ea\u7edf\u8ba1\u5b57\u7b26\u6570<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u4e0d\u52a0\u4efb\u4f55\u53c2\u6570\u65f6&#xff0c;wc \u9ed8\u8ba4\u7edf\u8ba1\u884c\u6570\u3001\u5355\u8bcd\u6570\u3001\u5b57\u8282\u6570&#xff0c;\u8f93\u51fa\u683c\u5f0f\u5982\u4e0b&#xff1a;<\/p>\n<p>[\u884c\u6570] [\u5355\u8bcd\u6570] [\u5b57\u8282\u6570] [\u6587\u4ef6\u540d]<\/p>\n<p># \u9ed8\u8ba4\u8f93\u51fa&#xff1a;\u884c\u6570 \u5355\u8bcd\u6570 \u5b57\u8282\u6570 \u6587\u4ef6\u540d<br \/>\nwc test.txt<\/p>\n<p># -l\u53ea\u7edf\u8ba1\u884c\u6570<br \/>\nwc -l test.txt<\/p>\n<p># -w\u7edf\u8ba1\u5355\u8bcd<br \/>\nwc -w test.txt<\/p>\n<p># -c\u7edf\u8ba1\u5b57\u8282<br \/>\nwc -c test.txt<\/p>\n<h4>grep \u6587\u672c\u641c\u7d22&#xff0c;\u67e5\u627e\u65e5\u5fd7\u5173\u952e\u5b57<\/h4>\n<p>\u7b80\u8981\u5e38\u7528\u53c2\u6570&#xff1a;-i\u5ffd\u7565\u5927\u5c0f\u5199&#xff0c;-n\u663e\u793a\u884c\u53f7&#xff0c;-r\u9012\u5f52\u641c\u7d22&#xff0c;-v\u53cd\u5411\u8fc7\u6ee4&#xff0c;-C\u663e\u793a\u4e0a\u4e0b\u6587<\/p>\n<p>\u5982\u679c\u4f60\u5e0c\u671b\u5728\u6587\u672c\u4e2d\u641c\u7d22\u67d0\u4e2a\u6a21\u5f0f&#xff08;pattern&#xff09;&#xff0c;grep \u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u5de5\u5177\u3002<\/p>\n<ul>\n<li>\u547d\u4ee4&#xff1a;grep&#xff08;\u610f\u4e3a global regular expression print&#xff09;<\/li>\n<li>\u7528\u9014&#xff1a;\u6587\u672c\u641c\u7d22<\/li>\n<li>\u6838\u5fc3\u53c2\u6570&#xff1a;\n<ul>\n<li>\u4f4d\u7f6e\u53c2\u6570 1&#xff1a;\u641c\u7d22\u5185\u5bb9\u7684\u6b63\u5219\u8868\u8fbe\u5f0f<\/li>\n<li>\u4f4d\u7f6e\u53c2\u6570 2&#xff1a;\u60f3\u641c\u7d22\u6587\u4ef6\u7684\u8def\u5f84<\/li>\n<li>-i&#xff1a;\u5ffd\u7565\u5927\u5c0f\u5199<\/li>\n<li>-n&#xff1a;\u663e\u793a\u884c\u53f7<\/li>\n<li>-r&#xff1a;\u9012\u5f52\u641c\u7d22\u76ee\u5f55<\/li>\n<li>-v&#xff1a;\u663e\u793a\u4e0d\u5339\u914d\u7684\u884c<\/li>\n<li>-w&#xff1a;\u53ea\u5339\u914d\u5b8c\u6574\u5355\u8bcd<\/li>\n<li>-F&#xff1a;\u6309\u666e\u901a\u5b57\u7b26\u4e32\u5339\u914d&#xff0c;\u4e0d\u89e3\u6790\u6b63\u5219\u8868\u8fbe\u5f0f<\/li>\n<li>-C \u884c\u6570&#xff1a;\u663e\u793a\u5339\u914d\u884c\u524d\u540e\u5404 n \u884c<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>grep \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177&#xff0c;\u56e0\u6b64\u53c2\u6570\u975e\u5e38\u591a&#xff0c;\u4e0a\u9762\u6211\u53ea\u6311\u9009\u4e86\u6700\u6838\u5fc3\u7684\u53c2\u6570&#xff0c;\u4e0b\u9762\u662f\u4e00\u4e9b\u793a\u4f8b\u3002<\/p>\n<p>#\u67e5\u627e\u5305\u542berror\u7684\u884c<br \/>\ngrep &#034;error&#034; access.log<\/p>\n<p>#\u663e\u793a\u5339\u914d\u884c&#043;\u884c\u53f7<br \/>\ngrep -n &#034;error&#034; access.log<\/p>\n<p>#\u9012\u5f52\u641c\u7d22\u6574\u4e2alogs\u76ee\u5f55\u6240\u6709\u6587\u4ef6<br \/>\ngrep -r &#034;error&#034; logs\/<\/p>\n<p>#-v\u53cd\u5411&#xff0c;\u8fc7\u6ee4\u6389debug\u884c&#xff0c;\u53ea\u770b\u5269\u4e0b\u5185\u5bb9<br \/>\ngrep -v &#034;debug&#034; access.log<\/p>\n<p>#-C 2 \u6253\u5370\u5339\u914d\u884c&#xff0c;\u540c\u65f6\u6253\u5370\u524d\u540e\u54042\u884c\u4e0a\u4e0b\u6587<br \/>\ngrep -C 2 &#034;error&#034; access.log<\/p>\n<p># \u6253\u5370\u5305\u542b\u5355\u8bcderr\u7684\u884c&#xff0c;\u4e0d\u4f1a\u5339\u914derror\u4e2d\u7684err<br \/>\ngrep -w &#034;err&#034; access.log           <\/p>\n<p>#-F\u628a\u641c\u7d22\u5185\u5bb9\u5f53\u666e\u901a\u5b57\u7b26\u4e32&#xff0c;\u4e0d\u89e3\u6790\u6b63\u5219\u7b26\u53f7. *<br \/>\ngrep -F &#034;192.168.1.100&#034; access.log<\/p>\n<h4>sed \u6587\u672c\u66ff\u6362&#xff0c;\u6279\u91cf\u5b57\u7b26\u4e32\u66ff\u6362<\/h4>\n<p>\u5982\u679c\u4f60\u5e0c\u671b\u5728\u6587\u672c\u4e2d\u66ff\u6362\u67d0\u4e2a\u5b57\u7b26\u4e32&#xff0c;\u53ef\u4ee5\u4f7f\u7528 sed \u547d\u4ee4&#xff0c;\u5176\u67e5\u627e\u90e8\u5206\u9ed8\u8ba4\u6309\u7167\u6b63\u5219\u8868\u8fbe\u5f0f\u89e3\u91ca\u3002<\/p>\n<ul>\n<li>\u547d\u4ee4&#xff1a;sed&#xff08;\u610f\u4e3a stream editor&#xff09;<\/li>\n<li>\u7528\u9014&#xff1a;\u6587\u672c\u7f16\u8f91&#xff08;\u5e38\u7528\u4e8e\u5b57\u7b26\u4e32\u66ff\u6362&#xff09;<\/li>\n<li>\u6838\u5fc3\u53c2\u6570&#xff1a;\n<ul>\n<li>\u4f4d\u7f6e\u53c2\u6570 1&#xff1a;\u66ff\u6362\u65b9\u5f0f<\/li>\n<li>\u4f4d\u7f6e\u53c2\u6570 2&#xff1a;\u60f3\u4fee\u6539\u6587\u4ef6\u7684\u8def\u5f84<\/li>\n<li>-i&#xff1a;\u76f4\u63a5\u4fee\u6539\u6e90\u6587\u4ef6&#xff0c;\u4fdd\u5b58\u540e\u4e0d\u53ef\u6062\u590d&#xff01;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u6307\u5b9a\u66ff\u6362\u65b9\u5f0f\u7684\u4f4d\u7f6e\u53c2\u6570 1 \u7684\u6700\u5e38\u7528\u7684\u7528\u6cd5\u5982\u4e0b&#xff1a;<\/p>\n<p>#\u8f93\u51fa\u5230\u7ec8\u7aef\u9884\u89c8\u66ff\u6362\u6548\u679c&#xff0c;\u4e0d\u4f1a\u4fee\u6539\u539f\u6587\u4ef6<br \/>\nsed &#039;s\/\u65e7\u5b57\u7b26\u4e32\/\u65b0\u5b57\u7b26\u4e32\/g&#039; test.txt<\/p>\n<p>#-i\u76f4\u63a5\u4fee\u6539\u6e90\u6587\u4ef6&#xff0c;\u5168\u90e8\u66ff\u6362(g\u4ee3\u8868\u5168\u5c40)<br \/>\nsed -i &#039;s\/Before\/After\/g&#039; test.txt<\/p>\n<p>#\u5206\u9694\u7b26\u53ef\u4ee5\u6362\u6210! #&#xff0c;\u907f\u514d\u8def\u5f84\u659c\u6760\u51b2\u7a81<br \/>\nsed -i &#039;s!\/opt\/old!\/opt\/new!g&#039; test.txt<\/p>\n<p>\u00a0-i\u53c2\u6570\u4ee3\u8868\u76f4\u63a5\u4fee\u6539\u6e90\u6587\u4ef6&#xff0c;\u64cd\u4f5c\u524d\u52a1\u5fc5\u5907\u4efd\u6587\u4ef6&#xff01;<\/p>\n<p>\u8fd9\u91cc\u63d0\u4e00\u4e0b\u5907\u4efd\u6587\u4ef6\u64cd\u4f5c&#xff0c;\u5982\u4f55\u5907\u4efd\u539f\u59cb\u65e5\u5fd7\u6587\u4ef6 test_log.txt &#xff1a;<\/p>\n<p>cp test_log.txt test_log.txt.bak <\/p>\n<p>\u9010\u6bb5\u89e3\u6790&#xff1a;<\/p>\n<p>cp&#xff1a;copy \u590d\u5236\u547d\u4ee4\u00a0 \u00a0 test_log.txt&#xff1a;\u6e90\u6587\u4ef6&#xff0c;\u6211\u4eec\u7684\u539f\u59cb\u65e5\u5fd7&#xff0c; test_log.txt.bak&#xff1a;\u5907\u4efd\u6587\u4ef6&#xff0c;\u540e\u7f00.bak\u662f\u884c\u4e1a\u901a\u7528\u5907\u4efd\u540e\u7f00&#xff0c;\u65b9\u4fbf\u4e00\u773c\u8bc6\u522b\u662f\u5907\u4efd\u6587\u4ef6<\/p>\n<p>\u5982\u679c\u60f3\u628a\u5907\u4efd\u6587\u4ef6\u8fd8\u539f\u56de\u539f\u65e5\u5fd7\u6587\u4ef6&#xff1a;<\/p>\n<p>cp test_log.txt.bak test_log.txt <\/p>\n<p>\u8fd9\u91cc\u53ef\u4ee5\u62d3\u5c55\u4e00\u4e0b\u5728\u5907\u4efd\u7684\u65f6\u5019\u53ef\u4ee5\u52a0\u4e0a\u65f6\u95f4\u6233&#xff0c;\u9632\u6b62\u591a\u6b21\u5907\u4efd\u8986\u76d6\u65e7\u5907\u4efd&#xff1a;<\/p>\n<p>cp test_log.txt test_log.txt.$(date &#043;%Y%m%d_%H%M%S).bak <\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">$(date &#043;%Y%m%d_%H%M%S)&#xff1a;\u547d\u4ee4\u66ff\u6362&#xff0c;\u6267\u884c date \u547d\u4ee4&#xff0c;\u62fc\u63a5\u5e74\u6708\u65e5_\u65f6\u5206\u79d2&#xff0c;\u793a\u4f8b\u751f\u6210\u6587\u4ef6\u540d\u5c31\u662f&#xff1a;test_log.txt.20261017_203010.bak<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">sed \u81ea\u5e26\u5907\u4efd\u53c2\u6570&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">\u5728\u6267\u884csed\u66ff\u6362&#xff0c;\u540c\u65f6\u751f\u6210\u5907\u4efd\u6587\u4ef6&#xff1a;<\/p>\n<p>sed -i.bak &#039;s\/error\/ERR\/g&#039; test_log.txt <\/p>\n<p>\u6ce8\u610f&#xff1a;-i\u548c.bak\u4e2d\u95f4\u4e0d\u80fd\u6709\u7a7a\u683c&#xff0c;\u4e0d\u80fd\u5199\u6210 -i .bak&#xff0c;\u4f1a\u62a5\u9519&#xff01;<\/p>\n<hr \/>\n<h3>2.4 \u7b26\u53f7\u94fe\u63a5\u548c\u786c\u94fe\u63a5 ln<\/h3>\n<h4>\u7b26\u53f7\u94fe\u63a5&#xff08;\u8f6f\u94fe\u63a5&#xff0c;Windows \u5feb\u6377\u65b9\u5f0f&#xff09;<\/h4>\n<p>\u7b26\u53f7\u94fe\u63a5\u76f8\u5f53\u4e8e\u4e00\u4e2a\u5feb\u6377\u65b9\u5f0f&#xff0c;\u5982\u679c\u539f\u59cb\u6587\u4ef6\/\u76ee\u5f55\u662f a&#xff0c;\u90a3\u4e48\u521b\u5efa\u4e00\u4e2a\u7b26\u53f7\u94fe\u63a5 b \u6307\u5411 a \u540e&#xff0c;\u901a\u8fc7 b \u5c31\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u5230 a&#xff0c;\u5982\u56fe\u6240\u793a&#xff1a;<\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203301-6add15fdbaef7.png\" \/><\/p>\n<p>\u8bed\u6cd5&#xff1a;ln -s \u539f\u6587\u4ef6\/\u76ee\u5f55 \u94fe\u63a5\u8def\u5f84<\/p>\n<p>#\u521b\u5efa\u94fe\u63a5link.txt\u6307\u5411original.txt<br \/>\nln -s original.txt link.txt<\/p>\n<p>#\u521b\u5efa\u5bb6\u76ee\u5f55\u4e0bproject\u8f6f\u94fe\u63a5\u6307\u5411\/data\/project<br \/>\nln -s \/data\/project ~\/project<\/p>\n<p>\u7279\u6027&#xff1a;<\/p>\n<li>\u5220\u9664\u8f6f\u94fe\u63a5\u4e0d\u4f1a\u5f71\u54cd\u539f\u6587\u4ef6&#xff1b;\u5220\u9664\u539f\u6587\u4ef6&#xff0c;\u8f6f\u94fe\u63a5\u5931\u6548\u53d8\u7ea2&#xff08;\u65ad\u94fe&#xff09;<\/li>\n<li>\u53ef\u4ee5\u8de8\u78c1\u76d8\u3001\u8de8\u5206\u533a&#xff1b;\u76ee\u5f55\u3001\u6587\u4ef6\u90fd\u53ef\u4ee5\u505a\u8f6f\u94fe\u63a5 \u5b9e\u6218\u573a\u666f&#xff1a;\u78c1\u76d8\u6ee1\u4e86&#xff0c;\u628a\u6570\u636e\u8fc1\u79fb\u5230\u65b0\u76d8&#xff0c;\u521b\u5efa\u8f6f\u94fe\u63a5\u4fdd\u6301\u65e7\u8def\u5f84\u4e0d\u53d8&#xff0c;\u4ee3\u7801\u4e0d\u9700\u8981\u4fee\u6539\u8def\u5f84\u3002<\/li>\n<p> mv \/mnt\/disk_a\/project_data \/mnt\/disk_b<br \/>\nln -s \/mnt\/disk_b\/project_data \/mnt\/disk_a\/project_data<\/p>\n<h4>\u786c\u94fe\u63a5 ln&#xff08;\u4e0d\u5e26 &#8211; s&#xff09;<\/h4>\n<p>\u786c\u94fe\u63a5\u548c\u7b26\u53f7\u94fe\u63a5\u4e0d\u540c&#xff0c;\u5b83\u5e76\u4e0d\u662f\u4e00\u4e2a\u201c\u5feb\u6377\u65b9\u5f0f\u201d\u3002\u521b\u5efa\u786c\u94fe\u63a5\u540e&#xff0c;\u4e24\u4e2a\u6587\u4ef6\u540d\u7684\u5730\u4f4d\u5b8c\u5168\u76f8\u540c&#xff0c;\u5b83\u4eec\u5171\u540c\u6307\u5411\u540c\u4e00\u4e2a inode&#xff08;\u6587\u4ef6\u6570\u636e\u8282\u70b9&#xff09;&#xff0c;\u5c31\u4eff\u4f5b\u4e24\u4e2a C \u8bed\u8a00\u6307\u9488\u6307\u5411\u540c\u4e00\u4e2a\u5bf9\u8c61\u3002\u5982\u56fe\u6240\u793a&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203302-6add15fe8eb78.png\" \/><\/p>\n<p>Linux \u4f1a\u8bb0\u5f55\u4e00\u4e2a inode \u88ab\u591a\u5c11\u4e2a\u6587\u4ef6\u540d\u5f15\u7528&#xff0c;\u8fd9\u4e2a\u6570\u91cf\u79f0\u4e3a\u94fe\u63a5\u6570\u3002\u521b\u5efa\u4e0a\u8ff0\u786c\u94fe\u63a5\u540e&#xff0c;\u94fe\u63a5\u6570\u4e3a 2&#xff1b;\u5220\u9664 original.txt \u6216 hardlink.txt \u4e2d\u4efb\u610f\u4e00\u4e2a\u540e&#xff0c;\u94fe\u63a5\u6570\u53d8\u6210 1&#xff0c;\u6587\u4ef6\u6570\u636e\u4ecd\u7136\u5b58\u5728\u3002\u53ea\u6709\u4e24\u4e2a\u6587\u4ef6\u540d\u90fd\u88ab\u5220\u9664\u540e&#xff0c;\u94fe\u63a5\u6570\u624d\u4f1a\u5f52\u96f6&#xff0c;\u6587\u4ef6\u6570\u636e\u624d\u4f1a\u88ab\u5220\u9664\u3002<\/p>\n<p>\u901a\u8fc7 ln \u547d\u4ee4\u4e5f\u80fd\u521b\u5efa\u786c\u94fe\u63a5&#xff0c;\u53ea\u6709\u540c\u6587\u4ef6\u7cfb\u7edf\u7684\u6587\u4ef6\u53ef\u4ee5\u521b\u5efa\u786c\u94fe\u63a5&#xff1a;ln \u539f\u5bf9\u8c61 \u94fe\u63a5\u540d<\/p>\n<p># \u521b\u5efa\u786c\u94fe\u63a5 link.txt \u6307\u5411 original.txt<br \/>\nln original.txt link.txt<\/p>\n<p>\u7279\u6027\u91cd\u70b9&#xff1a;<\/p>\n<li>\u591a\u4e2a\u6587\u4ef6\u540d\u6307\u5411\u540c\u4e00\u4e2a\u78c1\u76d8 inode \u6570\u636e&#xff1b;\u5220\u9664\u5176\u4e2d\u4e00\u4e2a&#xff0c;\u6570\u636e\u4e0d\u4f1a\u6d88\u5931&#xff0c;\u5168\u90e8\u5220\u9664\u624d\u5220\u9664\u6570\u636e\u3002<\/li>\n<li>\u4e0d\u80fd\u8de8\u5206\u533a&#xff0c;\u4e0d\u80fd\u7ed9\u76ee\u5f55\u521b\u5efa\u786c\u94fe\u63a5&#xff0c;\u53ea\u652f\u6301\u666e\u901a\u6587\u4ef6\u3002<\/li>\n<li>\u786c\u94fe\u63a5\u662f\u4e0d\u4f1a\u6d88\u8017\u591a\u500d\u5b58\u50a8\u7a7a\u95f4\u7684&#xff0c;\u6587\u4ef6\u53ea\u4f1a\u88ab\u50a8\u5b58\u4e00\u904d\u3002<\/li>\n<hr \/>\n<h3>2.5 \u540e\u53f0\u4efb\u52a1\u548c\u7ec8\u7aef\u590d\u7528\u5668 bg\/fg\/jobs\/nohup\/screen\/tmux<\/h3>\n<p>\u5728\u4e00\u4e2a Shell \u4e2d&#xff0c;\u8fd0\u884c\u4e00\u4e2a\u547d\u4ee4\u540e\u5b83\u5c31\u72ec\u5360\u4e86\u6574\u4e2a Shell&#xff0c;\u5982\u679c\u8fd9\u4e2a\u547d\u4ee4\u5f88\u8017\u65f6&#xff0c;\u90a3\u6b64\u65f6\u5c31\u65e0\u6cd5\u518d\u8fd0\u884c\u7b2c\u4e8c\u4e2a\u547d\u4ee4\u4e86\u3002\u8fd9\u65f6\u5019\u6211\u4eec\u6709\u591a\u79cd\u89e3\u51b3\u65b9\u6848&#xff0c;\u5206\u522b\u662f Linux \u4f20\u7edf\u7684\u524d\u540e\u53f0\u4efb\u52a1\u673a\u5236\u4ee5\u53ca\u66f4\u4e3a\u5f3a\u5927\u6613\u7528\u7684\u7ec8\u7aef\u590d\u7528\u5668\u3002\u6b64\u5916&#xff0c;\u672c\u8282\u8fd8\u4f1a\u63d0\u4f9b\u201cSSH \u65ad\u5f00\u540e\u8fd0\u884c\u7684\u4efb\u52a1\u88ab\u7ec8\u6b62\u201d\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\u75db\u70b9\u573a\u666f&#xff1a;SSH \u8fdc\u7a0b\u670d\u52a1\u5668\u8dd1\u8bad\u7ec3\u4efb\u52a1&#xff0c;\u5982\u679c\u5173\u95ed\u7ec8\u7aef \/ \u7f51\u7edc\u65ad\u5f00&#xff0c;\u666e\u901a\u8fdb\u7a0b\u76f4\u63a5\u88ab\u6740\u6389\u3002<\/p>\n<h4>\u4f20\u7edf\u540e\u53f0\u4efb\u52a1\u7ba1\u7406<\/h4>\n<p>&#xff08;1&#xff09;\u5c06\u524d\u53f0\u4efb\u52a1\u6302\u5230\u540e\u53f0<\/p>\n<p>\u5047\u5982\u8fd0\u884c\u4e86\u4e00\u4e2a\u6781\u4e3a\u8017\u65f6\u7684\u547d\u4ee4&#xff1a;<\/p>\n<p>sleep 3600 <\/p>\n<p>\u6b64\u65f6\u5e0c\u671b\u5c06\u5176\u5207\u5230\u540e\u53f0&#xff0c;\u8ba9\u5f00 Shell&#xff0c;\u90a3\u4e48\u53ef\u4ee5\u6309\u952e\u76d8\u5feb\u6377\u952e Ctrl &#043; Z\u3002\u6b64\u65f6 Shell \u4f1a\u5f39\u51fa\u63d0\u9192&#xff0c;\u4ee3\u8868\u7740\u547d\u4ee4\u5df2\u7ecf\u88ab\u6302\u5230\u540e\u53f0&#xff0c;\u540c\u65f6\u5df2\u7ecf\u88ab\u6682\u505c\u4e86&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203303-6add15ff9aa2a.png\" \/><\/p>\n<p>\u5982\u679c\u6211\u4eec\u5e0c\u671b\u5728\u540e\u53f0\u5b83\u7ee7\u7eed\u8fd0\u884c&#xff0c;\u9700\u8981\u4f7f\u7528\u547d\u4ee4&#xff1a;<\/p>\n<p>bg <\/p>\n<p>\u6b64\u65f6 Shell \u4f1a\u5f39\u51fa\u63d0\u9192&#xff0c;\u4ee3\u8868\u6302\u5230\u540e\u53f0\u7684\u4efb\u52a1\u91cd\u65b0\u5f00\u59cb\u5728\u540e\u53f0\u8fd0\u884c\u4e86&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203303-6add15ffbcef6.png\" \/><\/p>\n<p>&#xff08;2&#xff09;\u76f4\u63a5\u65b0\u5efa\u540e\u53f0\u4efb\u52a1<\/p>\n<p>\u5982\u679c\u4f60\u5df2\u7ecf\u77e5\u9053\u4e00\u4e2a\u547d\u4ee4\u5f88\u8017\u65f6&#xff0c;\u6253\u7b97\u76f4\u63a5\u628a\u5b83\u6302\u5230\u540e\u53f0&#xff0c;\u90a3\u4e48\u53ef\u4ee5\u5728\u547d\u4ee4\u7684\u672b\u5c3e\u6dfb\u52a0 &amp; \u7b26\u53f7&#xff0c;\u4ee3\u8868\u76f4\u63a5\u65b0\u5efa\u540e\u53f0\u4efb\u52a1&#xff1a;<\/p>\n<p>sleep 1800 &amp; <\/p>\n<p>\u6b64\u65f6&#xff0c;\u6267\u884c\u5b8c\u547d\u4ee4\u540e\u5b83\u5c31\u76f4\u63a5\u8fdb\u5165\u540e\u53f0\u5e76\u7ee7\u7eed\u8fd0\u884c\u4e86&#xff0c;\u4e0d\u4f1a\u5360\u7528 Shell&#xff0c;\u540c\u65f6\u4f1a\u5f39\u51fa\u63d0\u9192&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203303-6add15ffd97cf.png\" \/><\/p>\n<p>&#xff08;3&#xff09;\u5c06\u540e\u53f0\u4efb\u52a1\u53d6\u56de\u524d\u53f0<\/p>\n<p>\u82e5\u8981\u5c06\u540e\u53f0\u4efb\u52a1\u53d6\u56de\u524d\u53f0&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4&#xff1a;<\/p>\n<p>fg <\/p>\n<p>\u5982\u679c\u6b64\u65f6\u6709\u591a\u4e2a\u540e\u53f0\u4efb\u52a1&#xff0c;\u9ed8\u8ba4\u53d6\u56de\u6700\u8fd1\u4e00\u4e2a\u3002\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5e8f\u53f7\u6765\u6307\u5b9a&#xff0c;\u9996\u5148\u7528\u547d\u4ee4\u5217\u51fa\u6240\u6709\u540e\u53f0\u4efb\u52a1&#xff1a;<\/p>\n<p>jobs <\/p>\n<p>\u4f1a\u4ee5\u5217\u8868\u6253\u5370\u51fa\u6240\u6709\u540e\u53f0\u4efb\u52a1\u548c\u4efb\u52a1\u7684\u72b6\u6001&#xff1a;<\/p>\n<p>[1]   Running                 sleep 3600 &amp;<br \/>\n[2]-  Running                 sleep 1800 &amp;<br \/>\n[3]&#043;  Stopped                 sleep 2400 <\/p>\n<p>\u7136\u540e\u4f7f\u7528 %\u5e8f\u53f7 \u6765\u6307\u5b9a\u8981\u53d6\u56de\u524d\u53f0\u7684\u540e\u53f0\u4efb\u52a1&#xff1a;<\/p>\n<p>fg %1 # \u53d6\u56de\u4efb\u52a11<br \/>\nfg %2 # \u53d6\u56de\u4efb\u52a12<br \/>\nfg %3 # \u53d6\u56de\u4efb\u52a13 <\/p>\n<h4>\u4e0d\u88ab\u6302\u65ad\u7684\u4efb\u52a1<\/h4>\n<p>\u5bf9\u4e8e\u666e\u901a\u4efb\u52a1&#xff0c;\u5f53 SSH \u6216\u8005 Shell \u5173\u95ed\u65f6&#xff0c;\u4efb\u52a1\u90fd\u4f1a\u6536\u5230\u6765\u81ea Shell \u7684 SIGHUP \u4fe1\u53f7\u800c\u88ab\u7ec8\u6b62\u3002\u5982\u679c\u5e0c\u671b\u4efb\u52a1\u5728 SSH \u6216\u8005 Shell \u5173\u95ed\u65f6\u7ee7\u7eed\u6b63\u5e38\u8fd0\u884c&#xff0c;\u5c31\u9700\u8981 nohup \u547d\u4ee4\u4e86\u3002<\/p>\n<p>nohup&#xff1a;\u6302\u65ad SSH \u8fdb\u7a0b\u4e0d\u4f1a\u88ab\u6740<\/p>\n<p>SIGHUP \u4fe1\u53f7&#xff1a;ssh \u65ad\u5f00\u4f1a\u53d1\u9001\u8fd9\u4e2a\u4fe1\u53f7\u7ec8\u6b62\u7a0b\u5e8f&#xff0c;nohup \u5c4f\u853d\u8be5\u4fe1\u53f7\u3002<\/p>\n<p>\u5728\u547d\u4ee4\u524d\u6dfb\u52a0 nohup \u5373\u53ef\u521b\u5efa\u4e0d\u88ab\u6302\u65ad\u7684\u4efb\u52a1&#xff1a;<\/p>\n<p>nohup python train.py <\/p>\n<p>\u5982\u679c\u5e0c\u671b\u76f4\u63a5\u521b\u5efa\u4e0d\u88ab\u6302\u65ad\u7684\u540e\u53f0\u4efb\u52a1&#xff0c;\u53ef\u4ee5\u4f7f\u7528&#xff1a;<\/p>\n<p>nohup python train.py &amp; <\/p>\n<p>\u5982\u679c\u5e0c\u671b\u628a\u4efb\u52a1\u7684\u8f93\u51fa\u5bfc\u51fa\u4fdd\u5b58\u4e3a\u6587\u4ef6&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u5199\u6cd5&#xff08;\u6700\u5e38\u89c1\u7684\u7ec4\u5408&#xff09;&#xff1a;<\/p>\n<p>nohup python train.py &gt;train.log 2&gt;&amp;1 &amp;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2502\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u2502\u00a0 \u00a0 \u00a0 \u00a0 \u2514\u2500 \u6302\u5230\u540e\u53f0<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\u2502\u00a0 \u00a0 \u00a0\u00a0 \u00a0 \u00a0 \u00a0 \u2514\u2500\u2500\u2500\u2500\u2500\u2500 \u5c06 stderr \u5199\u5165 stdout&#xff08;\u5373 train.log&#xff09;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u5c06 stdout \u5199\u5165 train.log<\/p>\n<h4>\u7ec8\u7aef\u590d\u7528\u5668 &#xff08;tmux\u00a0 \u00a0screen&#xff09;<\/h4>\n<p>&#xff08;1&#xff09;tmux \u5de5\u5177&#xff08;\u5f3a\u70c8\u63a8\u8350&#xff0c;\u66ff\u4ee3 nohup&#xff0c;AI \u8bad\u7ec3\u9996\u9009&#xff09;<\/p>\n<p>\u6bd4 nohup \u597d\u7528&#xff0c;\u4f1a\u8bdd\u72ec\u7acb&#xff0c;\u65ad\u5f00 ssh \u518d\u91cd\u8fde\u53ef\u4ee5\u6062\u590d\u4e4b\u524d\u7ec8\u7aef\u754c\u9762\u3002<\/p>\n<p>#\u5b89\u88c5<br \/>\nsudo apt install tmux<\/p>\n<p>#\u65b0\u5efa\u4f1a\u8bdd\u5e76\u547d\u540d<br \/>\ntmux new -s train<\/p>\n<p># \u5728tmux\u7a97\u53e3\u91cc\u9762\u968f\u4fbf\u8dd1\u7a0b\u5e8f python train.py<br \/>\n# \u8131\u79bb\u4f1a\u8bdd&#xff08;\u540e\u53f0\u7ee7\u7eed\u8dd1&#xff09;\u5feb\u6377\u952e&#xff1a;Ctrl&#043;B&#xff0c;\u677e\u5f00&#xff0c;\u518d\u6309D<\/p>\n<p>#\u67e5\u770b\u6240\u6709\u4f1a\u8bdd<br \/>\ntmux ls<\/p>\n<p>#\u91cd\u65b0\u63a5\u5165\u4f1a\u8bdd<br \/>\ntmux attach -t train<\/p>\n<p>\u793a\u4f8b&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203304-6add16000a630.png\" \/><\/p>\n<p>&#xff08;2&#xff09;screen \u5de5\u5177<\/p>\n<p>\/\/\u6ca1\u6709\u7684\u8bdd\u9996\u5148\u5b89\u88c5<br \/>\nsudo apt install screen<br \/>\n\/\/\u521b\u5efa\u4f1a\u8bdd<br \/>\nscreen -S train<br \/>\n\/\/ \u8131\u79bb Ctrl&#043;A \u677e\u5f00 D<br \/>\n\/\/ \u67e5\u770b\u5df2\u6709\u7684\u4f1a\u8bdd<br \/>\nscreen -ls<br \/>\n\/\/ \u6307\u5b9a\u4f1a\u8bdd\u540d\u91cd\u65b0\u8fdb\u5165<br \/>\nscreen -r train<\/p>\n<p>\u91cd\u8981\u63d0\u9192&#xff1a;\u8fdc\u7a0b\u8dd1\u957f\u65f6\u95f4\u4efb\u52a1\u4f18\u5148tmux&#xff0c;\u4e0d\u5efa\u8bae\u88f8\u7528 nohup\u3002<\/p>\n<hr \/>\n<h3>2.6 \u7cfb\u7edf\u8d44\u6e90\u67e5\u8be2<\/h3>\n<p>Windows \u6709\u4efb\u52a1\u7ba1\u7406\u5668\u6765\u67e5\u770b\u7cfb\u7edf\u8d44\u6e90\u7684\u4f7f\u7528\u60c5\u51b5&#xff0c;\u76f8\u540c\u7684&#xff0c;Linux \u4e5f\u6709\u4e30\u5bcc\u7684\u5de5\u5177\u6765\u67e5\u8be2\u548c\u7ba1\u7406\u7cfb\u7edf\u8d44\u6e90&#xff0c;\u672c\u8282\u5c06\u4f1a\u4ecb\u7ecd\u4ee5\u4e0b\u5de5\u5177&#xff1a;<\/p>\n<ul>\n<li>\u4efb\u52a1\u7ba1\u7406\u5668&#xff08;CPU\u3001\u5185\u5b58\u548c\u8fdb\u7a0b&#xff09;&#xff1a;top, htop<\/li>\n<li>\u8fdb\u7a0b\u4e2d\u6b62&#xff1a;kill, pkill<\/li>\n<li>\u78c1\u76d8\u72b6\u6001\u67e5\u770b&#xff1a;du, df, lsblk, iotop<\/li>\n<li>\u7f51\u7edc\u72b6\u6001\u67e5\u770b&#xff1a;ifconfig, iftop, nload<\/li>\n<\/ul>\n<h4>\u4efb\u52a1\u7ba1\u7406\u5668 top \/htop<\/h4>\n<p>\u672c\u8282\u5c06\u4f1a\u4ecb\u7ecd\u67e5\u770b\u7ba1\u7406 CPU\u3001\u5185\u5b58\u548c\u8fdb\u7a0b\u7684\u4efb\u52a1\u7ba1\u7406\u5668 top \u548c htop&#xff0c;\u524d\u8005\u662f\u7edd\u5927\u591a\u6570 Linux \u53d1\u884c\u7248\u90fd\u4f1a\u81ea\u5e26\u7684\u7cfb\u7edf\u7ec4\u4ef6&#xff0c;\u540e\u8005\u9700\u8981\u624b\u52a8\u5b89\u88c5&#xff0c;\u4f46\u662f\u66f4\u4e3a\u5f3a\u5927\u548c\u597d\u7528\u3002<\/p>\n<p>&#xff08;1&#xff09;top \u5de5\u5177&#xff08;table of processes&#xff09;<\/p>\n<p>\u4f7f\u7528 top \u547d\u4ee4\u5373\u53ef\u6253\u5f00\u4efb\u52a1\u7ba1\u7406\u5668&#xff0c;\u6253\u5f00\u540e\u7528 q \u6216 Ctrl &#043; C \u9000\u51fa\u3002top \u4f1a\u5360\u6ee1\u7ec8\u7aef\u5e76\u81ea\u52a8\u5237\u65b0&#xff0c;\u754c\u9762\u5982\u4e0b&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203304-6add16009035d.png\" \/><\/p>\n<p>\u9996\u5148\u770b\u5230\u9876\u90e8\u7684\u4e94\u884c\u4fe1\u606f&#xff0c;\u7406\u89e3\u5982\u4e0b&#xff1a;<\/p>\n<p>top &#8211; 16:30:14 up 25 min,  2 users,  load average: 0.15, 0.52, 0.59<br \/>\n\u5f53\u524d\u65f6\u95f4&#xff1b;\u7cfb\u7edf\u5df2\u8fd0\u884c\u65f6\u95f4&#xff1b;\u5f53\u524d\u767b\u5f55\u7528\u6237\u6570&#xff1b;\u8fc7\u53bb 1\u30015\u300115 \u5206\u949f\u7684\u5e73\u5747\u8d1f\u8f7d<br \/>\nTasks: 299 total,  1 running,  297 sleeping,  1 stopped,  0 zombie<br \/>\n\u8fdb\u7a0b\u603b\u6570&#xff1b;\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\u6570&#xff1b;\u4f11\u7720\u8fdb\u7a0b\u6570&#xff1b;\u5df2\u505c\u6b62\u8fdb\u7a0b\u6570&#xff1b;\u50f5\u5c38\u8fdb\u7a0b\u6570<br \/>\n%Cpu(s):  4.0 us,  8.0 sy,  0.0 ni, 88.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st<br \/>\n\u7528\u6237\u8fdb\u7a0b\u5360\u7528&#xff1b;\u5185\u6838\u5360\u7528&#xff1b;\u8c03\u6574\u8fc7 nice \u7684\u8fdb\u7a0b\u5360\u7528&#xff1b;CPU \u7a7a\u95f2&#xff1b;\u7b49\u5f85 I\/O&#xff1b;\u786c\u4ef6\u4e2d\u65ad&#xff1b;\u8f6f\u4ef6\u4e2d\u65ad&#xff1b;\u88ab\u865a\u62df\u673a\u5bbf\u4e3b\u673a\u5360\u7528<br \/>\nMiB Mem : 3863.4 total,  601.0 free, 1190.3 used, 2308.9 buff\/cache<br \/>\n\u7269\u7406\u5185\u5b58\u603b\u91cf&#xff1b;\u7a7a\u95f2\u5185\u5b58&#xff1b;\u5df2\u4f7f\u7528\u5185\u5b58&#xff1b;\u7f13\u51b2\u533a\u548c\u7f13\u5b58<br \/>\nMiB Swap: 3867.0 total, 3867.0 free,    0.0 used, 2673.1 avail Mem<br \/>\nSwap \u603b\u91cf&#xff1b;Swap \u7a7a\u95f2&#xff1b;Swap \u5df2\u4f7f\u7528&#xff1b;\u9884\u8ba1\u53ef\u7528\u7269\u7406\u5185\u5b58<\/p>\n<p>\u9664\u4e86\u663e\u793a\u5f53\u524d\u7cfb\u7edf\u7684\u72b6\u6001\u5916&#xff0c;top \u8fd8\u80fd\u663e\u793a\u548c\u7ba1\u7406\u8fdb\u7a0b&#xff0c;\u8fd9\u5c31\u662f\u4e0b\u9762\u7684\u8868\u683c\u663e\u793a\u7684\u5185\u5bb9\u3002\u9996\u5148\u770b\u5230\u8868\u5934&#xff0c;\u6bcf\u4e00\u5217\u7684\u542b\u4e49\u662f&#xff1a;<\/p>\n<ul>\n<li>PID \u2013 \u8fdb\u7a0b\u7f16\u53f7<\/li>\n<li>USER \u2013 \u542f\u52a8\u8be5\u8fdb\u7a0b\u7684\u7528\u6237<\/li>\n<li>PR \u2013 \u8fdb\u7a0b\u8c03\u5ea6\u4f18\u5148\u7ea7&#xff0c;\u6570\u503c\u8d8a\u5c0f\u4f18\u5148\u7ea7\u8d8a\u9ad8<\/li>\n<li>NI \u2013 \u8fdb\u7a0b nice \u503c&#xff0c;\u6570\u503c\u8d8a\u5c0f\u4f18\u5148\u7ea7\u8d8a\u9ad8<\/li>\n<li>VIRT \u2013 \u865a\u62df\u5185\u5b58\u603b\u91cf<\/li>\n<li>RES \u2013 \u5b9e\u9645\u9a7b\u7559\u5728\u7269\u7406\u5185\u5b58\u4e2d\u7684\u5927\u5c0f<\/li>\n<li>SHR \u2013 \u5171\u4eab\u5185\u5b58\u5927\u5c0f<\/li>\n<li>S \u2013 \u8fdb\u7a0b\u72b6\u6001&#xff1a;R \u8fd0\u884c&#xff0c;S \u53ef\u4e2d\u65ad\u7761\u7720&#xff0c;D \u4e0d\u53ef\u4e2d\u65ad\u7761\u7720&#xff0c;T \u5df2\u6682\u505c&#xff0c;Z \u50f5\u5c38\u8fdb\u7a0b&#xff0c;I \u7a7a\u95f2\u5185\u6838\u7ebf\u7a0b<\/li>\n<li>%CPU \u2013 CPU \u4f7f\u7528\u7387<\/li>\n<li>%MEM \u2013 \u7269\u7406\u5185\u5b58\u4f7f\u7528\u7387<\/li>\n<li>TIME&#043; \u2013 \u8fdb\u7a0b\u7d2f\u8ba1\u5360\u7528 CPU \u7684\u65f6\u95f4<\/li>\n<li>COMMAND \u2013 \u8fdb\u7a0b\u5bf9\u5e94\u7684\u547d\u4ee4\u6216\u7a0b\u5e8f\u540d<\/li>\n<\/ul>\n<p>\u7136\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u7528 \u2191 \u2193 \u548c PGUP PGDN&#xff0c;\u6765\u6eda\u52a8\u548c\u7ffb\u9875\u6574\u4e2a\u8868\u683c\u4e86&#xff0c;\u9664\u6b64\u4e4b\u5916&#xff0c;\u8fd8\u53ef\u4ee5\u8f93\u51fa\u5927\u5199 P \u4ee5 CPU \u5360\u7528\u6392\u5e8f&#xff0c;\u8f93\u5165\u5927\u5199 M \u4ee5\u5185\u5b58\u5360\u7528\u6392\u5e8f\u3002<\/p>\n<p>&#xff08;2&#xff09;htop \u5de5\u5177<\/p>\n<p>htop \u76f8\u5f53\u4e8e\u52a0\u5f3a\u7248\u7684 top&#xff0c;\u5b83\u7684\u754c\u9762\u66f4\u7f8e\u89c2\u6613\u7528&#xff0c;\u540c\u65f6\u529f\u80fd\u4e5f\u66f4\u5f3a\u5927&#xff0c;\u4e00\u822c\u6765\u8bf4\u6211\u66f4\u559c\u6b22\u7528 htop\u3002\u9996\u5148\u5b89\u88c5\u5b83&#xff1a;sudo apt install htop -y<\/p>\n<p>\u4f7f\u7528 htop \u547d\u4ee4\u5373\u53ef\u6253\u5f00\u4efb\u52a1\u7ba1\u7406\u5668&#xff0c;\u6253\u5f00\u540e\u7528 q \u6216 Ctrl &#043; C \u9000\u51fa\u3002htop \u4f1a\u5360\u6ee1\u7ec8\u7aef\u5e76\u81ea\u52a8\u5237\u65b0&#xff0c;\u754c\u9762\u5982\u4e0b&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203306-6add16026f32f.png\" \/><\/p>\n<p>\u53ef\u4ee5\u53d1\u73b0&#xff0c;htop \u6700\u660e\u663e\u7684\u533a\u522b\u5c31\u662f\u754c\u9762\u66f4\u7f8e\u89c2\u4e86&#xff0c;\u8fd8\u6709\u4e00\u4e2a\u533a\u522b\u5c31\u662f htop \u4e0d\u4ec5\u53ef\u4ee5\u7eaf\u952e\u76d8\u64cd\u4f5c&#xff0c;\u8fd8\u53ef\u4ee5\u7528\u9f20\u6807\u64cd\u4f5c\u3002\u4f8b\u5982\u53ef\u4ee5\u7528\u6eda\u8f6e\u6765\u6eda\u52a8\u8fdb\u7a0b\u5217\u8868&#xff0c;\u70b9\u51fb\u8868\u5934\u53ef\u4ee5\u5207\u6362\u6392\u5e8f\u5217\u4ee5\u53ca\u6392\u5e8f\u65b9\u5411&#xff0c;\u70b9\u51fb\u4e0b\u65b9\u7684\u6309\u94ae\u53ef\u4ee5\u9009\u62e9\u529f\u80fd\u3002<\/p>\n<p>\u56e0\u6b64 htop \u7684\u4f7f\u7528\u96be\u5ea6\u5c31\u5f88\u4f4e\u4e86&#xff0c;\u8fd9\u91cc\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b\u4e24\u4e2a\u5e38\u7528\u7684\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u641c\u7d22&#xff1a;\u6309 F3 \u6216\u8005\u9f20\u6807\u70b9\u51fb Search \u6309\u94ae&#xff0c;\u63a5\u7740\u5c31\u53ef\u4ee5\u7528\u5173\u952e\u5b57\u641c\u7d22\u8fdb\u7a0b\u4e86\u3002<\/li>\n<li>\u4e2d\u6b62&#xff1a;\u9ad8\u4eae\u9009\u4e2d\u4e00\u884c\u8fdb\u7a0b\u540e\u6309 F9 \u6216\u8005\u9f20\u6807\u70b9\u51fb Kill \u6309\u94ae&#xff0c;\u4f1a\u8fdb\u5165\u4fe1\u53f7\u53d1\u9001\u754c\u9762&#xff0c;\u9009\u62e9 15 SIGTERM \u53d1\u9001\u6765\u8bf7\u6c42\u4e2d\u6b62\u8fdb\u7a0b&#xff0c;\u6216\u8005\u53d1\u9001 9 SIGKILL \u6765\u5f3a\u5236\u4e2d\u6b62\u8fdb\u7a0b\u3002<\/li>\n<\/ul>\n<h4>\u8fdb\u7a0b\u4e2d\u6b62 kill \/pkill\u00a0<\/h4>\n<p>\u4e0a\u4e00\u8282\u4ecb\u7ecd\u7684 htop \u5df2\u7ecf\u6709\u4e2d\u6b62\u8fdb\u7a0b\u7684\u529f\u80fd\u4e86&#xff0c;\u4e0d\u8fc7 Linux \u81ea\u8eab\u4e5f\u6709\u4e13\u95e8\u7684\u547d\u4ee4\u3002<\/p>\n<p>&#xff08;1&#xff09;kill \u547d\u4ee4&#xff1a;\u6740\u6b7b\u6307\u5b9a ID \u8fdb\u7a0b<\/p>\n<p>\u4f7f\u7528 kill \u8fdb\u7a0bID \u6765\u6740\u6b7b\u8fdb\u7a0b&#xff0c;\u8fdb\u7a0b ID \u53ef\u4ee5\u901a\u8fc7 top \u6216\u8005 htop \u67e5\u5230\u3002<\/p>\n<p>kill \u9ed8\u8ba4\u53d1\u9001 SIGTERM \u5373\u8bf7\u6c42\u4e2d\u6b62\u8fdb\u7a0b&#xff0c;\u5982\u679c\u8fdb\u7a0b\u5df2\u7ecf\u5b8c\u5168\u5361\u6b7b\u4e0d\u54cd\u5e94&#xff0c;\u53ef\u4ee5\u53d1\u9001 SIGKILL \u6765\u5f3a\u5236\u4e2d\u6b62\u8fdb\u7a0b&#xff0c;\u4f7f\u7528 kill -9 \u8fdb\u7a0bID<\/p>\n<p>#\u901a\u8fc7PID\u6740\u8fdb\u7a0b&#xff0c;PID\u6765\u81eatop\/htop<br \/>\nkill 12345<\/p>\n<p>#\u5f3a\u5236\u6740\u6b7b\u5361\u6b7b\u8fdb\u7a0b SIGKILL<br \/>\nkill -9 12345<\/p>\n<p>&#xff08;2&#xff09;pkill \u547d\u4ee4&#xff1a;\u6740\u6b7b\u6307\u5b9a\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u8fdb\u7a0b<\/p>\n<p>\u4f7f\u7528 pkill \u6b63\u5219\u8868\u8fbe\u5f0f \u6765\u6740\u6b7b\u8fdb\u7a0b&#xff0c;\u6240\u6709\u8fdb\u7a0b\u540d\u5339\u914d\u4e0a\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u8fdb\u7a0b\u90fd\u4f1a\u88ab\u4e00\u8d77\u6740\u6b7b&#xff0c;\u56e0\u6b64\u53ef\u80fd\u4e00\u6b21\u6740\u591a\u4e2a\u3002<\/p>\n<p>pkill \u9ed8\u8ba4\u5339\u914d\u8fdb\u7a0b\u540d&#xff0c;\u5982\u679c\u60f3\u5339\u914d\u5b8c\u6574\u7684\u542f\u52a8\u547d\u4ee4&#xff0c;\u53ef\u4ee5\u4f7f\u7528 -f \u53c2\u6570&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>pkill -f &#034;python.*train.py&#034;<\/p>\n<p>\u540c\u6837&#xff0c;pkill \u9ed8\u8ba4\u53d1\u9001 SIGTERM \u5373\u8bf7\u6c42\u4e2d\u6b62\u8fdb\u7a0b&#xff0c;\u5982\u679c\u8fdb\u7a0b\u5df2\u7ecf\u5b8c\u5168\u5361\u6b7b\u4e0d\u54cd\u5e94&#xff0c;\u53ef\u4ee5\u53d1\u9001 SIGKILL \u6765\u5f3a\u5236\u4e2d\u6b62\u8fdb\u7a0b&#xff0c;\u4f7f\u7528 pkill -9 \u6b63\u5219\u8868\u8fbe\u5f0f<\/p>\n<p>#pkill\u6309\u8fdb\u7a0b\u540d\u5b57\u5339\u914d\u6279\u91cf\u6740\u8fdb\u7a0b<br \/>\npkill -f &#034;python train.py&#034;<br \/>\npkill -9 -f &#034;python train.py&#034; <\/p>\n<h4>\u78c1\u76d8\u76f8\u5173<\/h4>\n<p>&#xff08;1&#xff09;du&#xff08;disk usage&#xff09;&#xff1a;\u7edf\u8ba1\u76ee\u5f55 \/ \u6587\u4ef6\u5b9e\u9645\u5360\u7528\u78c1\u76d8\u5927\u5c0f<\/p>\n<p>-s \u53c2\u6570\u8868\u793a\u53ea\u663e\u793a\u6c47\u603b\u7ed3\u679c&#xff0c;\u4e0d\u6bcf\u884c\u5217\u51fa\u6240\u6709\u5bf9\u8c61\u7684\u5927\u5c0f&#xff0c;-h \u53c2\u6570\u8ba9\u5bb9\u91cf\u81ea\u52a8\u4f7f\u7528 KB\u3001MB\u3001GB \u7b49\u6613\u8bfb\u5355\u4f4d\u3002du -sh \u7684\u8c03\u7528\u65b9\u5f0f\u57fa\u672c\u4e0a\u662f\u6700\u5e38\u7528\u7684\u56fa\u5b9a\u642d\u914d&#xff1a;<\/p>\n<p># -s\u6c47\u603b&#xff0c;-h\u4eba\u7c7b\u53ef\u8bfb\u5355\u4f4dKB\/MB\/GB<br \/>\ndu -sh \/var\/log   # \u67e5\u770b\u4e00\u4e2a\u76ee\u5f55\u7684\u603b\u5927\u5c0f<br \/>\ndu -sh \/var\/log\/* # \u67e5\u770b\u4e00\u4e2a\u76ee\u5f55\u4e0b\u6240\u6709\u5bf9\u8c61\u7684\u5927\u5c0f<\/p>\n<p>&#xff08;2&#xff09;df&#xff1a;\u67e5\u770b\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u6302\u8f7d\u5206\u533a\u5269\u4f59\u7a7a\u95f4<\/p>\n<p>-h \u53c2\u6570\u8ba9\u5bb9\u91cf\u81ea\u52a8\u4f7f\u7528 KB\u3001MB\u3001GB \u7b49\u6613\u8bfb\u5355\u4f4d&#xff0c;\u56e0\u6b64\u6700\u5e38\u4f7f\u7528\u7684\u662f&#xff1a;<\/p>\n<p>df -h<\/p>\n<p>&#xff08;3&#xff09;lsblk&#xff1a;\u67e5\u770b\u673a\u5668\u5168\u90e8\u78c1\u76d8\u3001\u5206\u533a\u548c\u6302\u8f7d\u5173\u7cfb&#xff08;\u627e U \u76d8\u65b0\u786c\u76d8&#xff09;<\/p>\n<p>lsblk<\/p>\n<p>\u8f93\u51fa\u7c7b\u4f3c&#xff1a;<\/p>\n<p>NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS<\/p>\n<p>sda 8:0 0 500G 0 disk<\/p>\n<p>\u251c\u2500sda1 8:1 0 1G 0 part \/boot<\/p>\n<p>\u2514\u2500sda2 8:2 0 499G 0 part \/<\/p>\n<p>sdb 8:16 0 2T 0 disk<\/p>\n<p>\u2514\u2500sdb1 8:17 0 2T 0 part \/data<\/p>\n<p>\u793a\u4f8b&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203308-6add16045e6c9.png\" \/><\/p>\n<p>\u5176\u4e2d\u91cd\u8981\u7684\u5217\u6709&#xff1a;<\/p>\n<ul>\n<li>NAME \u2013 \u8bbe\u5907\u540d\u79f0<\/li>\n<li>SIZE \u2013 \u5bb9\u91cf<\/li>\n<li>TYPE \u2013 \u7c7b\u578b&#xff0c;\u4f8b\u5982 disk \u4e3a\u6574\u5757\u78c1\u76d8&#xff0c;part \u4e3a\u5206\u533a<\/li>\n<li>MOUNTPOINTS \u2013 \u6302\u8f7d\u4f4d\u7f6e<\/li>\n<\/ul>\n<p>&#xff08;4&#xff09;iotop \u5de5\u5177&#xff1a;\u67e5\u8be2\u78c1\u76d8 I\/O<\/p>\n<p>\u6709\u65f6\u5019\u78c1\u76d8\u7a7a\u95f4\u5e76\u6ca1\u6709\u6ee1&#xff0c;\u4f46\u7cfb\u7edf\u4ecd\u7136\u975e\u5e38\u5361&#xff0c;\u8fd9\u53ef\u80fd\u662f\u67d0\u4e2a\u7a0b\u5e8f\u6b63\u5728\u5927\u91cf\u8bfb\u5199\u78c1\u76d8\u3002\u6b64\u65f6\u53ef\u4ee5\u4f7f\u7528 iotop \u67e5\u770b\u5404\u8fdb\u7a0b\u7684\u78c1\u76d8\u8bfb\u5199\u60c5\u51b5\u3002<\/p>\n<p>\/\/\u5b89\u88c5<br \/>\nsudo apt install iotop<br \/>\n\/\/\u8fd0\u884c<br \/>\nsudo iotop<\/p>\n<p>\u5b83\u7684\u4f7f\u7528\u65b9\u5f0f\u548c top \u7c7b\u4f3c&#xff0c;\u4f1a\u5b9e\u65f6\u663e\u793a\u5404\u8fdb\u7a0b\u7684\u78c1\u76d8\u8bfb\u5199\u901f\u5ea6\u3002\u5176\u4e2d\u4e3b\u8981\u5173\u6ce8&#xff1a;<\/p>\n<ul>\n<li>DISK READ \u2013 \u78c1\u76d8\u8bfb\u53d6\u901f\u5ea6<\/li>\n<li>DISK WRITE \u2013 \u78c1\u76d8\u5199\u5165\u901f\u5ea6<\/li>\n<li>COMMAND \u2013 \u5bf9\u5e94\u7684\u7a0b\u5e8f<\/li>\n<\/ul>\n<p>\u6309\u65b9\u5411\u952e\u53ef\u4ee5\u5bfc\u822a&#xff0c;\u6309 q \u53ef\u4ee5\u9000\u51fa\u3002<\/p>\n<h4>\u7f51\u7edc\u72b6\u6001\u67e5\u770b<\/h4>\n<p>&#xff08;1&#xff09;ifconfig \u547d\u4ee4&#xff1a;\u67e5\u8be2\u7f51\u7edc\u63a5\u53e3<\/p>\n<p>ifconfig \u53ef\u4ee5\u67e5\u770b\u8ba1\u7b97\u673a\u7684\u7f51\u7edc\u63a5\u53e3\u3001IP \u5730\u5740\u4ee5\u53ca\u7f51\u7edc\u6d41\u91cf\u7b49\u4fe1\u606f\u3002<\/p>\n<p>#ifconfig\u67e5\u770b\u7f51\u5361ip&#xff08;\u65e7\u5de5\u5177&#xff09;<br \/>\nsudo apt install net-tools<br \/>\n#\u8fd0\u884c<br \/>\nifconfig<\/p>\n<p>\u793a\u4f8b&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203309-6add1605e0752.png\" \/><\/p>\n<p>\u73b0\u4ee3\u7cfb\u7edf\u66ff\u4ee3 ifconfig \u547d\u4ee4&#xff1a;ip addr<\/p>\n<p>\u8fd9\u91cc\u6700\u5e38\u5173\u6ce8\u7684\u662f&#xff1a;<\/p>\n<ul>\n<li>eth0 \u2013 \u7f51\u7edc\u63a5\u53e3\u540d\u79f0&#xff08;\u4e00\u822c\u7269\u7406\u7f51\u53e3\u4ee5 eth, ens, eno, enp \u5f00\u5934&#xff09;<\/li>\n<li>inet \u2013 IPv4 \u5730\u5740\u548c\u5b50\u7f51\u63a9\u7801<\/li>\n<li>inet6 \u2013 IPv6 \u5730\u5740\u548c\u524d\u7f00\u957f\u5ea6<\/li>\n<li>RX \u2013 \u63a5\u6536\u7684\u6570\u636e\u5305\u7d2f\u8ba1\u6570\u91cf\u548c\u7d2f\u8ba1\u5927\u5c0f<\/li>\n<li>TX \u2013 \u53d1\u9001\u7684\u6570\u636e\u5305\u7d2f\u8ba1\u6570\u91cf\u548c\u7d2f\u8ba1\u5927\u5c0f<\/li>\n<\/ul>\n<p>\u53e6\u5916&#xff0c;ifconfig \u662f\u6bd4\u8f83\u7ecf\u5178\u7684\u5de5\u5177&#xff0c;\u73b0\u5728\u8f83\u65b0\u7684 Linux \u7cfb\u7edf\u4e3b\u8981\u4f7f\u7528 ip \u547d\u4ee4\u4ee3\u66ff\u5b83&#xff0c;\u4f7f\u7528 ip addr \u547d\u4ee4\u7684\u6548\u679c\u548c ifconfig \u7c7b\u4f3c\u3002<\/p>\n<p>&#xff08;2&#xff09;iftop \u5de5\u5177&#xff1a;\u67e5\u8be2\u7f51\u7edc\u8fde\u63a5\u6d41\u91cf<\/p>\n<p>\u5982\u679c\u60f3\u77e5\u9053\u201c\u5230\u5e95\u662f\u54ea\u4e2a\u8fdc\u7a0b\u5730\u5740\u6b63\u5728\u5360\u7528\u7f51\u7edc\u201d&#xff0c;\u53ef\u4ee5\u4f7f\u7528 iftop\u3002<\/p>\n<p># \u5b89\u88c5<br \/>\nsudo pat install iftop -y<br \/>\n#\u8fd0\u884c<br \/>\nsudo iftop <\/p>\n<p>iftop \u4f1a\u5b9e\u65f6\u663e\u793a\u672c\u673a\u4e0e\u5176\u4ed6\u5730\u5740\u4e4b\u95f4\u7684\u7f51\u7edc\u8fde\u63a5\u4ee5\u53ca\u5bf9\u5e94\u6d41\u91cf&#xff0c;\u56e0\u6b64\u6bd4\u8f83\u9002\u5408\u6392\u67e5&#xff1a;<\/p>\n<ul>\n<li>\u54ea\u4e2a\u670d\u52a1\u5668\u6b63\u5728\u5927\u91cf\u4f20\u8f93\u6570\u636e<\/li>\n<li>\u5f53\u524d\u4e3b\u8981\u8fde\u63a5\u5230\u4e86\u54ea\u4e9b\u5730\u5740<\/li>\n<li>\u54ea\u6761\u7f51\u7edc\u8fde\u63a5\u5360\u7528\u4e86\u6700\u591a\u5e26\u5bbd<\/li>\n<\/ul>\n<p>\u5982\u679c\u8ba1\u7b97\u673a\u6709\u591a\u4e2a\u7f51\u5361&#xff0c;\u53ef\u4ee5\u6307\u5b9a\u7f51\u7edc\u63a5\u53e3&#xff1a;<\/p>\n<p>sudo iftop -i eth0 <\/p>\n<p>\u6309 q \u9000\u51fa\u3002<\/p>\n<p>&#xff08;3&#xff09;nload \u5de5\u5177&#xff1a;\u67e5\u8be2\u7f51\u5361\u603b\u6d41\u91cf<\/p>\n<p>\u5982\u679c\u5e76\u4e0d\u5173\u5fc3\u5177\u4f53\u662f\u54ea\u4e2a\u8fde\u63a5&#xff0c;\u53ea\u60f3\u770b\u770b\u5f53\u524d\u603b\u4e0b\u8f7d\u548c\u4e0a\u4f20\u901f\u5ea6&#xff0c;\u90a3\u4e48 nload \u4f1a\u66f4\u52a0\u76f4\u89c2\u3002<\/p>\n<p>#\u5b89\u88c5<br \/>\nsudo apt install nload -y<br \/>\n#\u8fd0\u884c<br \/>\nnload <\/p>\n<p>\u754c\u9762\u4e2d\u4f1a\u5206\u522b\u663e\u793a&#xff1a;<\/p>\n<p>Incoming<\/p>\n<p>\u5f53\u524d\u4e0b\u8f7d\u901f\u5ea6<\/p>\n<p>Outgoing<\/p>\n<p>\u5f53\u524d\u4e0a\u4f20\u901f\u5ea6<\/p>\n<p>\u5982\u679c\u8ba1\u7b97\u673a\u5b58\u5728\u591a\u4e2a\u7f51\u7edc\u63a5\u53e3&#xff0c;\u53ef\u4ee5\u4f7f\u7528 \u2190 \u548c \u2192 \u5207\u6362\u3002\u6309 q \u9000\u51fa\u3002<\/p>\n<hr \/>\n<h3>2.7 \u78c1\u76d8\u6302\u8f7d mount \/umount<\/h3>\n<h4>\u4ec0\u4e48\u662f\u6302\u8f7d&#xff1f;<\/h4>\n<p>\u5bf9\u4e8e Windows \u7528\u6237\u6765\u8bf4&#xff0c;\u6302\u8f7d\u662f\u5f88\u964c\u751f\u7684\u6982\u5ff5\u3002\u56e0\u4e3a Windows \u5982\u679c\u63a5\u5165\u4e86\u65b0\u78c1\u76d8&#xff0c;\u683c\u5f0f\u5316\u540e\u5c31\u76f4\u63a5\u663e\u793a\u4e3a\u65b0\u76d8\u7b26\u4e86&#xff08;\u4f8b\u5982 E:\\\\ \u76d8&#xff09;\u3002<\/p>\n<p>Linux \u6ca1\u6709 Windows \u76d8\u7b26\u6982\u5ff5&#xff1b;\u78c1\u76d8\u5fc5\u987b\u6302\u8f7d\u5230\u67d0\u4e2a\u76ee\u5f55\u8282\u70b9\u624d\u80fd\u8bbf\u95ee\u3002 \u684c\u9762\u7248 Ubuntu \u63d2\u5165 U \u76d8\u81ea\u52a8\u6302\u8f7d&#xff1b;\u670d\u52a1\u5668\u7248\u4e0d\u4f1a\u81ea\u52a8\u6302\u8f7d&#xff0c;\u9700\u8981\u624b\u52a8\u64cd\u4f5c\u3002<\/p>\n<p>\u770b\u5230\u4e0b\u56fe\u793a\u4f8b&#xff0c;\u5047\u5982\u4e00\u53f0\u8ba1\u7b97\u673a\u6709\u4e24\u5757\u78c1\u76d8\u5206\u522b\u4e3a A \u548c B&#xff0c;\u6211\u4eec\u53ef\u4ee5\u8ba9 A \u78c1\u76d8\u50a8\u5b58\u6839\u76ee\u5f55&#xff0c;\u79f0\u4e3a\u7cfb\u7edf\u76d8&#xff0c;\u53ef\u4ee5\u8ba9 B \u78c1\u76d8\u4ec5\u50a8\u5b58\u7528\u6237\u7684\u7528\u6237\u6587\u4ef6&#xff0c;\u6210\u4e3a\u7528\u6237\u76d8\u3002\u90a3\u4e48&#xff0c;\u5c31\u53ef\u4ee5\u5c06 B \u78c1\u76d8\u7684\u6587\u4ef6\u7cfb\u7edf\u6302\u8f7d\u5230 \/home \u76ee\u5f55\u4e0b&#xff0c;\u8fd9\u6837&#xff0c;\u6240\u6709\u50a8\u5b58\u5728 \/home \u76ee\u5f55\u91cc\u9762\u7684\u5185\u5bb9&#xff0c;\u5b9e\u9645\u5199\u5165\u7684\u78c1\u76d8\u662f B&#xff0c;\u800c\u5176\u4ed6\u7684\u76ee\u5f55\u5747\u5199\u5165\u78c1\u76d8 A\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203310-6add1606d3f13.png\" \/><\/p>\n<p>\u672c\u8282\u4e3b\u8981\u8bb2\u53ef\u79fb\u52a8\u8bbe\u5907&#xff08;\u4f8b\u5982U\u76d8\u3001\u79fb\u52a8\u786c\u76d8&#xff09;\u7684\u6302\u8f7d\u548c\u5378\u8f7d\u3002<\/p>\n<p>\u6302\u8f7d\u78c1\u76d8<\/p>\n<p>\u63d2\u5165\u8bbe\u5907\u540e&#xff0c;\u53ef\u4ee5\u5148\u4f7f\u7528\u524d\u9762\u4ecb\u7ecd\u8fc7\u7684 lsblk \u67e5\u770b&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>NAME\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SIZE TYPE\u00a0MOUNTPOINTS<\/p>\n<p>sda\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0500G disk<\/p>\n<p>\u2514\u2500sda1\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 500G part\u00a0 \/<\/p>\n<p>sdb\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a064G disk<\/p>\n<p>\u2514\u2500sdb1\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 64G part<\/p>\n<p>\u8fd9\u91cc \/dev\/sda1 \u5df2\u7ecf\u6302\u8f7d\u5230\u6839\u76ee\u5f55 \/&#xff0c;\u800c\u65b0\u63d2\u5165\u7684 \/dev\/sdb1 \u7684 MOUNTPOINTS \u4e3a\u7a7a&#xff0c;\u8bf4\u660e\u5b83\u8fd8\u6ca1\u6709\u6302\u8f7d\u3002<\/p>\n<p>\u6ce8\u610f&#xff0c;\u901a\u5e38\u9700\u8981\u6302\u8f7d\u7684\u662f\u78c1\u76d8\u4e2d\u7684\u5206\u533a&#xff0c;\u4f8b\u5982 \/dev\/sdb1&#xff0c;\u800c\u4e0d\u662f\u6574\u5757\u78c1\u76d8 \/dev\/sdb\u3002<\/p>\n<p>#1.\u5148lsblk\u786e\u8ba4\u8bbe\u5907&#xff0c;\u4f8b\u5982\u65b0U\u76d8\u5206\u533a \/dev\/sdb1<\/p>\n<p>#2.\u521b\u5efa\u6302\u8f7d\u70b9\u7a7a\u76ee\u5f55<br \/>\nsudo mkdir -p \/mnt\/usb<\/p>\n<p>#3.\u6302\u8f7d\u5206\u533a\u5230\u76ee\u5f55&#xff0c;\u4f7f\u7528mount<br \/>\nsudo mount \/dev\/sdb1 \/mnt\/usb<\/p>\n<p>#4.\u7528\u5b8c\u5378\u8f7d&#xff01;&#xff01;\u62d4\u51faU\u76d8\u524d\u5fc5\u987bumount&#xff0c;\u9632\u6b62\u6570\u636e\u635f\u574f<br \/>\n#\u6ce8\u610f\u547d\u4ee4\u662fumount&#xff0c;\u4e0d\u662funmount&#xff01;&#xff01;<br \/>\nsudo umount \/mnt\/usb<\/p>\n<p>\u8e29\u5751\u63d0\u793a&#xff1a;\u5378\u8f7d\u63d0\u793atarget is busy&#xff0c;\u8bf4\u660e\u6709\u7ec8\u7aef\u6216\u8005\u7a0b\u5e8f\u8fd8\u5728\u8fdb\u5165\u8fd9\u4e2a\u6302\u8f7d\u76ee\u5f55&#xff0c;\u5207\u5230\u522b\u7684\u76ee\u5f55\u518d\u5378\u8f7d\u3002<\/p>\n<hr \/>\n<h3>2.8 \u73af\u5883\u53d8\u91cf<\/h3>\n<p>\u5728 Linux \u7684\u5b89\u88c5\u6559\u7a0b\u3001\u8f6f\u4ef6\u914d\u7f6e\u548c\u5f00\u53d1\u73af\u5883\u4e2d&#xff0c;\u7ecf\u5e38\u53ef\u4ee5\u770b\u5230\u4e0b\u9762\u8fd9\u6837\u7684\u547d\u4ee4&#xff1a;<\/p>\n<p>export PATH&#061;&#034;\/opt\/myapp\/bin:$PATH&#034;<\/p>\n<p>export LD_LIBRARY_PATH&#061;&#034;\/opt\/myapp\/lib:$LD_LIBRARY_PATH&#034;<\/p>\n<p>export CUDA_VISIBLE_DEVICES&#061;0,1,2,3 <\/p>\n<p>\u8fd9\u4e9b\u547d\u4ee4\u90fd\u4e0e\u73af\u5883\u53d8\u91cf\u6709\u5173\u3002\u672c\u8282\u5c06\u7b80\u5355\u4ecb\u7ecd\u73af\u5883\u53d8\u91cf\u662f\u4ec0\u4e48&#xff0c;\u5e76\u91cd\u70b9\u4ecb\u7ecd\u4e24\u4e2a\u975e\u5e38\u5e38\u89c1\u7684\u7279\u6b8a\u73af\u5883\u53d8\u91cf&#xff1a;PATH \u548c LD_LIBRARY_PATH\u3002<\/p>\n<h4>export \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/h4>\n<p>\u666e\u901a Shell \u53d8\u91cf\u9ed8\u8ba4\u53ea\u5c5e\u4e8e\u5f53\u524d Shell\u3002\u4ece\u5f53\u524d Shell \u542f\u52a8\u5176\u4ed6\u7a0b\u5e8f\u65f6&#xff0c;\u8fd9\u4e9b\u7a0b\u5e8f\u5e76\u4e0d\u4f1a\u81ea\u52a8\u83b7\u5f97\u666e\u901a\u53d8\u91cf\u3002<\/p>\n<p>\u5982\u679c\u5e0c\u671b\u53d8\u91cf\u80fd\u591f\u4f20\u9012\u7ed9\u5f53\u524d Shell \u542f\u52a8\u7684\u7a0b\u5e8f&#xff0c;\u53ef\u4ee5\u4f7f\u7528 export \u5c06\u5176\u5bfc\u51fa\u4e3a\u73af\u5883\u53d8\u91cf&#xff1a;<\/p>\n<p>#\u5bfc\u51fa\u73af\u5883\u53d8\u91cf<br \/>\nexport MY_VAR&#061;&#034;hello world&#034;<\/p>\n<p>#\u67e5\u770b\u5168\u90e8\u73af\u5883\u53d8\u91cf<br \/>\nenv<\/p>\n<p>#\u4e34\u65f6\u53ea\u5bf9\u8fd9\u4e00\u6761\u547d\u4ee4\u751f\u6548&#xff0c;\u4e0d\u6539\u53d8\u5168\u5c40\u73af\u5883<br \/>\nCUDA_VISIBLE_DEVICES&#061;0 python train.py<\/p>\n<p>\u7b80\u5355\u7406\u89e3&#xff1a;<\/p>\n<ul>\n<li>\u666e\u901a\u53d8\u91cf&#xff1a;\u4e3b\u8981\u4f9b\u5f53\u524d Shell \u81ea\u5df1\u4f7f\u7528\u3002<\/li>\n<li>\u73af\u5883\u53d8\u91cf&#xff1a;\u9664\u4e86\u5f53\u524d Shell \u53ef\u4ee5\u4f7f\u7528&#xff0c;\u8fd8\u4f1a\u4f20\u9012\u7ed9\u5b83\u542f\u52a8\u7684\u5b50\u8fdb\u7a0b\u3002<\/li>\n<\/ul>\n<p>\u53ef\u4ee5\u4f7f\u7528 env \u67e5\u770b\u5f53\u524d\u73af\u5883\u4e2d\u7684\u6240\u6709\u73af\u5883\u53d8\u91cf<\/p>\n<p>\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u548c\u666e\u901a Shell \u53d8\u91cf\u7c7b\u4f3c&#xff0c;\u5728\u4e0a\u7bc7\u6587\u7ae0\u7684 1.7\u8282\u00a0\u5df2\u7ecf\u8bb2\u8fc7\u3002\u4e0d\u8fc7\u6709\u4e00\u4e2a\u7528\u6cd5\u9700\u8981\u6ce8\u610f&#xff0c;\u73af\u5883\u53d8\u91cf\u65e2\u53ef\u4ee5\u8bbe\u7f6e\u5230\u5f53\u524d Shell \u7684\u73af\u5883\u4e2d&#xff08;\u91cd\u542f Shell \u540e\u5931\u6548&#xff09;&#xff0c;\u5e76\u4f20\u9012\u7ed9\u4e4b\u540e\u542f\u52a8\u7684\u5b50\u8fdb\u7a0b&#xff0c;\u4e5f\u53ef\u4ee5\u4e34\u65f6\u4ec5\u7ed9\u67d0\u4e2a\u547d\u4ee4\u4f7f\u7528\u3002\u4e34\u65f6\u4f7f\u7528\u7684\u8bed\u6cd5\u4e3a&#xff1a;<\/p>\n<p>MY_ENV&#061;my-env-value\u00a0 \u8981\u8fd0\u884c\u7684\u547d\u4ee4<\/p>\n<p>\u4f8b\u5982\u5728 Python \u4eba\u5de5\u667a\u80fd\u8bad\u7ec3\u4e2d\u6781\u4e3a\u5e38\u89c1\u7684\u6307\u5b9a\u8ba1\u7b97\u5361\u7684\u7528\u6cd5&#xff0c;\u5c31\u662f\u4e34\u65f6\u8bbe\u5b9a\u7684\u73af\u5883\u53d8\u91cf&#xff1a;<\/p>\n<p>CUDA_VISIBLE_DEVICES&#061;0 python train.py <\/p>\n<h4>PATH&#xff08;\u6700\u91cd\u8981\u73af\u5883\u53d8\u91cf&#xff09;<\/h4>\n<p>PATH \u662f Linux \u4e2d\u6700\u91cd\u8981\u7684\u73af\u5883\u53d8\u91cf\u4e4b\u4e00&#xff0c;\u5b83\u51b3\u5b9a\u4e86 Shell \u53bb\u54ea\u4e9b\u76ee\u5f55\u5bfb\u627e\u547d\u4ee4\u3002<\/p>\n<p>\u4f7f\u7528 echo $PATH \u67e5\u770b\u5f53\u524d\u7684 PATH&#xff0c;\u5c06\u4f1a\u663e\u793a\u4e00\u4e2a\u4f7f\u7528\u5192\u53f7 : \u5206\u9694\u7684\u76ee\u5f55\u5217\u8868<\/p>\n<p>\u5982\u679c\u8981\u65b0\u589e\u4e00\u4e2a PATH \u76ee\u5f55&#xff0c;\u53ef\u4ee5\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u3002\u8bf7\u6ce8\u610f\u4e00\u5b9a\u4e0d\u8981\u8986\u76d6 PATH&#xff0c;\u800c\u662f\u7528\u5192\u53f7\u62fc\u63a5&#xff0c;\u56e0\u4e3a\u5982\u679c\u76f4\u63a5\u8986\u76d6 PATH \u4f1a\u5bfc\u81f4\u5176\u4ed6\u5927\u591a\u6570\u547d\u4ee4 Shell \u5168\u90e8\u90fd\u627e\u4e0d\u5230\u4e86\u3002<\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528 which \u67e5\u770b\u67d0\u4e2a\u547d\u4ee4\u5b9e\u9645\u5bf9\u5e94\u7684\u4f4d\u7f6e&#xff1a;which ls\u3002\u4e00\u822c\u6765\u8bf4\u4f1a\u8f93\u51fa&#xff1a;\/usr\/bin\/ls\u3002\u5373 Shell \u901a\u8fc7\u904d\u5386 PATH \u540e&#xff0c;\u5728 \/usr\/bin\/ls \u627e\u5230\u4e86 ls \u547d\u4ee4\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>#\u67e5\u770bPATH<br \/>\necho $PATH<\/p>\n<p>#\u5343\u4e07\u4e0d\u8981\u76f4\u63a5PATH&#061;xxx\u4f1a\u628a\u7cfb\u7edf\u547d\u4ee4\u5168\u90e8\u641e\u4e22&#xff01;&#xff01;&#xff01;\u8ffd\u52a0\u5199\u6cd5<br \/>\nexport PATH&#061;&#034;\/opt\/myapp\/bin:$PATH&#034;<\/p>\n<p>#which\u67e5\u770b\u547d\u4ee4\u5b9e\u9645\u7a0b\u5e8f\u4f4d\u7f6e<br \/>\nwhich ls<\/p>\n<p>\u53e6\u5916&#xff0c;PATH \u4e2d\u8d8a\u9760\u524d\u7684\u76ee\u5f55\u4f18\u5148\u7ea7\u8d8a\u9ad8\u3002\u5982\u679c\u4e0d\u540c\u76ee\u5f55\u4e2d\u5b58\u5728\u540c\u540d\u547d\u4ee4&#xff0c;Shell \u901a\u5e38\u4f1a\u4f18\u5148\u627e\u5230\u6392\u5728\u524d\u9762\u7684\u90a3\u4e2a\u3002<\/p>\n<h4>LD_LIBRARY_PATH \u52a8\u6001\u5e93\u8def\u5f84<\/h4>\n<p>\u5f88\u591a Linux \u7a0b\u5e8f\u5e76\u4e0d\u662f\u628a\u6240\u6709\u529f\u80fd\u90fd\u5305\u542b\u5728\u81ea\u5df1\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4e2d&#xff0c;\u800c\u662f\u8fd0\u884c\u65f6\u8fd8\u9700\u8981\u52a0\u8f7d\u4e00\u4e9b\u52a8\u6001\u94fe\u63a5\u5e93&#xff0c;\u5f53\u7a0b\u5e8f\u8fd0\u884c\u65f6\u9700\u8981\u627e\u5230\u8fd9\u4e9b\u5e93\u6587\u4ef6&#xff0c;\u800c\u8fd9\u7c7b\u52a8\u6001\u94fe\u63a5\u5e93\u6587\u4ef6\u901a\u5e38\u4ee5\u00a0.so \u7ed3\u5c3e\u52a8\u6001\u5e93&#xff0c;\u8fd9\u4e2a\u53d8\u91cf\u544a\u8bc9\u7cfb\u7edf\u53bb\u54ea\u91cc\u627e\u5e93\u6587\u4ef6&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>libexample.so<br \/>\nlibexample.so.1 <\/p>\n<p>\u5982\u679c\u8bf4\u4e0a\u4e00\u8282\u7684 PATH \u662f\u544a\u8bc9 Shell \u5230\u54ea\u4e9b\u76ee\u5f55\u5bfb\u627e\u53ef\u6267\u884c\u7a0b\u5e8f&#xff0c;\u90a3\u4e48 LD_LIBRARY_PATH \u5c31\u662f\u544a\u8bc9\u52a8\u6001\u94fe\u63a5\u5668\u5230\u54ea\u4e9b\u989d\u5916\u76ee\u5f55\u5bfb\u627e\u52a8\u6001\u94fe\u63a5\u5e93\u3002<\/p>\n<p>#\u6b63\u786e\u8bbe\u7f6e LD_LIBRARY_PATH \u540e&#xff0c;\u7a0b\u5e8f\u5c31\u53ef\u80fd\u6b63\u5e38\u627e\u5230\u5bf9\u5e94\u7684\u5e93\u3002<br \/>\nexport LD_LIBRARY_PATH&#061;&#034;\/opt\/myapp\/lib:$LD_LIBRARY_PATH&#034;<\/p>\n<p>#ldd\u67e5\u770b\u7a0b\u5e8f\u4f9d\u8d56\u54ea\u4e9b\u52a8\u6001\u5e93<br \/>\nldd \/usr\/bin\/ls<\/p>\n<p>\u4e0e PATH \u7c7b\u4f3c&#xff0c;LD_LIBRARY_PATH \u4e2d\u4e5f\u53ef\u4ee5\u5305\u542b\u591a\u4e2a\u76ee\u5f55&#xff0c;\u4f7f\u7528 : \u5206\u9694&#xff0c;\u5e76\u4e14\u9760\u524d\u7684\u76ee\u5f55\u5177\u6709\u66f4\u9ad8\u7684\u67e5\u627e\u4f18\u5148\u7ea7&#xff1a;<\/p>\n<p>export LD_LIBRARY_PATH&#061;&#034;\/path\/a:\/path\/b:$LD_LIBRARY_PATH&#034; <\/p>\n<hr \/>\n<h3>2.9 Bash \u914d\u7f6e\u6587\u4ef6&#xff5e;\/.bashrc source<\/h3>\n<p>\u5728\u524d\u9762\u7684\u5185\u5bb9\u4e2d&#xff0c;\u6211\u4eec\u5df2\u7ecf\u63a5\u89e6\u8fc7\u73af\u5883\u53d8\u91cf\u3001\u547d\u4ee4\u522b\u540d\u7b49\u914d\u7f6e\u3002\u4e0d\u8fc7\u5982\u679c\u53ea\u662f\u5728\u7ec8\u7aef\u76f4\u63a5\u5199 export\u3001alias&#xff0c;\u5173\u95ed\u7ec8\u7aef\u65f6\u5c31\u4f1a\u5168\u90e8\u5931\u6548&#xff1b;\u5199\u8fdb.bashrc\u6bcf\u6b21\u6253\u5f00\u7ec8\u7aef\u4f1a\u81ea\u52a8\u52a0\u8f7d\u3002<\/p>\n<p>.bashrc \u662f\u4ec0\u4e48&#xff1f;<\/p>\n<p>.bashrc\u4f4d\u4e8e\u5bb6\u76ee\u5f55&#xff0c;~\/.bashrc&#xff0c;\u5b83\u7684\u6587\u4ef6\u540d\u4ee5 . \u5f00\u5934&#xff0c;\u56e0\u6b64\u5b83\u5c5e\u4e8e\u9690\u85cf\u6587\u4ef6&#xff0c;\u53ef\u4ee5\u4f7f\u7528 ll \u522b\u540d\u6216\u8005 ls -al \u67e5\u770b\u5b83\u3002<\/p>\n<p>.bashrc \u672c\u8d28\u4e0a\u5c31\u662f\u4e00\u4efd Shell \u811a\u672c\u3002\u6bcf\u6b21\u542f\u52a8\u4ea4\u4e92\u5f0f Bash \u65f6&#xff0c;Bash \u901a\u5e38\u4f1a\u8bfb\u53d6\u5e76\u6267\u884c\u5176\u4e2d\u7684\u5185\u5bb9\u3002\u56e0\u6b64&#xff0c;\u5e73\u65f6\u53ef\u4ee5\u76f4\u63a5\u5728 Bash \u4e2d\u6267\u884c\u7684\u5f88\u591a\u914d\u7f6e\u547d\u4ee4&#xff0c;\u4e5f\u53ef\u4ee5\u5199\u8fdb .bashrc&#xff0c;\u8ba9\u5b83\u4eec\u4ee5\u540e\u81ea\u52a8\u6267\u884c\u3002<\/p>\n<p>#\u7f16\u8f91<br \/>\nnano ~\/.bashrc<\/p>\n<p>&#xff08;1&#xff09;\u957f\u671f\u4fdd\u5b58\u73af\u5883\u53d8\u91cf<\/p>\n<p>\u4f8b\u5982\u524d\u6587\u4ecb\u7ecd\u8fc7&#xff0c;\u5982\u679c\u5e0c\u671b\u5c06 \/opt\/myapp\/bin \u52a0\u5165 PATH&#xff0c;\u76f4\u63a5\u5728\u7ec8\u7aef\u4e2d\u6267\u884c\u65f6&#xff0c;\u53ea\u5bf9\u5f53\u524d Shell \u751f\u6548\u3002\u5982\u679c\u628a\u8fd9\u4e00\u884c\u52a0\u5165 ~\/.bashrc&#xff08;\u4f4d\u7f6e\u4e00\u822c\u4e0d\u91cd\u8981&#xff0c;\u52a0\u5230\u672b\u5c3e\u5373\u53ef&#xff09;&#xff1a;<\/p>\n<p>#\u73af\u5883\u53d8\u91cf<br \/>\nexport PATH&#061;&#034;\/opt\/myapp\/bin:$PATH&#034;<\/p>\n<p>\u8fd9\u6837\u6bcf\u6b21\u6253\u5f00Bash\u65f6\u90fd\u4f1a\u6267\u884c\u8fd9\u6761\u547d\u4ee4\u3002<\/p>\n<p>&#xff08;2&#xff09;\u8bbe\u7f6e\u547d\u4ee4\u522b\u540d<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u81ea\u5df1\u8bbe\u5b9a\u522b\u540d&#xff0c;\u7ed9\u4e00\u4e2a\u6bd4\u8f83\u957f\u7684\u547d\u4ee4\u53d6\u4e00\u4e2a\u66f4\u77ed\u7684\u540d\u5b57&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>#\u547d\u4ee4\u522b\u540d&#xff0c;\u7b80\u5316\u957f\u547d\u4ee4<br \/>\nalias ll&#061;&#039;ls -alF&#039;<br \/>\nalias cac&#061;&#039;conda activate&#039; <\/p>\n<p>\u5982\u679c\u76f4\u63a5\u5728Shell\u4e2d\u6267\u884c alias \u540c\u6837\u53ea\u662f\u4e34\u65f6\u751f\u6548&#xff0c;\u5199\u5165 .bashrc \u540e&#xff0c;\u6bcf\u6b21\u6253\u5f00Bash \u90fd\u4f1a\u81ea\u52a8\u521b\u5efa\u8fd9\u4e9b\u522b\u540d\u3002<\/p>\n<p>\u4e0d\u8fc7\u4e00\u822c\u5efa\u8bae .bashrc \u4e3b\u8981\u7528\u4e8e Shell \u914d\u7f6e&#xff0c;\u4e0d\u8981\u5728\u91cc\u9762\u52a0\u5165\u8017\u65f6\u5f88\u957f\u3001\u9700\u8981\u7528\u6237\u8f93\u5165\u6216\u8005\u4f1a\u4ea7\u751f\u5927\u91cf\u8f93\u51fa\u7684\u547d\u4ee4&#xff0c;\u5426\u5219\u6bcf\u6b21\u6253\u5f00 Shell \u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002<\/p>\n<p>&#xff08;3&#xff09;\u65b0\u52a0\u8f7d .bashrc<\/p>\n<p>\u4fee\u6539 .bashrc \u540e&#xff0c;\u65b0\u6253\u5f00\u7684 Bash \u901a\u5e38\u4f1a\u8bfb\u53d6\u65b0\u7684\u914d\u7f6e&#xff0c;\u56e0\u6b64\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u5173\u95ed\u5e76\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\u3002\u5982\u679c\u4e0d\u60f3\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef&#xff0c;\u4e5f\u53ef\u4ee5\u8ba9\u5f53\u524d Bash \u7acb\u5373\u91cd\u65b0\u6267\u884c .bashrc&#xff1a;<\/p>\n<p>#\u5b8c\u6574\u5f62\u5f0f<br \/>\nsource ~\/.bashrc<br \/>\n#\u7b80\u5199\u7b49\u540c<br \/>\n. ~\/.bashrc<\/p>\n<p>\u5c0f\u77e5\u8bc6&#xff1a;source venv\/bin\/activate\u672c\u8d28\u5c31\u662f\u6267\u884c\u811a\u672c\u4fee\u6539\u5f53\u524d shell \u73af\u5883\u3002<\/p>\n<hr \/>\n<h3>2.10 \u62fe\u9057\u8865\u7f3a<\/h3>\n<p>\u8865\u5145\u51e0\u4e2a\u975e\u5e38\u5b9e\u7528\u3001\u4f46\u5185\u5bb9\u8f83\u5c11\u7684\u547d\u4ee4\u3002<\/p>\n<h4>watch&#xff1a;\u5b9a\u65f6\u91cd\u590d\u6267\u884c\u547d\u4ee4<\/h4>\n<p>watch \u53ef\u4ee5\u6bcf\u9694\u4e00\u6bb5\u65f6\u95f4&#xff08;\u9ed8\u8ba4 2 \u79d2&#xff09;\u91cd\u590d\u6267\u884c\u67d0\u4e2a\u547d\u4ee4&#xff0c;\u5e76\u4e0d\u65ad\u5237\u65b0\u7ec8\u7aef\u4e2d\u7684\u663e\u793a\u7ed3\u679c&#xff0c;\u9700\u8981\u9000\u51fa\u65f6\u6309 Ctrl &#043; C\u3002\u793a\u4f8b\u5982\u4e0b&#xff1a;<\/p>\n<p>#\u6bcf2\u79d2\u5237\u65b0\u4e00\u6b21\u770bGPU\u72b6\u6001<br \/>\nwatch nvidia-smi<\/p>\n<p>#-n \u6307\u5b9a\u95f4\u9694\u79d2\u6570 du&#061;disk usage \u67e5\u770b\u78c1\u76d8\u5360\u7528  -s \u53ea\u8f93\u51fa\u603b\u548c<br \/>\n#\u6bcf\u9694\u4e00\u79d2\u67e5\u770b\u4e00\u6b21output\u76ee\u5f55\u6709\u591a\u5927<br \/>\nwatch -n 1 du -sh .\/output<\/p>\n<h4>tee&#xff1a;\u540c\u65f6\u8f93\u51fa\u5230\u7ec8\u7aef\u00a0&#043; \u4fdd\u5b58\u6587\u4ef6<\/h4>\n<p>&gt;\u00a0\u91cd\u5b9a\u5411\u53ea\u8f93\u51fa\u6587\u4ef6&#xff0c;\u5c4f\u5e55\u770b\u4e0d\u5230&#xff1b;tee \u4e24\u8005\u517c\u987e<\/p>\n<p>\u4e0d\u52a0 -a \u7684 tee \u662f\u8986\u76d6&#xff1a;\u5148\u6e05\u7a7a\u8fd9\u4e2a\u6587\u4ef6&#xff0c;\u518d\u5199\u5165\u65b0\u5185\u5bb9\u3002<\/p>\n<p>#\u8f93\u51fa\u4f1a\u76f4\u63a5\u8fdb\u5165\u6587\u4ef6&#xff0c;\u4e0d\u663e\u793a\u5728\u7ec8\u7aef<br \/>\nls &gt; files.txt<br \/>\n#\u8f93\u51fa\u5230\u7ec8\u7aef &#043; \u5c06\u5185\u5bb9\u4fdd\u5b58\u5230\u6587\u4ef6<br \/>\nls | tee file.txt<br \/>\n#-a\u8ffd\u52a0\u5199\u5165<br \/>\nls | tee -a file.txt<\/p>\n<h4>diff&#xff1a;\u6bd4\u8f83\u6587\u4ef6\u5dee\u5f02<\/h4>\n<p>diff \u53ef\u4ee5\u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u5dee\u5f02&#xff1a;<\/p>\n<p>#\u666e\u901a\u5bf9\u6bd4<br \/>\ndiff old.txt new.txt<\/p>\n<p>\u5982\u679c\u4e24\u4e2a\u6587\u4ef6\u5b8c\u5168\u76f8\u540c&#xff0c;\u901a\u5e38\u4e0d\u4f1a\u8f93\u51fa\u4efb\u4f55\u5185\u5bb9&#xff1b;\u5982\u679c\u5b58\u5728\u5dee\u5f02&#xff0c;\u5219\u4f1a\u663e\u793a\u53d1\u751f\u53d8\u5316\u7684\u4f4d\u7f6e\u548c\u5185\u5bb9\u3002<\/p>\n<p>\u66f4\u5e38\u89c1\u7684\u7edf\u4e00\u683c\u5f0f&#xff1a;<\/p>\n<p>#-u\u7edf\u4e00\u683c\u5f0f&#xff0c;\u53ef\u8bfb\u6027\u66f4\u9ad8&#xff0c;&#043;\u65b0\u589e&#xff0c;-\u5220\u9664<br \/>\ndiff -u old.txt new.txt<\/p>\n<p>\u8f93\u51fa\u4e2d&#xff1a;<\/p>\n<ul>\n<li>\u4ee5 &#8211; \u5f00\u5934\u7684\u5185\u5bb9\u8868\u793a\u65e7\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9<\/li>\n<li>\u4ee5 &#043; \u5f00\u5934\u7684\u5185\u5bb9\u8868\u793a\u65b0\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9<\/li>\n<\/ul>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>-Hello<\/p>\n<p>&#043;Hello World <\/p>\n<p>\u8868\u793a\u539f\u6765\u7684 Hello \u88ab\u4fee\u6539\u6210\u4e86 Hello World\u3002<\/p>\n<h4>uname \u67e5\u770b\u7cfb\u7edf\u5185\u6838\u4fe1\u606f<\/h4>\n<p>\u76f4\u63a5\u6267\u884c uname \u4e00\u822c\u4f1a\u8f93\u51fa Linux&#xff0c;\u5373\u5185\u6838\u540d\u79f0\u3002\u901a\u5e38\u6211\u4eec\u4f7f\u7528 -a \u53c2\u6570\u6253\u5370\u51fa\u5b8c\u6574\u4fe1\u606f&#xff0c;\u8fd9\u6837\u66f4\u5b9e\u7528&#xff0c;\u6267\u884c uname -a \u540e&#xff0c;\u6211\u624b\u4e0a\u7684 Ubuntu 24.04.4\u00a0LTS \u8f93\u51fa\u4ee5\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p>#\u6253\u5370\u5b8c\u6574\u5185\u6838\u786c\u4ef6\u4fe1\u606f<br \/>\nuname -a<\/p>\n<p>#\u67e5\u770bUbuntu\u53d1\u884c\u7248\u672c\u53f7<br \/>\ncat \/etc\/os-release<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203312-6add160882fec.png\" \/><\/p>\n<h4>\u7ec8\u7aef\u5bb9\u6613\u8bef\u89e6\u5feb\u6377\u952e\u6c47\u603b<\/h4>\n<p>\u5728\u7ec8\u7aef\u4e2d&#xff0c;\u6709\u4e9b\u5feb\u6377\u952e\u53ef\u80fd\u4f1a\u56e0\u4e3a\u8bef\u89e6\u5bfc\u81f4\u770b\u7740\u50cf\u201c\u5361\u4f4f\u201d \u6216\u4efb\u52a1\u7a81\u7136\u6682\u505c&#xff1a;<\/p>\n<table>\n<tr>\u5feb\u6377\u952e\u73b0\u8c61\u6062\u590d\u64cd\u4f5c<\/tr>\n<tbody>\n<tr>\n<td>Ctrl&#043;S<\/td>\n<td>\u7ec8\u7aef\u5361\u4f4f&#xff0c;\u6572\u5b57\u7b26\u65e0\u8f93\u51fa<\/td>\n<td>\u6309Ctrl&#043;Q\u6062\u590d\u8f93\u51fa<\/td>\n<\/tr>\n<tr>\n<td>Ctrl&#043;Z<\/td>\n<td>\u7a0b\u5e8f\u6682\u505c\u6302\u540e\u53f0<\/td>\n<td>\u8f93\u5165fg\u5207\u56de\u524d\u53f0<\/td>\n<\/tr>\n<tr>\n<td>Ctrl&#043;C<\/td>\n<td>\u4e2d\u65ad\u6b63\u5728\u8fd0\u884c\u7a0b\u5e8f&#xff0c;\u901a\u5e38\u65e0\u6cd5\u6062\u590d<\/td>\n<td>\u91cd\u65b0\u8fd0\u884c\u547d\u4ee4<\/td>\n<\/tr>\n<tr>\n<td>Ctrl&#043;D<\/td>\n<td>\u76f4\u63a5\u9000\u51fa\u5f53\u524d shell<\/td>\n<td>\u91cd\u65b0\u6253\u5f00 \/ \u91cd\u8fde ssh<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u7ed3\u8bed&#xff1a;<\/h3>\n<p>\u672c\u7ae0\u6ca1\u6709\u53bb\u6df1\u6316 inode \u539f\u7406\u3001\u8fdb\u7a0b\u4fe1\u53f7\u7684\u5185\u6838\u6e90\u7801&#xff0c;\u800c\u662f\u4f18\u5148\u89e3\u51b3\u6211\u4eec\u5e73\u65f6\u7528\u670d\u52a1\u5668\u6700\u5e38\u9047\u5230\u7684\u75db\u70b9&#xff1a;\u6587\u4ef6\u600e\u4e48\u9ad8\u901f\u4e0b\u8f7d\u3001\u5927\u6587\u4ef6\u600e\u4e48\u6253\u5305\u3001\u957f\u65f6\u95f4\u4efb\u52a1\u600e\u4e48\u9632\u6b62\u65ad\u8fde\u4e2d\u65ad\u3001\u78c1\u76d8\u6ee1\u4e86\u600e\u4e48\u6392\u67e5\u3001\u52a8\u6001\u5e93\u548c PATH \u73af\u5883\u53d8\u91cf\u8be5\u600e\u4e48\u914d\u7f6e\u3002\u8fd9\u4e9b\u5de5\u5177\u4e0d\u662f\u5b64\u7acb\u7684&#xff0c;\u5728\u5b9e\u9645\u5de5\u4f5c\u4e2d\u7ecf\u5e38\u7ec4\u5408\u4f7f\u7528&#xff1a;\u7528aria2c\u4e0b\u8f7d\u6570\u636e\u96c6&#xff0c;tar\u89e3\u538b&#xff0c;grep\u7b5b\u9009\u65e5\u5fd7&#xff0c;tmux\u6302\u8d77\u8bad\u7ec3&#xff0c;htop\u548cnload\u76d1\u63a7\u8d44\u6e90\u3002<\/p>\n<p>\u5b66\u4e60\u5efa\u8bae&#xff1a;\u4e0d\u8981\u6b7b\u8bb0\u786c\u80cc&#xff0c;\u6536\u85cf\u672c\u6587&#xff0c;\u9047\u5230\u5b9e\u9645\u4e1a\u52a1\u573a\u666f\u56de\u6765\u590d\u5236\u793a\u4f8b\u6572\u4e00\u904d\u3002\u00a0\u540e\u9762\u53ef\u4ee5\u81ea\u5df1\u5b66\u4e60\u7cfb\u7edf\u670d\u52a1 systemctl\u3001rsync \u540c\u6b65\u3001\u9632\u706b\u5899 ufw \u7b49\u8fdb\u9636\u5de5\u5177\u3002<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203312-6add1608f14c0.jpg\" \/><\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55<br \/>\n\u5f15\u8a00&#xff1a;<br \/>\n2.1 \u7f51\u7edc\u4e0b\u8f7d wget \/curl\/aria2c<br \/>\nwget&#xff08;\u6700\u7b80\u5355&#xff0c;\u9002\u5408\u666e\u901a\u4e0b\u8f7d&#xff09;<br \/>\ncurl&#xff08;\u901a\u7528 http \u5de5\u5177&#xff0c;\u4e0d\u4ec5\u80fd\u4e0b\u8f7d&#xff0c;\u8fd8\u80fd\u53d1\u7f51\u7edc\u8bf7\u6c42&#xff09;<br \/>\naria2c&#xff08;\u591a\u7ebf\u7a0b\u4e0b\u8f7d\u795e\u5668&#xff0c;\u5927\u6587\u4ef6\u5f3a\u70c8\u63a8\u8350&#xff09;<br \/>\n2.2 \u6253\u5305\u548c\u538b\u7f29 tar \/zip\/unzip \/7z<br \/>\ntar \u547d\u4ee4<br \/>\nzip \/unzip&amp;#x<\/p>\n","protected":false},"author":2,"featured_media":117631,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,44],"topic":[],"class_list":["post-117645","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","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>\u53ea\u5b66\u591f\u7528\u7684Linux\uff01\u96f6\u57fa\u7840\u6838\u5fc3\u77e5\u8bc6\u70b9\uff08\u4e0b\uff09 - \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\/117645.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u53ea\u5b66\u591f\u7528\u7684Linux\uff01\u96f6\u57fa\u7840\u6838\u5fc3\u77e5\u8bc6\u70b9\uff08\u4e0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 \u5f15\u8a00&#xff1a; 2.1 \u7f51\u7edc\u4e0b\u8f7d wget \/curl\/aria2c wget&#xff08;\u6700\u7b80\u5355&#xff0c;\u9002\u5408\u666e\u901a\u4e0b\u8f7d&#xff09; curl&#xff08;\u901a\u7528 http \u5de5\u5177&#xff0c;\u4e0d\u4ec5\u80fd\u4e0b\u8f7d&#xff0c;\u8fd8\u80fd\u53d1\u7f51\u7edc\u8bf7\u6c42&#xff09; aria2c&#xff08;\u591a\u7ebf\u7a0b\u4e0b\u8f7d\u795e\u5668&#xff0c;\u5927\u6587\u4ef6\u5f3a\u70c8\u63a8\u8350&#xff09; 2.2 \u6253\u5305\u548c\u538b\u7f29 tar \/zip\/unzip \/7z tar \u547d\u4ee4 zip \/unzip&amp;#x\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/117645.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-24T20:33:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203301-6add15fd6b2c1.jpg\" \/>\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=\"13 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117645.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/117645.html\",\"name\":\"\u53ea\u5b66\u591f\u7528\u7684Linux\uff01\u96f6\u57fa\u7840\u6838\u5fc3\u77e5\u8bc6\u70b9\uff08\u4e0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-24T20:33:14+00:00\",\"dateModified\":\"2026-10-24T20:33:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/117645.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/117645.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117645.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u53ea\u5b66\u591f\u7528\u7684Linux\uff01\u96f6\u57fa\u7840\u6838\u5fc3\u77e5\u8bc6\u70b9\uff08\u4e0b\uff09\"}]},{\"@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":"\u53ea\u5b66\u591f\u7528\u7684Linux\uff01\u96f6\u57fa\u7840\u6838\u5fc3\u77e5\u8bc6\u70b9\uff08\u4e0b\uff09 - \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\/117645.html","og_locale":"zh_CN","og_type":"article","og_title":"\u53ea\u5b66\u591f\u7528\u7684Linux\uff01\u96f6\u57fa\u7840\u6838\u5fc3\u77e5\u8bc6\u70b9\uff08\u4e0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u5f55 \u5f15\u8a00&#xff1a; 2.1 \u7f51\u7edc\u4e0b\u8f7d wget \/curl\/aria2c wget&#xff08;\u6700\u7b80\u5355&#xff0c;\u9002\u5408\u666e\u901a\u4e0b\u8f7d&#xff09; curl&#xff08;\u901a\u7528 http \u5de5\u5177&#xff0c;\u4e0d\u4ec5\u80fd\u4e0b\u8f7d&#xff0c;\u8fd8\u80fd\u53d1\u7f51\u7edc\u8bf7\u6c42&#xff09; aria2c&#xff08;\u591a\u7ebf\u7a0b\u4e0b\u8f7d\u795e\u5668&#xff0c;\u5927\u6587\u4ef6\u5f3a\u70c8\u63a8\u8350&#xff09; 2.2 \u6253\u5305\u548c\u538b\u7f29 tar \/zip\/unzip \/7z tar \u547d\u4ee4 zip \/unzip&amp;#x","og_url":"https:\/\/www.wsisp.com\/helps\/117645.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-24T20:33:14+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024203301-6add15fd6b2c1.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"13 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/117645.html","url":"https:\/\/www.wsisp.com\/helps\/117645.html","name":"\u53ea\u5b66\u591f\u7528\u7684Linux\uff01\u96f6\u57fa\u7840\u6838\u5fc3\u77e5\u8bc6\u70b9\uff08\u4e0b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-24T20:33:14+00:00","dateModified":"2026-10-24T20:33:14+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/117645.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/117645.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/117645.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u53ea\u5b66\u591f\u7528\u7684Linux\uff01\u96f6\u57fa\u7840\u6838\u5fc3\u77e5\u8bc6\u70b9\uff08\u4e0b\uff09"}]},{"@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\/117645","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=117645"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117645\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/117631"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=117645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=117645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=117645"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=117645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}