{"id":118865,"date":"2026-10-28T09:48:22","date_gmt":"2026-10-28T01:48:22","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/118865.html"},"modified":"2026-10-28T09:48:22","modified_gmt":"2026-10-28T01:48:22","slug":"%e4%bb%8e%e9%9b%b6%e6%8a%8a-ubuntu-%e6%91%b8%e7%86%9f%ef%bc%9a%e4%b8%80%e4%bb%bd%e5%86%99%e7%bb%99%e8%87%aa%e5%b7%b1%e7%9a%84-linux-%e5%91%bd%e4%bb%a4%e6%89%8b%e6%8a%84%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/118865.html","title":{"rendered":"\u4ece\u96f6\u628a Ubuntu \u6478\u719f\uff1a\u4e00\u4efd\u5199\u7ed9\u81ea\u5df1\u7684 Linux \u547d\u4ee4\u624b\u6284\u672c"},"content":{"rendered":"<p>\u4e0a\u4e2a\u6708\u5728\u4e00\u53f0\u65b0\u88c5\u7684 Ubuntu \u4e0a\u914d\u8bad\u7ec3\u73af\u5883&#xff0c;\u524d\u9762\u4e09\u5929\u5168\u8017\u5728\u57fa\u7840\u64cd\u4f5c\u4e0a&#xff1a;\u88c5\u5b8c\u7cfb\u7edf\u6ca1\u6709 root \u5bc6\u7801\u3001apt \u88c5\u5b8c\u547d\u4ee4\u8fd8\u662f\u627e\u4e0d\u5230\u3001\u811a\u672c\u4e22\u8fdb\u5b9a\u65f6\u4efb\u52a1\u4e00\u58f0\u4e0d\u54cd\u3002\u663e\u5361\u9a71\u52a8\u53cd\u5012\u662f\u6700\u987a\u7684\u4e00\u6b65\u3002\u8fd9\u7bc7\u628a\u90a3\u6bb5\u6572\u8fc7\u7684\u547d\u4ee4\u548c\u67e5\u51fa\u6765\u7684\u539f\u56e0\u8bb0\u4e00\u904d&#xff0c;\u7ed9\u540c\u6837\u521a\u4e0a\u624b Ubuntu \u7684\u4eba\u770b\u3002<\/p>\n<h3>\u4e00\u3001Linux \u8ddf Windows \u4e0d\u4e00\u6837\u7684\u5730\u65b9<\/h3>\n<p>\u6211\u4e00\u5f00\u59cb\u62ff Windows \u7684\u4e60\u60ef\u5957 Linux&#xff0c;\u5904\u5904\u522b\u626d\u3002\u540e\u6765\u53d1\u73b0\u5dee\u522b\u5c31\u4e09\u6761\u3002<\/p>\n<p>Linux \u91cc\u4e00\u5207\u7686\u6587\u4ef6\u3002\u786c\u76d8\u3001\u7f51\u5361\u3001\u8fdb\u7a0b\u4fe1\u606f\u90fd\u662f\u6587\u4ef6&#xff0c;\u80fd\u7528\u540c\u4e00\u79cd\u65b9\u5f0f\u8bfb\u3002\u8fd9\u4e5f\u89e3\u91ca\u4e86 \/dev \u548c \/proc \u4e3a\u4ec0\u4e48\u957f\u5f97\u5947\u602a&#xff1a;\u5b83\u4eec\u4e0d\u662f\u76ee\u5f55&#xff0c;\u662f\u8bbe\u5907\u548c\u5185\u6838\u72b6\u6001\u4ee5\u76ee\u5f55\u7684\u5f62\u5f0f\u9732\u51fa\u6765\u3002<\/p>\n<p>\u6ca1\u6709\u76d8\u7b26&#xff0c;\u53ea\u6709\u4e00\u68f5\u6811\u3002\u6240\u6709\u4e1c\u897f\u4ece \/ \u5f00\u59cb\u5f80\u4e0b\u6302&#xff0c;\u63d2\u4e00\u5757\u786c\u76d8\u4e5f\u662f\u6302\u5230\u6811\u4e0a\u7684\u67d0\u4e2a\u70b9&#xff0c;\u800c\u4e0d\u662f\u591a\u51fa\u4e00\u4e2a E \u76d8\u3002<\/p>\n<p>\u9ed8\u8ba4\u4e0d\u662f\u7ba1\u7406\u5458\u3002Windows \u88c5\u5b8c\u7cfb\u7edf\u4f60\u5c31\u662f\u7ba1\u7406\u5458&#xff0c;Linux \u4e0a\u4f60\u53ea\u662f\u4e2a\u666e\u901a\u7528\u6237&#xff0c;\u6539\u7cfb\u7edf\u7ea7\u7684\u4e1c\u897f\u8981\u663e\u5f0f\u63d0\u6743\u3002\u591a\u4e00\u6b65\u9ebb\u70e6&#xff0c;\u6362\u6765\u624b\u6ed1\u65f6\u6709\u4e2a\u5239\u8f66\u3002<\/p>\n<h3>\u4e8c\u3001\u76ee\u5f55\u7ed3\u6784<\/h3>\n<p>\u521a\u4e0a\u624b\u6700\u5bb9\u6613\u72af\u7684\u9519\u662f\u88c5\u5b8c\u8f6f\u4ef6\u627e\u4e0d\u5230\u5b83\u88c5\u5728\u54ea\u4e86\u3002\u4e0b\u9762\u8fd9\u4e9b\u8bb0\u4f4f\u5c31\u591f\u7528&#xff0c;\u5176\u4f59\u78b0\u5230\u518d\u67e5\u3002<\/p>\n<table border=\"1\" cellpadding=\"6\" cellspacing=\"0\">\n<tbody>\n<tr>\u76ee\u5f55\u653e\u4ec0\u4e48\u6211\u4ec0\u4e48\u65f6\u5019\u4f1a\u8fdb<\/tr>\n<tr>\n<td>\/etc<\/td>\n<td>\u7cfb\u7edf\u548c\u8f6f\u4ef6\u7684\u914d\u7f6e\u6587\u4ef6<\/td>\n<td>\u6539\u914d\u7f6e\u3001\u6362\u8f6f\u4ef6\u6e90\u3001\u6539\u4e3b\u673a\u540d<\/td>\n<\/tr>\n<tr>\n<td>\/home<\/td>\n<td>\u666e\u901a\u7528\u6237\u7684\u5bb6\u76ee\u5f55<\/td>\n<td>\u767b\u5f55\u540e\u9ed8\u8ba4\u5c31\u5728\u8fd9<\/td>\n<\/tr>\n<tr>\n<td>\/root<\/td>\n<td>root \u7528\u6237\u7684\u5bb6\u76ee\u5f55<\/td>\n<td>\u5207\u5230 root \u624d\u8fdb\u5f97\u53bb<\/td>\n<\/tr>\n<tr>\n<td>\/usr<\/td>\n<td>\u7528\u6237\u7ea7\u5e94\u7528\u548c\u6587\u4ef6&#xff0c;\u7c7b\u4f3c Program Files<\/td>\n<td>\u81ea\u5df1\u88c5\u7684\u5e94\u7528\u591a\u534a\u5728\u8fd9<\/td>\n<\/tr>\n<tr>\n<td>\/opt<\/td>\n<td>\u7b2c\u4e09\u65b9\u7684\u3001\u53ef\u9009\u7684\u5927\u578b\u8f6f\u4ef6<\/td>\n<td>Anaconda \u8fd9\u7c7b\u6211\u4e60\u60ef\u653e\u8fd9<\/td>\n<\/tr>\n<tr>\n<td>\/var<\/td>\n<td>\u7ecf\u5e38\u53d8\u7684\u6570\u636e&#xff0c;\u65e5\u5fd7\u662f\u5927\u5934<\/td>\n<td>\/var\/log \u662f\u67e5\u95ee\u9898\u7684\u7b2c\u4e00\u7ad9<\/td>\n<\/tr>\n<tr>\n<td>\/tmp<\/td>\n<td>\u4e34\u65f6\u6587\u4ef6&#xff0c;\u8fc7\u4e00\u9635\u81ea\u52a8\u6e05<\/td>\n<td>\u8bd5\u9a8c\u811a\u672c\u4e22\u8fd9&#xff0c;\u91cd\u542f\u53ef\u80fd\u5c31\u6ca1\u4e86<\/td>\n<\/tr>\n<tr>\n<td>\/dev<\/td>\n<td>\u8bbe\u5907\u6587\u4ef6<\/td>\n<td>\u770b\u78c1\u76d8\u3001\u770b\u7ec8\u7aef<\/td>\n<\/tr>\n<tr>\n<td>\/proc<\/td>\n<td>\u5185\u6838\u548c\u8fdb\u7a0b\u7684\u865a\u62df\u6620\u5c04<\/td>\n<td>\u53ea\u8bfb&#xff0c;\u7528\u6765\u53d6\u7cfb\u7edf\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>\/mnt\u3001\/media<\/td>\n<td>\u6302\u8f7d\u70b9<\/td>\n<td>\u63d2 U \u76d8\u3001\u6302\u6570\u636e\u76d8<\/td>\n<\/tr>\n<tr>\n<td>\/boot<\/td>\n<td>\u542f\u52a8\u7528\u7684\u6838\u5fc3\u6587\u4ef6<\/td>\n<td>\u81ea\u5df1\u7684\u4e1c\u897f\u522b\u5f80\u8fd9\u653e<\/td>\n<\/tr>\n<tr>\n<td>\/lib<\/td>\n<td>\u6700\u57fa\u672c\u7684\u52a8\u6001\u5e93&#xff0c;\u7c7b\u4f3c Windows \u7684 DLL<\/td>\n<td>\u57fa\u672c\u4e0d\u624b\u52a8\u6539<\/td>\n<\/tr>\n<tr>\n<td>\/bin\u3001\/sbin<\/td>\n<td>\u5e38\u7528\u547d\u4ee4\u548c\u7cfb\u7edf\u7ba1\u7406\u547d\u4ee4<\/td>\n<td>\u5176\u5b9e\u662f \/usr\/bin\u3001\/usr\/sbin \u7684\u8f6f\u94fe\u63a5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6211\u627e\u4e1c\u897f\u7684\u987a\u5e8f\u662f&#xff1a;\u914d\u7f6e\u53bb \/etc&#xff0c;\u65e5\u5fd7\u53bb \/var\/log&#xff0c;\u81ea\u5df1\u7684\u4e1c\u897f\u5728 \/home&#xff0c;\u8f6f\u4ef6\u88c5\u5728 \/opt \u6216\u8005 \/usr\u3002\u6309\u8fd9\u4e2a\u60f3&#xff0c;\u516b\u6210\u80fd\u731c\u5bf9\u4f4d\u7f6e\u3002<\/p>\n<h3>\u4e09\u3001\u8fdc\u7a0b\u767b\u5f55<\/h3>\n<p>\u516c\u53f8\u7684\u673a\u5668\u548c\u4e91\u4e3b\u673a\u90fd\u4e0d\u4f1a\u8ba9\u4f60\u5750\u5230\u8ddf\u524d\u53bb&#xff0c;\u5168\u9760\u8fdc\u7a0b\u3002\u5e38\u89c1\u7684\u662f Xshell\u3001SecureCRT\u3001FinalShell&#xff0c;\u914d Xftp \u4f20\u6587\u4ef6\u3002Ubuntu \u4e0a\u88c5\u4e86 SSH \u670d\u52a1\u4e4b\u540e\u4e00\u6761\u547d\u4ee4\u5c31\u8fdb\u53bb\u3002<\/p>\n<p>ssh \u7528\u6237\u540d&#064;\u670d\u52a1\u5668IP<\/p>\n<p>\u6211\u7528 Xshell \u4f1a\u540c\u65f6\u5f00\u51e0\u4e2a\u6807\u7b7e\u9875&#xff0c;\u4e00\u4e2a\u6302\u65e5\u5fd7\u3001\u4e00\u4e2a\u6539\u6587\u4ef6\u3001\u4e00\u4e2a\u8dd1\u547d\u4ee4&#xff0c;\u6bd4\u5728\u540c\u4e00\u4e2a\u7a97\u53e3\u91cc\u53cd\u590d cd \u7701\u4e8b\u3002\u4f20\u6587\u4ef6\u4e00\u822c\u7528 scp \u6216\u8005 Xftp \u62d6&#xff0c;\u8def\u5f84\u4e0d\u5bb9\u6613\u6572\u9519\u3002<\/p>\n<h3>\u56db\u3001\u7528 apt \u88c5\u4e1c\u897f<\/h3>\n<p>apt \u662f Debian \u7cfb&#xff08;Ubuntu \u5c5e\u4e8e\u8fd9\u4e00\u652f&#xff09;\u7684\u5305\u7ba1\u7406\u5de5\u5177&#xff0c;\u4e0b\u8f7d\u3001\u89e3\u4f9d\u8d56\u3001\u5b89\u88c5\u4e00\u6761\u9f99\u3002\u65e5\u5e38\u5c31\u7528\u8fd9\u51e0\u6761\u3002<\/p>\n<p>sudo apt update                # \u62c9\u65b0&#034;\u6709\u54ea\u4e9b\u5305\u3001\u4ec0\u4e48\u7248\u672c&#034;\u7684\u6e05\u5355<br \/>\nsudo apt install net-tools     # \u88c5\u5305&#xff0c;\u52a0 -y \u8df3\u8fc7\u786e\u8ba4<br \/>\nsudo apt remove net-tools      # \u5378\u8f7d&#xff0c;\u4fdd\u7559\u914d\u7f6e<br \/>\nsudo apt search net-tools      # \u641c\u5305<br \/>\nsudo apt show net-tools        # \u770b\u5305\u8be6\u60c5<\/p>\n<p>\u6709\u4e24\u5904\u6211\u4e00\u5f00\u59cb\u5c31\u7406\u89e3\u9519\u4e86\u3002apt update \u53ea\u662f\u628a\u6e05\u5355\u62c9\u65b0&#xff0c;\u4e0d\u52a8\u5df2\u7ecf\u88c5\u597d\u7684\u8f6f\u4ef6&#xff1b;\u8981\u5347\u7ea7\u5f97\u7528 apt upgrade&#xff0c;\u4e24\u4e2a\u547d\u4ee4\u3002\u7b2c\u4e00\u6b21\u88c5\u73af\u5883\u65f6\u6211\u62ff update \u5f53\u5347\u7ea7&#xff0c;\u767d\u7b49\u534a\u5929\u3002<\/p>\n<p>\u53e6\u5916\u5982\u679c ifconfig \u63d0\u793a command not found&#xff0c;\u4e0d\u662f\u547d\u4ee4\u88ab\u5220\u4e86&#xff0c;\u662f\u65b0\u7248 Ubuntu \u9ed8\u8ba4\u4e0d\u5e26 net-tools&#xff0c;\u88c5\u4e00\u4e0b\u5c31\u6709\u3002\u8fd9\u4e2a\u6211\u81f3\u5c11\u5e2e\u4e09\u4e2a\u4eba\u67e5\u8fc7\u3002<\/p>\n<p>remove \u548c purge \u4e5f\u4e0d\u4e00\u6837&#xff1a;remove \u4f1a\u7559\u4e0b\u914d\u7f6e\u6587\u4ef6&#xff0c;purge \u8fde\u914d\u7f6e\u4e00\u8d77\u5220\u3002\u8981\u5f7b\u5e95\u91cd\u88c5\u67d0\u4e2a\u670d\u52a1&#xff0c;\u53ea remove \u6709\u65f6\u4f1a\u5e26\u7740\u65e7\u914d\u7f6e\u8d77\u6765&#xff0c;\u52a0\u4e0a purge \u624d\u5e72\u51c0\u3002<\/p>\n<h3>\u4e94\u3001\u547d\u4ee4\u5fd8\u4e86\u600e\u4e48\u67e5<\/h3>\n<p>\u547d\u4ee4\u8bb0\u4e0d\u4f4f\u5f88\u6b63\u5e38&#xff0c;\u4f1a\u67e5\u5c31\u884c\u3002man \u67e5\u624b\u518c&#xff0c;\u624b\u518c\u6309\u7ae0\u8282\u5206&#xff1a;\u7b2c 1 \u8282\u662f\u7528\u6237\u547d\u4ee4&#xff0c;\u7b2c 2 \u8282\u662f\u7cfb\u7edf\u8c03\u7528&#xff0c;\u7b2c 3 \u8282\u662f\u5e93\u51fd\u6570&#xff0c;\u7b2c 7 \u8282\u662f\u6742\u9879\u548c\u89c4\u8303\u3002\u540c\u540d\u7684\u4e1c\u897f\u53ef\u80fd\u6563\u5728\u4e0d\u540c\u7ae0\u8282\u3002<\/p>\n<p>man ls          # \u67e5 ls<br \/>\nman 2 write     # \u67e5\u7b2c 2 \u8282\u7684 write&#xff1b;man write \u67e5\u7684\u662f\u7b2c 1 \u8282\u7684\u7528\u6237\u547d\u4ee4<br \/>\nman -k \u5173\u952e\u8bcd    # \u6309\u5173\u952e\u5b57\u627e\u76f8\u5173\u624b\u518c<\/p>\n<p>\u5982\u679c\u63d0\u793a&#034;\u5728\u7b2c 2 \u8282\u4e2d\u6ca1\u6709\u5173\u4e8e write \u7684\u624b\u518c\u6761\u76ee&#034;&#xff0c;\u4e0d\u662f\u6572\u9519\u4e86&#xff0c;\u662f\u624b\u518c\u9875\u5305\u4e0d\u5168&#xff0c;\u88c5\u4e00\u4e0b\u5c31\u597d\u3002<\/p>\n<p>sudo apt install manpages manpages-dev<\/p>\n<p>\u8fd8\u6709\u4e00\u7c7b\u662f shell \u81ea\u5e26\u7684\u547d\u4ee4&#xff0c;\u6bd4\u5982 cd\u3001echo&#xff0c;\u5b83\u4eec\u6ca1\u6709\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;\u4e5f\u5c31\u6ca1\u6709\u624b\u518c\u9875&#xff0c;\u5f97\u7528 help \u67e5\u3002<\/p>\n<p>help        # \u5217\u51fa\u6240\u6709\u5185\u5efa\u547d\u4ee4<br \/>\nhelp cd     # \u67e5 cd<\/p>\n<p>\u51e0\u4e2a\u5feb\u6377\u952e\u503c\u5f97\u65e9\u70b9\u517b\u6210\u808c\u8089\u8bb0\u5fc6&#xff1a;Ctrl&#043;L \u6e05\u5c4f&#xff0c;Ctrl&#043;C \u4e2d\u65ad\u5f53\u524d\u8fdb\u7a0b&#xff0c;Ctrl&#043;U \u628a\u6572\u4e86\u4e00\u534a\u7684\u547d\u4ee4\u6574\u884c\u5220\u6389&#xff0c;Tab \u8865\u5168\u8def\u5f84&#xff0c;\u4e0a\u4e0b\u65b9\u5411\u952e\u7ffb\u5386\u53f2\u3002Tab \u7528\u5f97\u6700\u591a&#xff0c;\u8def\u5f84\u6572\u4e00\u534a\u6309\u4e00\u4e0b&#xff0c;\u8865\u4e0d\u4e0a\u8bf4\u660e\u524d\u9762\u54ea\u91cc\u9519\u4e86&#xff0c;\u7b49\u4e8e\u514d\u8d39\u67e5\u4e00\u6b21\u9519\u3002<\/p>\n<h3>\u516d\u3001\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u65e5\u5e38\u64cd\u4f5c<\/h3>\n<h4>\u770b\u81ea\u5df1\u5728\u54ea<\/h4>\n<p>pwd        # \u5f53\u524d\u76ee\u5f55\u7684\u7edd\u5bf9\u8def\u5f84<br \/>\nls         # \u5217\u76ee\u5f55<br \/>\nls -a      # \u8fde\u9690\u85cf\u6587\u4ef6\u4e00\u8d77\u5217&#xff0c;. \u5f00\u5934\u7684\u5c31\u662f\u9690\u85cf\u6587\u4ef6<br \/>\nls -l      # \u957f\u683c\u5f0f&#xff1a;\u6743\u9650\u3001\u5c5e\u4e3b\u3001\u5c5e\u7ec4\u3001\u5927\u5c0f\u3001\u65f6\u95f4\u3001\u540d\u79f0<br \/>\nls -lh     # \u5927\u5c0f\u6362\u6210 K\/M\/G&#xff0c;\u770b\u7740\u8212\u670d<br \/>\nls -R      # \u9012\u5f52\u5f80\u4e0b\u5217<\/p>\n<p>Ubuntu \u4e0a ll \u662f ls -al \u7684\u522b\u540d&#xff0c;\u6211\u5e73\u65f6\u57fa\u672c\u53ea\u7528 ll \u548c ls -lh\u3002\u957f\u683c\u5f0f\u90a3\u4e00\u884c\u4ece\u5de6\u5f80\u53f3\u770b&#xff1a;\u6587\u4ef6\u7c7b\u578b\u548c\u6743\u9650\u3001\u94fe\u63a5\u6570\u3001\u5c5e\u4e3b\u3001\u5c5e\u7ec4\u3001\u5927\u5c0f&#xff08;\u5b57\u8282&#xff09;\u3001\u6700\u540e\u4fee\u6539\u65f6\u95f4\u3001\u540d\u5b57\u3002<\/p>\n<h4>\u6362\u76ee\u5f55<\/h4>\n<p>cd \/bin       # \u7edd\u5bf9\u8def\u5f84<br \/>\ncd \u516c\u5171\u7684\/     # \u76f8\u5bf9\u8def\u5f84<br \/>\ncd            # \u6216 cd ~&#xff0c;\u56de\u5bb6\u76ee\u5f55<br \/>\ncd &#8211;          # \u56de\u4e0a\u4e00\u6b21\u5f85\u7684\u76ee\u5f55&#xff0c;\u4e24\u4e2a\u76ee\u5f55\u6765\u56de\u8df3\u5f88\u7701\u4e8b<br \/>\ncd ..         # \u4e0a\u4e00\u7ea7<br \/>\ncd -P \u8f6f\u94fe\u63a5   # \u8fdb\u8f6f\u94fe\u63a5\u6307\u5411\u7684\u771f\u5b9e\u8def\u5f84<\/p>\n<h4>\u5efa\u3001\u5220\u3001\u590d\u5236\u3001\u79fb\u52a8<\/h4>\n<p>mkdir test               # \u5efa\u76ee\u5f55<br \/>\nmkdir -p test\/b\/bb\/bbb   # \u4e00\u6b21\u5efa\u591a\u5c42&#xff0c;\u7236\u76ee\u5f55\u4e0d\u5b58\u5728\u4e5f\u4e0d\u62a5\u9519<br \/>\ntouch test\/a\/note.txt    # \u5efa\u7a7a\u6587\u4ef6&#xff0c;\u4e5f\u53ef\u4ee5\u7528\u6765\u66f4\u65b0\u65f6\u95f4\u6233<br \/>\ncp note.txt test\/b\/      # \u590d\u5236\u6587\u4ef6<br \/>\ncp -r test\/b\/ .\/         # \u590d\u5236\u76ee\u5f55\u5f97\u52a0 -r<br \/>\nmv old.txt new.txt       # \u91cd\u547d\u540d<br \/>\nmv new.txt .\/            # \u79fb\u52a8<br \/>\nrm b\/note.txt            # \u5220\u6587\u4ef6<br \/>\nrm -r b\/                 # \u9012\u5f52\u5220\u76ee\u5f55<br \/>\nrm -rf b\/                # \u5f3a\u5236\u9012\u5f52\u5220&#xff0c;\u614e\u7528<\/p>\n<p>rm \u6ca1\u6709\u56de\u6536\u7ad9&#xff0c;\u5220\u6389\u57fa\u672c\u627e\u4e0d\u56de\u6765\u3002\u6211\u73b0\u5728\u7684\u4e60\u60ef\u662f\u5220\u76ee\u5f55\u4e4b\u524d\u5148 ls \u770b\u4e00\u773c&#xff0c;\u8def\u5f84\u5199\u5168&#xff0c;\u4e0d\u5728\u6839\u76ee\u5f55\u5e95\u4e0b\u968f\u624b\u7528 -rf\u3002\u771f\u8981\u505a\u5371\u9669\u64cd\u4f5c&#xff0c;\u5148\u5199\u8fdb\u811a\u672c\u8bfb\u4e00\u904d\u518d\u8dd1&#xff0c;\u6bd4\u5728\u547d\u4ee4\u884c\u4e0a\u51b2\u52a8\u56de\u8f66\u5f3a\u3002<\/p>\n<h4>\u770b\u6587\u4ef6\u5185\u5bb9<\/h4>\n<p>cat -n \/etc\/passwd   # \u5c0f\u6587\u4ef6\u7528\u5b83&#xff0c;-n \u5e26\u884c\u53f7<br \/>\ntail -n 2 \u6587\u4ef6        # \u6700\u540e 2 \u884c&#xff0c;\u9ed8\u8ba4 10 \u884c<br \/>\ntail -F \u65e5\u5fd7\u6587\u4ef6      # \u5b9e\u65f6\u663e\u793a\u65b0\u8ffd\u52a0\u7684\u5185\u5bb9<\/p>\n<p>tail -F \u6211\u51e0\u4e4e\u6bcf\u5929\u5728\u7528&#xff0c;\u6ce8\u610f\u662f\u5927\u5199 F\u3002\u5b83\u8ddf -f \u7684\u533a\u522b\u662f\u6587\u4ef6\u88ab\u8f6e\u8f6c\u3001\u91cd\u547d\u540d\u4e4b\u540e\u8fd8\u80fd\u63a5\u7740\u8ddf&#xff0c;-f \u5c31\u65ad\u5728\u90a3\u513f\u4e86\u3002\u770b\u65e5\u5fd7\u65f6\u8fd9\u4e2a\u533a\u522b\u5f88\u8981\u547d\u3002<\/p>\n<h4>echo \u548c\u91cd\u5b9a\u5411<\/h4>\n<p>echo &#034;hello world&#034;<br \/>\necho -e &#034;hello world&#034;     # \u52a0 -e \u624d\u4f1a\u89e3\u91ca\u53cd\u659c\u7ebf\u8f6c\u4e49<br \/>\nls -l &gt; note.txt           # \u8986\u76d6\u5199\u5165<br \/>\nls -l &gt;&gt; note.txt          # \u8ffd\u52a0\u5199\u5165<br \/>\necho hello &gt;&gt; note.txt<\/p>\n<p>\u52a0 -e \u4e4b\u540e\u624d\u80fd\u7528\u6362\u884c\u3001\u5236\u8868\u8fd9\u7c7b\u8f6c\u4e49\u5199\u6cd5&#xff0c;\u4e0d\u52a0\u5c31\u539f\u6837\u6253\u51fa\u6765\u3002\u5355\u7bad\u5934\u8986\u76d6&#xff0c;\u53cc\u7bad\u5934\u8ffd\u52a0\u3002\u6709\u4eba\u60f3\u8ffd\u52a0\u7ed3\u679c\u7528\u4e86\u5355\u7bad\u5934&#xff0c;\u4e00\u6574\u4efd\u914d\u7f6e\u6587\u4ef6\u88ab\u4e00\u884c ls \u8f93\u51fa\u9876\u6389&#xff0c;\u90a3\u53f0\u673a\u5668\u9760\u5907\u4efd\u624d\u6551\u56de\u6765\u3002\u6539\u91cd\u8981\u6587\u4ef6\u4e4b\u524d\u5148 cp \u4e00\u4efd&#xff0c;\u4e00\u79d2\u949f\u7684\u4e8b\u3002<\/p>\n<h4>\u8f6f\u94fe\u63a5<\/h4>\n<p>ln -s test\/a\/note.txt .\/    # \u7ed9\u6587\u4ef6\u5efa<br \/>\nln -s test\/b .\/             # \u7ed9\u76ee\u5f55\u5efa<\/p>\n<p>\u8f6f\u94fe\u63a5\u5c31\u662f Windows \u7684\u5feb\u6377\u65b9\u5f0f&#xff0c;ll \u770b\u7b2c\u4e00\u4f4d\u662f l&#xff0c;\u5c3e\u5df4\u4e0a\u6709\u4e2a\u7bad\u5934\u6307\u5411\u771f\u5b9e\u8def\u5f84\u3002\u4e24\u4e2a\u5c0f\u5730\u65b9&#xff1a;\u5220\u7684\u65f6\u5019\u7528 rm \u94fe\u63a5\u540d\u6216\u8005 unlink&#xff0c;\u522b\u5728\u94fe\u63a5\u540d\u540e\u9762\u6302 \/&#xff0c;\u6302\u4e0a\u5c31\u5220\u4e0d\u6389\u4e86&#xff1b;\u60f3\u8fdb\u5230\u771f\u5b9e\u7684\u7269\u7406\u8def\u5f84\u7528 cd -P\u3002<\/p>\n<h4>history<\/h4>\n<p>history<\/p>\n<p>\u914d\u5408\u4e0a\u4e0b\u65b9\u5411\u952e\u548c !\u7f16\u53f7&#xff0c;\u957f\u547d\u4ee4\u4e0d\u7528\u91cd\u6572\u3002<\/p>\n<h3>\u4e03\u3001vi \/ vim<\/h3>\n<p>vim \u662f vi \u7684\u589e\u5f3a\u7248&#xff0c;\u80fd\u6309\u8bed\u6cd5\u7740\u8272&#xff0c;\u6539\u914d\u7f6e\u6587\u4ef6\u548c\u5199\u811a\u672c\u90fd\u591f\u7528\u3002\u7b2c\u4e00\u6b21\u7528\u6211\u662f\u61f5\u7684&#xff1a;\u6253\u5b57\u6253\u4e0d\u4e0a\u53bb&#xff0c;\u60f3\u9000\u51fa\u4e5f\u9000\u4e0d\u51fa\u6765\u3002\u95ee\u9898\u4e0d\u5728\u547d\u4ee4\u591a&#xff0c;\u662f\u4e0d\u6e05\u695a\u81ea\u5df1\u73b0\u5728\u5728\u54ea\u4e2a\u6a21\u5f0f\u3002<\/p>\n<p>\u4e09\u4e2a\u6a21\u5f0f\u3002\u6253\u5f00\u6587\u4ef6\u9ed8\u8ba4\u5728\u4e00\u822c\u6a21\u5f0f&#xff0c;\u8fd9\u65f6\u5019\u5b57\u6bcd\u662f\u547d\u4ee4\u4e0d\u662f\u6587\u5b57&#xff0c;\u7ba1\u79fb\u52a8\u3001\u590d\u5236\u3001\u5220\u9664\u3001\u64a4\u9500\u3002\u6309 i\u3001a\u3001o \u8fd9\u7c7b\u952e\u8fdb\u7f16\u8f91\u6a21\u5f0f&#xff0c;\u5de6\u4e0b\u89d2\u51fa\u73b0 &#8212; INSERT &#8212; \u624d\u80fd\u6253\u5b57\u3002\u5728\u4e00\u822c\u6a21\u5f0f\u4e0b\u6309 : \u6216\u8005 \/ \u8fdb\u547d\u4ee4\u6a21\u5f0f&#xff0c;\u5b58\u76d8\u3001\u9000\u51fa\u3001\u66ff\u6362\u3001\u663e\u884c\u53f7\u90fd\u5728\u8fd9\u91cc\u505a\u3002<\/p>\n<p>\u6211\u8bb0\u7684\u53ea\u6709\u4e00\u53e5&#xff1a;\u614c\u5c31\u6309 Esc\u3002\u6240\u6709\u6a21\u5f0f\u90fd\u80fd\u56de\u5230\u4e00\u822c\u6a21\u5f0f&#xff0c;\u591a\u6570&#034;\u662f\u4e0d\u662f\u5f04\u574f\u4e86&#034;\u7684\u614c&#xff0c;\u5176\u5b9e\u662f\u8fd8\u505c\u5728\u7f16\u8f91\u6a21\u5f0f\u91cc\u3002<\/p>\n<p>\u4e00\u822c\u6a21\u5f0f\u5e38\u7528\u7684\u51e0\u4e2a&#xff1a;<\/p>\n<p>yy        \u590d\u5236\u5f53\u524d\u884c          y\u6570\u5b57y    \u4ece\u5f53\u524d\u884c\u5f80\u4e0b\u590d\u5236 n \u884c<br \/>\np         \u7c98\u8d34                u         \u64a4\u9500<br \/>\ndd        \u5220\u5f53\u524d\u884c            d\u6570\u5b57d    \u4ece\u5f53\u524d\u884c\u5f80\u4e0b\u5220 n \u884c<br \/>\nx \/ X     \u5220\u5f53\u524d\u5b57\u7b26 \/ \u5220\u524d\u4e00\u4e2a\u5b57\u7b26<br \/>\nyw \/ dw   \u590d\u5236\u4e00\u4e2a\u8bcd \/ \u5220\u4e00\u4e2a\u8bcd<br \/>\n^ \/ $     \u8df3\u5230\u884c\u9996 \/ \u884c\u5c3e      gg \/ G    \u6587\u4ef6\u5934 \/ \u6587\u4ef6\u5c3e<br \/>\n\u6570\u5b57N &#043; G  \u8df3\u5230\u7b2c N \u884c<br \/>\n\/\u5173\u952e\u8bcd    \u641c\u7d22&#xff0c;n \u4e0b\u4e00\u4e2a&#xff0c;N \u4e0a\u4e00\u4e2a<\/p>\n<p>\u8fdb\u7f16\u8f91\u6a21\u5f0f\u7684\u5165\u53e3&#xff1a;i \u5149\u6807\u524d&#xff0c;a \u5149\u6807\u540e&#xff0c;o \u5f53\u524d\u884c\u4e0b\u9762\u65b0\u8d77\u4e00\u884c&#xff0c;I \u884c\u9996&#xff0c;A \u884c\u5c3e&#xff0c;O \u5f53\u524d\u884c\u4e0a\u9762\u65b0\u8d77\u4e00\u884c\u3002<\/p>\n<p>\u5b58\u76d8\u548c\u9000\u51fa&#xff1a;<\/p>\n<p>:w        \u4fdd\u5b58              :q      \u9000\u51fa&#xff0c;\u6ca1\u6539\u8fc7\u624d\u80fd\u76f4\u63a5\u9000<br \/>\n:q!       \u4e0d\u4fdd\u5b58\u5f3a\u5236\u9000        :wq     \u4fdd\u5b58\u9000\u51fa&#xff0c;:x \u4e5f\u884c<br \/>\n:set nu   \u663e\u884c\u53f7              :set nonu   \u5173\u884c\u53f7<br \/>\n:%s\/old\/new\/g   \u5168\u6587\u66ff\u6362<br \/>\n:noh      \u53d6\u6d88\u641c\u7d22\u9ad8\u4eae<\/p>\n<p>\u6709\u4e2a\u6551\u573a\u7684\u7528\u6cd5\u503c\u5f97\u8bb0&#xff1a;\u6539\u914d\u7f6e\u6587\u4ef6\u5fd8\u4e86\u52a0 sudo&#xff0c;\u6539\u5b8c\u5b58\u4e0d\u4e86\u3002\u4e0d\u7528\u9000\u51fa\u91cd\u6765&#xff0c;\u5728\u547d\u4ee4\u6a21\u5f0f\u91cc\u6267\u884c\u4e0b\u9762\u8fd9\u53e5&#xff0c;\u8f93\u4e00\u6b21\u5bc6\u7801\u5c31\u80fd\u628a\u6539\u52a8\u5199\u56de\u53bb&#xff0c;\u7136\u540e :q! \u9000\u6389\u3002<\/p>\n<p>:w !sudo tee % &gt;\/dev\/null<\/p>\n<p>\u53e6\u5916\u5982\u679c\u8bef\u6309 Ctrl&#043;S \u53d1\u73b0\u7ec8\u7aef\u4e0d\u52a8\u4e86&#xff0c;\u5176\u5b9e\u662f\u88ab\u6682\u505c\u8f93\u51fa&#xff0c;\u6309 Ctrl&#043;Q \u5c31\u6062\u590d\u3002\u7b2c\u4e00\u6b21\u78b0\u5230\u6211\u4ee5\u4e3a\u673a\u5668\u6302\u4e86&#xff0c;\u5dee\u70b9\u91cd\u542f\u3002<\/p>\n<h3>\u516b\u3001\u7528\u6237\u548c\u7528\u6237\u7ec4<\/h3>\n<p>\u88c5\u5b8c Ubuntu \u53ea\u8ba9\u6211\u8bbe\u4e00\u4e2a\u666e\u901a\u7528\u6237\u7684\u5bc6\u7801&#xff0c;\u6ca1\u6709 root \u5bc6\u7801&#xff0c;\u6211\u7591\u60d1\u4e86\u4e00\u9635\u3002\u540e\u6765\u77e5\u9053 Ubuntu \u9ed8\u8ba4\u628a root \u9501\u7740&#xff0c;\u4e0d\u7ed9\u5bc6\u7801&#xff0c;\u903c\u4f60\u7528\u666e\u901a\u7528\u6237\u767b\u5f55&#xff0c;\u9700\u8981\u9ad8\u6743\u9650\u65f6\u7528 sudo \u4e34\u65f6\u63d0\u6743\u3002\u8fd9\u6bd4\u5168\u7a0b root \u7a33\u59a5&#xff0c;\u81f3\u5c11\u52a8\u624b\u4e4b\u524d\u8981\u8fc7\u4e00\u9053\u786e\u8ba4\u3002<\/p>\n<p>\u786e\u5b9e\u9700\u8981 root \u73af\u5883\u7684\u65f6\u5019&#xff0c;\u6bd4\u5982\u8981\u8dd1\u4f9d\u8d56\u67d0\u4e9b\u73af\u5883\u53d8\u91cf\u7684\u811a\u672c&#xff0c;\u53ef\u4ee5\u5148\u7ed9 root \u8bbe\u5bc6\u7801\u518d\u5207\u3002<\/p>\n<p>sudo passwd root      # \u7ed9 root \u8bbe\u5bc6\u7801<br \/>\nsu root               # \u5207\u6362&#xff0c;\u4fdd\u7559\u5f53\u524d\u5de5\u4f5c\u73af\u5883<br \/>\nsu &#8211; root             # \u5207\u6362\u5e76\u52a0\u8f7d root \u7684\u5b8c\u6574\u73af\u5883\u53d8\u91cf<br \/>\nexit                  # \u9000\u51fa<br \/>\nsudo passwd -l root   # \u518d\u9501\u4e0a<br \/>\nsudo passwd -u root   # \u89e3\u9501<\/p>\n<p>su \u548c su &#8211; \u7684\u5dee\u522b\u6211\u4e00\u5f00\u59cb\u6ca1\u5728\u610f&#xff0c;\u76f4\u5230\u8dd1\u811a\u672c\u62a5\u547d\u4ee4\u627e\u4e0d\u5230\u624d\u660e\u767d&#xff1a;su &#8211; \u4f1a\u8fde\u76ee\u6807\u7528\u6237\u7684\u73af\u5883\u53d8\u91cf\u548c PATH \u4e00\u8d77\u5e26\u8fc7\u6765&#xff0c;su \u53ea\u501f\u6743\u9650\u4e0d\u501f\u73af\u5883\u3002\u8981\u505a\u7cfb\u7edf\u7ba1\u7406\u7684\u4e8b&#xff0c;\u76f4\u63a5 su &#8211; \u5c11\u8e29\u5751\u3002<\/p>\n<h4>\u7528\u6237<\/h4>\n<p>useradd -m tangseng     # \u52a0 -m \u624d\u4f1a\u5efa\u5bb6\u76ee\u5f55<br \/>\npasswd tangseng         # \u8bbe\u5bc6\u7801<br \/>\nid tangseng             # \u770b uid\u3001gid \u548c\u6240\u5c5e\u7ec4<br \/>\ncat \/etc\/passwd         # \u7cfb\u7edf\u91cc\u90fd\u6709\u54ea\u4e9b\u7528\u6237<br \/>\nuserdel tangseng        # \u5220\u7528\u6237&#xff0c;\u7559\u5bb6\u76ee\u5f55<br \/>\nuserdel -r tangseng     # \u8fde\u5bb6\u76ee\u5f55\u4e00\u8d77\u5220<br \/>\nusermod -l \u65b0\u540d \u8001\u540d     # \u6539\u7528\u6237\u540d<br \/>\nusermod -d \/home\/\u65b0\u76ee\u5f55 -m \u7528\u6237\u540d   # \u6539\u5bb6\u76ee\u5f55<\/p>\n<p>useradd \u4e0d\u52a0 -m \u4e0d\u4f1a\u5efa\u5bb6\u76ee\u5f55&#xff0c;\u767b\u8fdb\u53bb\u6ca1\u6709\u81ea\u5df1\u7684\u5730\u65b9&#xff0c;\u5f88\u5bb9\u6613\u61f5\u3002Ubuntu \u4e0a\u6211\u66f4\u559c\u6b22 adduser&#xff0c;\u5b83\u4e00\u6b65\u4e00\u6b65\u95ee&#xff0c;\u5bb6\u76ee\u5f55\u3001\u9aa8\u67b6\u6587\u4ef6\u3001\u5bc6\u7801\u4e00\u8d77\u914d\u597d&#xff1b;useradd \u66f4\u5e95\u5c42&#xff0c;\u9002\u5408\u5199\u8fdb\u81ea\u52a8\u5316\u811a\u672c\u3002<\/p>\n<h4>\u7ec4<\/h4>\n<p>groupadd xitianqujing           # \u65b0\u589e\u7ec4<br \/>\ngroupdel xitianqujing           # \u5220\u7ec4<br \/>\ngroupmod -n xitian xitianqujing # \u6539\u7ec4\u540d<br \/>\nusermod -g xitian zhubajie      # \u6362\u67d0\u4e2a\u7528\u6237\u7684\u4e3b\u7ec4<br \/>\ncat \/etc\/group                  # \u7cfb\u7edf\u91cc\u90fd\u6709\u54ea\u4e9b\u7ec4<\/p>\n<p>\u7ec4\u7684\u589e\u5220\u6539\u8bf4\u5230\u5e95\u662f\u5728\u6539 \/etc\/group\u3002\u60f3\u660e\u767d\u8fd9\u70b9&#xff0c;&#034;\u6743\u9650\u8be5\u7ed9\u8c01&#034;\u5c31\u6709\u7b54\u6848\u4e86&#xff1a;\u624b\u6539\u6587\u4ef6\u5bb9\u6613\u6539\u574f&#xff0c;\u7528\u547d\u4ee4\u6539&#xff0c;\u7cfb\u7edf\u4f1a\u66ff\u4f60\u68c0\u67e5\u683c\u5f0f\u3002<\/p>\n<h4>\u7ed9\u666e\u901a\u7528\u6237\u5f00 sudo<\/h4>\n<p>\u8981\u4e34\u65f6\u7ed9\u67d0\u4e2a\u8d26\u53f7\u63d0\u6743&#xff0c;\u5728 \/etc\/sudoers \u91cc\u52a0\u4e00\u884c&#xff1a;<\/p>\n<p>root  ALL&#061;(ALL) ALL<br \/>\ntestu ALL&#061;(ALL) ALL              # \u6bcf\u6b21\u8981\u8f93\u5bc6\u7801<br \/>\ntestu ALL&#061;(ALL) NOPASSWD:ALL     # \u4e0d\u8f93\u5bc6\u7801<\/p>\n<p>\u6539\u5b8c\u5b58\u76d8&#xff0c;\u7528 testu \u91cd\u65b0\u767b\u5f55\u5c31\u80fd sudo \u4e86\u3002\u8fd9\u91cc\u66f4\u63a8\u8350\u7528 visudo \u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6&#xff0c;\u5b83\u4f1a\u505a\u8bed\u6cd5\u68c0\u67e5&#xff0c;\u5199\u9519\u4e86\u4e0d\u8ba9\u4f60\u4fdd\u5b58\u3002sudoers \u8bed\u6cd5\u5199\u574f\u5bfc\u81f4 sudo \u76f4\u63a5\u4e0d\u80fd\u7528\u3001\u53ea\u80fd\u8fdb\u6062\u590d\u6a21\u5f0f&#xff0c;\u6211\u89c1\u8fc7\u4e0d\u6b62\u4e00\u6b21\u3002<\/p>\n<h3>\u4e5d\u3001\u6743\u9650<\/h3>\n<p>\u540c\u4e00\u4e2a\u6587\u4ef6\u5bf9\u4e0d\u540c\u7684\u4eba\u53ef\u4ee5\u4e0d\u4e00\u6837\u5f85\u9047&#xff0c;\u9760\u7684\u5c31\u662f ll \u6700\u5de6\u8fb9\u90a3 10 \u4e2a\u5b57\u7b26\u3002\u7b2c 0 \u4f4d\u662f\u7c7b\u578b&#xff1a;- \u662f\u666e\u901a\u6587\u4ef6&#xff0c;d \u662f\u76ee\u5f55&#xff0c;l \u662f\u8f6f\u94fe\u63a5\u3002\u7b2c 1 \u5230 3 \u4f4d\u662f\u5c5e\u4e3b&#xff0c;4 \u5230 6 \u4f4d\u662f\u5c5e\u7ec4&#xff0c;7 \u5230 9 \u4f4d\u662f\u5176\u4ed6\u4eba\u3002<\/p>\n<p>r\u3001w\u3001x \u5bf9\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u610f\u601d\u4e0d\u4e00\u6837&#xff0c;\u8fd9\u70b9\u6700\u5bb9\u6613\u6df7\u3002<\/p>\n<table border=\"1\" cellpadding=\"6\" cellspacing=\"0\">\n<tbody>\n<tr>\u6743\u9650\u5bf9\u6587\u4ef6\u5bf9\u76ee\u5f55<\/tr>\n<tr>\n<td>r<\/td>\n<td>\u80fd\u8bfb\u5185\u5bb9<\/td>\n<td>\u80fd ls \u5217\u51fa\u91cc\u9762\u6709\u4ec0\u4e48<\/td>\n<\/tr>\n<tr>\n<td>w<\/td>\n<td>\u80fd\u6539\u5185\u5bb9&#xff0c;\u4f46\u4e0d\u4ee3\u8868\u80fd\u5220\u6389\u8fd9\u4e2a\u6587\u4ef6<\/td>\n<td>\u80fd\u5728\u91cc\u9762\u65b0\u5efa\u3001\u5220\u9664\u3001\u6539\u540d<\/td>\n<\/tr>\n<tr>\n<td>x<\/td>\n<td>\u80fd\u88ab\u6267\u884c<\/td>\n<td>\u80fd cd \u8fdb\u53bb<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u90a3\u4e2a w \u8981\u7559\u610f&#xff1a;\u80fd\u4e0d\u80fd\u5220\u4e00\u4e2a\u6587\u4ef6&#xff0c;\u770b\u7684\u662f\u4f60\u5bf9\u5b83\u6240\u5728\u76ee\u5f55\u6709\u6ca1\u6709 w&#xff0c;\u4e0d\u662f\u5bf9\u6587\u4ef6\u672c\u8eab\u3002\u8fd9\u70b9\u6211\u76ef\u7740\u6743\u9650\u4f4d\u770b\u4e86\u534a\u5929\u624d\u60f3\u901a\u3002<\/p>\n<h4>chmod<\/h4>\n<p>chmod u&#043;x passwd              # \u5c5e\u4e3b\u52a0\u6267\u884c<br \/>\nchmod g&#043;x passwd              # \u5c5e\u7ec4\u52a0\u6267\u884c<br \/>\nchmod u-x,o&#043;x passwd          # \u7ec4\u5408\u5199<br \/>\nchmod 765 passwd              # 7&#061;rwx&#xff0c;6&#061;rw-&#xff0c;5&#061;r-x<br \/>\nchmod -R 777 test             # \u9012\u5f52\u5168\u5f00&#xff0c;\u975e\u5e38\u4e0d\u5efa\u8bae<\/p>\n<p>\u6570\u5b57\u6cd5\u662f r&#061;4\u3001w&#061;2\u3001x&#061;1 \u52a0\u8d77\u6765\u3002u\u3001g\u3001o \u5206\u522b\u662f\u5c5e\u4e3b\u3001\u5c5e\u7ec4\u3001\u5176\u4ed6\u4eba&#xff0c;a \u662f\u6240\u6709\u4eba\u3002<\/p>\n<p>777 \u6211\u5f97\u591a\u8bf4\u4e00\u53e5\u3002\u5b83\u57fa\u672c\u7b49\u4e8e&#034;\u6211\u641e\u4e0d\u5b9a\u6743\u9650\u4e86&#034;&#xff0c;\u4e0d\u662f\u89e3\u51b3\u529e\u6cd5&#xff1a;\u628a\u76ee\u5f55\u5f00\u6210 777&#xff0c;\u4efb\u4f55\u80fd\u767b\u8fdb\u8fd9\u53f0\u673a\u5668\u7684\u4eba\u90fd\u80fd\u6539\u4f60\u7684\u7a0b\u5e8f\u6587\u4ef6&#xff0c;\u5171\u4eab\u673a\u5668\u4e0a\u8ddf\u5728\u95e8\u53e3\u8e72\u7740\u6ca1\u533a\u522b\u3002\u6211\u73b0\u5728\u7684\u987a\u5e8f\u662f\u5148\u7528 id \u770b\u6e05\u81ea\u5df1\u662f\u8c01\u3001\u5728\u54ea\u4e2a\u7ec4&#xff0c;\u518d\u770b\u6587\u4ef6\u5c5e\u4e8e\u8c01&#xff0c;\u7136\u540e\u8981\u4e48 chown \u6539\u6210\u81ea\u5df1&#xff0c;\u8981\u4e48\u7528 usermod -aG \u7ec4\u540d \u7528\u6237\u540d \u628a\u81ea\u5df1\u52a0\u8fdb\u5bf9\u5e94\u7684\u7ec4&#xff0c;docker\u3001www-data \u5e38\u8fd9\u4e48\u5904\u7406&#xff0c;\u8981\u4e48\u53ea\u7ed9\u521a\u591f\u7528\u7684\u90a3\u70b9\u6743\u9650\u3002<\/p>\n<h4>chown \u548c chgrp<\/h4>\n<p>sudo chown root note.txt              # \u6539\u5c5e\u4e3b<br \/>\nsudo chown -R root:root test\/         # \u9012\u5f52\u6539\u5c5e\u4e3b\u548c\u5c5e\u7ec4<br \/>\nsudo chgrp zxf tt.txt                 # \u53ea\u6539\u5c5e\u7ec4<br \/>\nsudo chown $USER:$USER \u6587\u4ef6\u540d          # \u6539\u6210\u81ea\u5df1<\/p>\n<p>\u6700\u540e\u90a3\u6761\u662f\u4e2a\u6298\u4e2d\u7528\u6cd5&#xff1a;\u67d0\u4e2a\u914d\u7f6e\u6587\u4ef6\u5929\u5929\u8981\u6539&#xff0c;\u6bcf\u6b21\u90fd sudo \u5f88\u70e6&#xff0c;\u53c8\u4e0d\u60f3\u5f00 777&#xff0c;\u53ef\u4ee5\u628a\u5c5e\u4e3b\u6539\u6210\u81ea\u5df1\u3002\u4f46\u7cfb\u7edf\u5173\u952e\u6587\u4ef6&#xff0c;\u6bd4\u5982 \/etc\/passwd\u3001\/etc\/sudoers&#xff0c;\u522b\u8fd9\u4e48\u5e72&#xff0c;\u6539\u5c5e\u4e3b\u53ef\u80fd\u8ba9\u670d\u52a1\u76f4\u63a5\u8bbf\u95ee\u4e0d\u4e86\u3002<\/p>\n<h3>\u5341\u3001find \u548c grep<\/h3>\n<p>find .\/ -name &#034;*.txt&#034;     # \u6309\u540d\u5b57\u627e&#xff0c;\u901a\u914d\u7b26\u8981\u52a0\u5f15\u53f7<br \/>\nfind .\/ -user zxf         # \u6309\u5c5e\u4e3b\u627e<br \/>\nfind .\/ -size &#043;200c       # \u6309\u5927\u5c0f\u627e&#xff0c;&#043; \u5927\u4e8e\u3001- \u5c0f\u4e8e&#xff1b;b\/c\/w\/k\/M\/G \u662f\u5355\u4f4d<\/p>\n<p>find \u662f\u4ece\u6307\u5b9a\u76ee\u5f55\u5f80\u4e0b\u9012\u5f52\u904d\u5386&#xff0c;\u8303\u56f4\u7ed9\u5f97\u8d8a\u5927\u8d8a\u6162&#xff0c;\u522b\u4e00\u4e0a\u624b\u5c31\u4ece \/ \u5f00\u59cb\u626b\u5168\u76d8\u3002<\/p>\n<p>grep \u627e\u7684\u662f&#034;\u5185\u5bb9\u91cc\u542b\u67d0\u4e2a\u8bcd\u7684\u884c&#034;&#xff0c;\u51e0\u4e4e\u603b\u548c\u7ba1\u9053\u7b26\u4e00\u8d77\u7528\u3002<\/p>\n<p>grep -n \u5173\u952e\u8bcd \u6587\u4ef6\u540d      # -n \u663e\u793a\u884c\u53f7<br \/>\nll | grep zx              # \u4ece\u547d\u4ee4\u8f93\u51fa\u91cc\u8fc7\u6ee4<br \/>\ncat passwd | grep -n wu<\/p>\n<p>\u7ba1\u9053 | \u5c31\u662f\u628a\u524d\u4e00\u6761\u547d\u4ee4\u7684\u8f93\u51fa\u4ea4\u7ed9\u540e\u4e00\u6761\u5f53\u8f93\u5165\u3002\u60f3\u901a\u8fd9\u70b9&#xff0c;\u5f88\u591a\u770b\u7740\u5f88\u957f\u5f88\u552c\u4eba\u7684\u547d\u4ee4\u5176\u5b9e\u5c31\u662f\u51e0\u4e2a\u7b80\u5355\u5de5\u5177\u4e32\u8d77\u6765&#xff1a;ps -ef | grep python \u5c31\u662f\u5217\u51fa\u6240\u6709\u8fdb\u7a0b&#xff0c;\u518d\u7b5b\u51fa\u5e26 python \u7684\u90a3\u4e9b\u3002<\/p>\n<h3>\u5341\u4e00\u3001tar \u538b\u7f29\u89e3\u538b<\/h3>\n<p>tar -zcvf tt.tar.gz tt.txt tt2.txt    # \u538b\u591a\u4e2a\u6587\u4ef6<br \/>\ntar -zcvf test.tar.gz test\/           # \u538b\u76ee\u5f55<br \/>\ntar -zxvf test.tar.gz                 # \u89e3\u5230\u5f53\u524d\u76ee\u5f55<br \/>\ntar -zxvf test.tar.gz -C .\/work       # \u89e3\u5230\u6307\u5b9a\u76ee\u5f55<\/p>\n<p>\u53c2\u6570\u8bb0\u4e24\u4e2a\u7ec4\u5408\u5c31\u591f&#xff1a;\u6253\u5305 -zcvf&#xff0c;\u89e3\u5305 -zxvf\u3002c \u662f create&#xff0c;x \u662f extract&#xff0c;z \u662f gzip&#xff0c;v \u662f\u663e\u793a\u8fc7\u7a0b&#xff0c;f \u662f\u6307\u5b9a\u6587\u4ef6\u540d\u3002\u6709\u4e00\u70b9\u8981\u6ce8\u610f&#xff0c;f \u540e\u9762\u7d27\u8ddf\u7684\u4e00\u5b9a\u662f\u538b\u7f29\u5305\u540d&#xff0c;\u6240\u4ee5 -zcvf \u8981\u5199\u5728\u6700\u524d\u9762\u3001\u5305\u540d\u7d27\u8ddf\u5176\u540e&#xff0c;\u987a\u5e8f\u9519\u4e00\u4f4d\u5c31\u62a5\u9519\u3002<\/p>\n<h3>\u5341\u4e8c\u3001\u78c1\u76d8\u548c\u7f51\u7edc<\/h3>\n<p>df -h          # \u5404\u5206\u533a\u7528\u4e86\u591a\u5c11\u3001\u8fd8\u5269\u591a\u5c11<br \/>\ndu -a \u76ee\u5f55\/\u6587\u4ef6  # \u770b\u5177\u4f53\u6587\u4ef6\u548c\u76ee\u5f55\u5360\u591a\u5927<br \/>\nifconfig       # \u770b\u7f51\u7edc\u63a5\u53e3\u548c IP<br \/>\nping \u76ee\u7684\u4e3b\u673a   # \u6d4b\u8fde\u901a\u6027<br \/>\nhostname       # \u770b\u4e3b\u673a\u540d<\/p>\n<p>\u670d\u52a1\u8d77\u4e0d\u6765\u6211\u5148\u770b df -h\u3002\u78c1\u76d8\u5199\u6ee1\u4e4b\u540e\u65e5\u5fd7\u5199\u4e0d\u8fdb\u53bb\u3001\u6570\u636e\u5e93\u62d2\u7edd\u5199\u5165&#xff0c;\u62a5\u51fa\u6765\u7684\u9519\u5b8c\u5168\u4e0d\u50cf\u78c1\u76d8\u95ee\u9898&#xff0c;\u5f88\u5bb9\u6613\u67e5\u9519\u65b9\u5411\u3002\u786e\u8ba4\u6ee1\u4e86&#xff0c;\u518d\u7528 du -a \u5f80\u4e0b\u627e\u662f\u54ea\u4e2a\u76ee\u5f55\u5403\u7684\u3002<\/p>\n<p>\u7f51\u7edc\u4e0d\u901a\u5148 ifconfig \u770b\u6709\u6ca1\u6709 IP&#xff0c;\u518d ping \u7f51\u5173\u548c\u5916\u7f51\u57df\u540d\u3002IP \u80fd\u901a\u3001\u57df\u540d\u4e0d\u901a&#xff0c;\u90a3\u5c31\u662f DNS \u7684\u4e8b\u3002<\/p>\n<p>\u6539\u4e3b\u673a\u540d&#xff1a;\u4e34\u65f6\u6539\u662f hostnamectl set-hostname&#xff0c;\u8981\u6c38\u4e45\u751f\u6548\u5f97\u6539 \/etc\/hostname&#xff0c;\u6539\u5b8c\u91cd\u542f\u6216\u8005\u91cd\u65b0\u767b\u5f55\u624d\u770b\u5f97\u5230\u3002\/etc\/hosts \u91cc\u7684\u6620\u5c04\u987a\u624b\u5bf9\u4e00\u4e0b&#xff0c;\u4e0d\u7136\u672c\u5730\u89e3\u6790\u4f1a\u5bf9\u4e0d\u4e0a\u3002<\/p>\n<h3>\u5341\u4e09\u3001\u8fdb\u7a0b<\/h3>\n<p>ps -aux        # \u6240\u6709\u8fdb\u7a0b&#xff0c;\u91cd\u70b9\u770b %CPU\u3001%MEM<br \/>\nps -ef         # \u5e26\u7236\u8fdb\u7a0b PPID&#xff0c;\u770b\u8c01\u62c9\u8d77\u4e86\u8c01<br \/>\nfree -m        # \u5185\u5b58\u603b\u89c8<br \/>\ntop            # \u5b9e\u65f6\u770b\u7cfb\u7edf\u72b6\u6001<br \/>\ntop -d 1       # \u6bcf 1 \u79d2\u5237\u65b0<br \/>\ntop -p 3933    # \u53ea\u76ef\u67d0\u4e2a\u8fdb\u7a0b<br \/>\nkill -9 \u8fdb\u7a0b\u53f7  # \u5f3a\u5236\u6740<br \/>\nkillall \u8fdb\u7a0b\u540d  # \u6309\u540d\u5b57\u6740&#xff0c;\u7cbe\u786e\u5339\u914d<br \/>\nnetstat -nlp | grep \u7aef\u53e3\u53f7   # \u7aef\u53e3\u88ab\u8c01\u5360\u7528<br \/>\nnetstat -anp | grep \u8fdb\u7a0b\u53f7   # \u67d0\u8fdb\u7a0b\u7684\u7f51\u7edc\u8fde\u63a5<\/p>\n<p>ps -aux \u770b\u8d44\u6e90\u5360\u7528&#xff0c;ps -ef \u770b\u7236\u5b50\u5173\u7cfb\u3002ps -aux \u91cc STAT \u90a3\u5217\u503c\u5f97\u626b\u4e00\u773c&#xff1a;R \u8fd0\u884c\u3001S \u7761\u7720\u3001T \u505c\u6b62\u3001s \u542b\u5b50\u8fdb\u7a0b\u3001&#043; \u5728\u524d\u53f0\u3001I \u57fa\u672c\u4e0d\u5360 CPU\u3002\u51fa\u73b0\u4e00\u5806 D&#xff0c;\u4e5f\u5c31\u662f\u4e0d\u53ef\u4e2d\u65ad\u7761\u7720&#xff0c;\u6216\u8005\u50f5\u5c38\u8fdb\u7a0b&#xff0c;\u8bf4\u660e I\/O \u6216\u8fdb\u7a0b\u56de\u6536\u51fa\u4e86\u95ee\u9898\u3002<\/p>\n<p>top \u91cc\u6211\u5148\u770b\u4e09\u5904&#xff1a;\u7b2c\u4e00\u884c\u7684 load average&#xff0c;1\u30015\u300115 \u5206\u949f\u5e73\u5747\u8d1f\u8f7d&#xff0c;\u957f\u671f\u9ad8\u8fc7\u6838\u6570\u5c31\u662f\u8fc7\u8f7d&#xff1b;\u7b2c\u4e09\u884c\u7684\u7a7a\u95f2\u7387 %id&#xff1b;\u7b2c\u56db\u884c Mem \u7684 available\u3002\u6309 P \u4f9d CPU \u6392&#xff0c;M \u4f9d\u5185\u5b58\u6392&#xff0c;q \u9000\u51fa\u3002<\/p>\n<p>\u6740\u8fdb\u7a0b\u5148\u53d1\u9ed8\u8ba4\u4fe1\u53f7&#xff0c;\u4e5f\u5c31\u662f 15&#xff0c;\u901a\u77e5\u5b83\u81ea\u5df1\u9000\u51fa&#xff0c;\u7b49\u51e0\u79d2\u8fd8\u5728\u518d -9\u3002\u76f4\u63a5 -9 \u8fdb\u7a0b\u6ca1\u673a\u4f1a\u4fdd\u5b58\u6570\u636e\u548c\u6e05\u4e34\u65f6\u6587\u4ef6&#xff0c;\u6570\u636e\u5e93\u7c7b\u7684\u8fdb\u7a0b\u5c24\u5176\u5371\u9669\u3002killall \u6309\u8fdb\u7a0b\u540d\u7cbe\u786e\u5339\u914d&#xff0c;\u540d\u5b57\u9519\u4e00\u4f4d\u5c31\u6ca1\u53cd\u5e94&#xff0c;\u53cd\u5012\u4e0d\u5bb9\u6613\u8bef\u6740\u3002<\/p>\n<h3>\u5341\u56db\u3001basename \u548c dirname<\/h3>\n<p>basename \/home\/zxf\/note.txt        # \u5f97\u5230 note.txt<br \/>\nbasename \/home\/zxf\/tt.txt .txt     # \u53bb\u6389\u540e\u7f00&#xff0c;\u5f97\u5230 tt<br \/>\ndirname \/home\/zxf\/banzhang.txt     # \u5f97\u5230 \/home\/zxf<\/p>\n<p>\u5355\u72ec\u7528\u6ca1\u4ec0\u4e48\u610f\u601d&#xff0c;\u5199\u811a\u672c\u65f6\u987a\u624b\u3002\u811a\u672c\u91cc\u8981\u53d6\u81ea\u5df1\u6240\u5728\u76ee\u5f55\u5c31\u4e00\u884c&#xff1a;<\/p>\n<p>DIR&#061;$(dirname &#034;$0&#034;)<\/p>\n<p>\u8fd9\u6837\u4e0d\u7ba1\u4ece\u54ea\u4e2a\u8def\u5f84\u8c03\u7528&#xff0c;\u811a\u672c\u90fd\u80fd\u627e\u5230\u81ea\u5df1\u7684\u4f4d\u7f6e&#xff0c;\u540e\u9762\u5f15\u7528\u540c\u76ee\u5f55\u7684\u6587\u4ef6\u4e0d\u4f1a\u51fa\u9519\u3002<\/p>\n<h3>\u5341\u4e94\u3001crontab<\/h3>\n<p>cron \u662f\u7cfb\u7edf\u81ea\u5e26\u7684\u5b9a\u65f6\u4efb\u52a1&#xff0c;Ubuntu \u4e0a\u53eb cron&#xff0c;CentOS \u4e0a\u53eb crond\u3002\u5148\u770b\u670d\u52a1\u5728\u4e0d\u5728\u3002<\/p>\n<p>sudo systemctl restart cron<br \/>\nsystemctl status cron<\/p>\n<p>\u4e94\u4e2a\u661f\u53f7\u4f9d\u6b21\u662f\u5206\u949f&#xff08;0-59&#xff09;\u3001\u5c0f\u65f6&#xff08;0-23&#xff09;\u3001\u65e5&#xff08;1-31&#xff09;\u3001\u6708&#xff08;1-12&#xff09;\u3001\u661f\u671f&#xff08;0-7&#xff0c;0 \u548c 7 \u90fd\u662f\u5468\u65e5&#xff09;\u3002<\/p>\n<p>crontab -e   # \u7f16\u8f91<br \/>\ncrontab -l   # \u67e5\u770b<br \/>\ncrontab -r   # \u5220\u6389\u5f53\u524d\u7528\u6237\u7684\u5168\u90e8\u4efb\u52a1<\/p>\n<table border=\"1\" cellpadding=\"6\" cellspacing=\"0\">\n<tbody>\n<tr>\u7b26\u53f7\u542b\u4e49\u4f8b\u5b50<\/tr>\n<tr>\n<td>*<\/td>\n<td>\u4efb\u610f\u65f6\u95f4<\/td>\n<td>\u7b2c\u4e00\u4e2a * \u5c31\u662f\u6bcf\u5206\u949f<\/td>\n<\/tr>\n<tr>\n<td>,<\/td>\n<td>\u4e0d\u8fde\u7eed\u7684\u51e0\u4e2a\u70b9<\/td>\n<td>0 8,12,16 * * * \u6bcf\u5929 8\u300112\u300116 \u70b9\u6574<\/td>\n<\/tr>\n<tr>\n<td>&#8211;<\/td>\n<td>\u8fde\u7eed\u8303\u56f4<\/td>\n<td>0 5 * * 1-6 \u5468\u4e00\u5230\u5468\u516d\u51cc\u6668 5 \u70b9<\/td>\n<\/tr>\n<tr>\n<td>*\/n<\/td>\n<td>\u6bcf\u9694\u591a\u4e45<\/td>\n<td>*\/10 * * * * \u6bcf 10 \u5206\u949f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6bd4\u5982\u6bcf\u5206\u949f\u5f80\u6587\u4ef6\u91cc\u8ffd\u52a0\u4e00\u4e2a 11&#xff1a;<\/p>\n<p>*\/1 * * * * \/bin\/echo &#034;11&#034; &gt;&gt; \/opt\/module\/bailongma.txt<\/p>\n<p>\u8bed\u6cd5\u4e0d\u96be&#xff0c;\u96be\u7684\u662f\u5199\u5b8c\u4e0d\u6267\u884c\u3002\u8fd9\u4e8b\u6211\u8e29\u8fc7&#xff0c;\u4e5f\u5e2e\u522b\u4eba\u67e5\u8fc7\u51e0\u6b21&#xff0c;\u539f\u56e0\u57fa\u672c\u5c31\u90a3\u51e0\u4e2a\u3002<\/p>\n<p>PATH \u592a\u5e72\u51c0\u3002cron \u8dd1\u8d77\u6765\u7684 PATH \u901a\u5e38\u53ea\u6709 \/usr\/bin:\/bin&#xff0c;\u4e5f\u4e0d\u8bfb .bashrc&#xff0c;\u4f60\u5728\u7ec8\u7aef\u91cc\u968f\u624b\u80fd\u6572\u7684 python\u3001conda\u3001docker&#xff0c;\u5728 cron \u91cc\u627e\u4e0d\u5230\u3002\u8981\u4e48\u547d\u4ee4\u5168\u5199\u7edd\u5bf9\u8def\u5f84&#xff0c;\u8981\u4e48\u5728\u6587\u4ef6\u9876\u4e0a\u663e\u5f0f\u58f0\u660e PATH\u3002<\/p>\n<p>\u5de5\u4f5c\u76ee\u5f55\u4e0d\u662f\u4f60\u4ee5\u4e3a\u7684\u90a3\u4e2a\u3002cron \u7684\u5f53\u524d\u76ee\u5f55\u662f\u5bb6\u76ee\u5f55&#xff0c;\u4e0d\u662f\u811a\u672c\u6240\u5728\u7684\u5730\u65b9&#xff0c;\u811a\u672c\u91cc\u5199\u76f8\u5bf9\u8def\u5f84\u8bfb\u5199\u6587\u4ef6\u4e00\u5b9a\u627e\u4e0d\u5230&#xff0c;\u5f00\u5934\u5148 cd \u8fc7\u53bb\u3002<\/p>\n<p>\u8f93\u51fa\u88ab\u4e22\u4e86\u3002cron \u4f1a\u628a\u8f93\u51fa\u53d1\u7ed9\u672c\u5730\u90ae\u4ef6&#xff0c;\u670d\u52a1\u5668\u5927\u591a\u6ca1\u914d\u90ae\u4ef6&#xff0c;\u4e8e\u662f\u770b\u8d77\u6765\u4ec0\u4e48\u90fd\u6ca1\u53d1\u751f\u3002\u6bcf\u6761\u4efb\u52a1\u540e\u9762\u52a0 &gt;&gt; \/var\/log\/xxx.log 2&gt;&amp;1&#xff0c;\u51fa\u9519\u81ea\u5df1\u4f1a\u8bf4\u8bdd\u3002<\/p>\n<p>\u6743\u9650\u548c\u5c5e\u4e3b\u4e0d\u5bf9\u3002\u811a\u672c\u8981 chmod &#043;x&#xff0c;\u7b2c\u4e00\u884c\u8981\u6709\u5bf9\u7684 shebang&#xff0c;\u4efb\u52a1\u8981\u5199\u5728\u771f\u6b63\u8981\u6267\u884c\u5b83\u7684\u90a3\u4e2a\u7528\u6237\u7684 crontab \u91cc\u3002<\/p>\n<p>% \u662f\u7279\u6b8a\u5b57\u7b26\u3002crontab \u91cc % \u4f1a\u88ab\u5f53\u6210\u6362\u884c&#xff0c;date &#043;%F \u5f97\u5199\u6210 date &#043;\\\\%F\u3002\u8fd9\u4e2a\u6700\u9634&#xff0c;\u65e5\u5fd7\u91cc\u53ea\u544a\u8bc9\u4f60\u547d\u4ee4\u88ab\u622a\u65ad\u4e86\u3002<\/p>\n<p>\u65f6\u533a\u6216\u8005\u670d\u52a1\u672c\u8eab\u7684\u95ee\u9898\u3002\u4e91\u4e3b\u673a\u548c\u5bb9\u5668\u91cc\u7684\u65f6\u533a\u5e38\u548c\u672c\u5730\u4e0d\u4e00\u6837&#xff1b;cron \u670d\u52a1\u6ca1\u542f\u52a8\u66f4\u662f\u5565\u90fd\u4e0d\u4f1a\u53d1\u751f\u3002<\/p>\n<p>\u73b0\u5728\u6211\u8c03\u8bd5\u56fa\u5b9a\u4e09\u6b65&#xff1a;\u5148\u653e\u4e00\u6761 * * * * * date &gt;&gt; \/tmp\/cron_test.log&#xff0c;\u786e\u8ba4 cron \u5230\u5e95\u6709\u6ca1\u6709\u5728\u89e6\u53d1&#xff1b;\u518d\u770b \/var\/log\/syslog \u91cc\u6709\u6ca1\u6709 CRON \u7684 CMD \u8bb0\u5f55&#xff1b;\u6700\u540e\u624d\u628a\u771f\u811a\u672c\u653e\u8fdb\u53bb\u3002\u5148\u8bc1\u660e\u8c03\u5ea6\u5230\u4e86&#xff0c;\u518d\u67e5\u811a\u672c\u91cc\u9762\u4e3a\u4ec0\u4e48\u5931\u8d25&#xff0c;\u7701\u5f88\u591a\u778e\u731c\u3002<\/p>\n<h3>\u51e0\u4ef6\u6211\u60f3\u65e9\u70b9\u77e5\u9053\u7684\u4e8b<\/h3>\n<p>\u4e0d\u8981\u957f\u671f\u7528 root \u5e72\u6d3b\u3002sudo \u591a\u6572\u51e0\u4e0b\u4e0d\u9ebb\u70e6&#xff0c;\u5220\u9519\u4e00\u4e2a\u76ee\u5f55\u624d\u9ebb\u70e6\u3002<\/p>\n<p>\u6539\u914d\u7f6e\u4e4b\u524d\u5148 cp \u4e00\u4efd&#xff0c;\u4e00\u79d2\u949f\u7684\u4e8b&#xff0c;\u80fd\u7701\u4e00\u6574\u5929\u3002\u6539 sudoers \u7528 visudo&#xff0c;\u522b\u76f4\u63a5 vi\u3002<\/p>\n<p>\u91cd\u5b9a\u5411\u770b\u6e05\u662f\u4e00\u4e2a\u7bad\u5934\u8fd8\u662f\u4e24\u4e2a\u3002vi \u91cc\u51fa\u4e0d\u6765\u5148\u6309 Esc \u518d :q!&#xff0c;\u4e0d\u5b58\u5728\u9000\u4e0d\u51fa\u53bb\u8fd9\u56de\u4e8b\u3002\u6743\u9650\u62a5\u9519\u5148\u770b\u81ea\u5df1\u662f\u8c01\u3001\u5728\u54ea\u4e2a\u7ec4&#xff0c;\u522b\u7528 777 \u7cca\u3002\u670d\u52a1\u83ab\u540d\u8d77\u4e0d\u6765&#xff0c;\u5148 df -h \u770b\u4e00\u773c\u3002kill -9 \u7559\u5230\u6700\u540e\u3002<\/p>\n<p>\u56de\u5934\u770b&#xff0c;\u8fd9\u4e9b\u547d\u4ee4\u5176\u5b9e\u4e0d\u7528\u80cc\u3002\u7528\u5f97\u591a\u4e86\u4f1a\u81ea\u7136\u5f62\u6210\u4e00\u4e2a\u4e60\u60ef&#xff1a;\u52a8\u624b\u4e4b\u524d\u5148\u786e\u8ba4\u81ea\u5df1\u5728\u54ea\u4e2a\u76ee\u5f55\u3001\u6539\u7684\u4e1c\u897f\u5f52\u8c01\u3001\u4e07\u4e00\u6539\u574f\u4e86\u4ece\u54ea\u513f\u9000\u56de\u53bb\u3002\u5269\u4e0b\u7684\u67e5\u4e00\u4e0b\u5c31\u80fd\u7528\u3002<\/p>\n<p>\u53e6\u5916\u522b\u53ea\u5728\u865a\u62df\u673a\u91cc\u770b\u6559\u7a0b&#xff0c;\u627e\u4ef6\u771f\u4e8b\u505a&#xff1a;\u88c5\u4e2a\u73af\u5883\u3001\u8d77\u4e2a\u5c0f\u670d\u52a1\u3001\u914d\u4e00\u4e2a\u6bcf\u5929\u5907\u4efd\u7684\u4efb\u52a1\u3002\u547d\u4ee4\u662f\u7528\u7684\u65f6\u5019\u8bb0\u4f4f\u7684&#xff0c;\u5751\u662f\u8e29\u8fc7\u624d\u8bb0\u4f4f\u7684\u3002<\/p>\n<p>\u67e5\u624b\u518c&#xff1a;https:\/\/manpages.ubuntu.com\/<br \/>\n\u5199 cron \u8868\u8fbe\u5f0f\u7684\u65f6\u5019\u6211\u4f1a\u5bf9\u7740\u8fd9\u4e2a\u770b&#xff1a;https:\/\/crontab.guru\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u4e2a\u6708\u5728\u4e00\u53f0\u65b0\u88c5\u7684 Ubuntu \u4e0a\u914d\u8bad\u7ec3\u73af\u5883&#xff0c;\u524d\u9762\u4e09\u5929\u5168\u8017\u5728\u57fa\u7840\u64cd\u4f5c\u4e0a&#xff1a;\u88c5\u5b8c\u7cfb\u7edf\u6ca1\u6709 root \u5bc6\u7801\u3001apt \u88c5\u5b8c\u547d\u4ee4\u8fd8\u662f\u627e\u4e0d\u5230\u3001\u811a\u672c\u4e22\u8fdb\u5b9a\u65f6\u4efb\u52a1\u4e00\u58f0\u4e0d\u54cd\u3002\u663e\u5361\u9a71\u52a8\u53cd\u5012\u662f\u6700\u987a\u7684\u4e00\u6b65\u3002\u8fd9\u7bc7\u628a\u90a3\u6bb5\u6572\u8fc7\u7684\u547d\u4ee4\u548c\u67e5\u51fa\u6765\u7684\u539f\u56e0\u8bb0\u4e00\u904d&#xff0c;\u7ed9\u540c\u6837\u521a\u4e0a\u624b Ubuntu \u7684\u4eba\u770b\u3002\u4e00\u3001Linux \u8ddf Windows \u4e0d\u4e00\u6837\u7684\u5730\u65b9\u6211\u4e00\u5f00\u59cb\u62ff Windows \u7684\u4e60\u60ef\u5957 Linux&#xff0c;\u5904\u5904\u522b\u626d\u3002\u540e\u6765\u53d1\u73b0\u5dee\u522b\u5c31\u4e09\u6761\u3002Linux \u91cc\u4e00\u5207\u7686\u6587\u4ef6\u3002\u786c\u76d8\u3001\u7f51<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,103,44],"topic":[],"class_list":["post-118865","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-ubuntu","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4ece\u96f6\u628a Ubuntu \u6478\u719f\uff1a\u4e00\u4efd\u5199\u7ed9\u81ea\u5df1\u7684 Linux \u547d\u4ee4\u624b\u6284\u672c - \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\/118865.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ece\u96f6\u628a Ubuntu \u6478\u719f\uff1a\u4e00\u4efd\u5199\u7ed9\u81ea\u5df1\u7684 Linux \u547d\u4ee4\u624b\u6284\u672c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e0a\u4e2a\u6708\u5728\u4e00\u53f0\u65b0\u88c5\u7684 Ubuntu \u4e0a\u914d\u8bad\u7ec3\u73af\u5883&#xff0c;\u524d\u9762\u4e09\u5929\u5168\u8017\u5728\u57fa\u7840\u64cd\u4f5c\u4e0a&#xff1a;\u88c5\u5b8c\u7cfb\u7edf\u6ca1\u6709 root \u5bc6\u7801\u3001apt \u88c5\u5b8c\u547d\u4ee4\u8fd8\u662f\u627e\u4e0d\u5230\u3001\u811a\u672c\u4e22\u8fdb\u5b9a\u65f6\u4efb\u52a1\u4e00\u58f0\u4e0d\u54cd\u3002\u663e\u5361\u9a71\u52a8\u53cd\u5012\u662f\u6700\u987a\u7684\u4e00\u6b65\u3002\u8fd9\u7bc7\u628a\u90a3\u6bb5\u6572\u8fc7\u7684\u547d\u4ee4\u548c\u67e5\u51fa\u6765\u7684\u539f\u56e0\u8bb0\u4e00\u904d&#xff0c;\u7ed9\u540c\u6837\u521a\u4e0a\u624b Ubuntu \u7684\u4eba\u770b\u3002\u4e00\u3001Linux \u8ddf Windows \u4e0d\u4e00\u6837\u7684\u5730\u65b9\u6211\u4e00\u5f00\u59cb\u62ff Windows \u7684\u4e60\u60ef\u5957 Linux&#xff0c;\u5904\u5904\u522b\u626d\u3002\u540e\u6765\u53d1\u73b0\u5dee\u522b\u5c31\u4e09\u6761\u3002Linux \u91cc\u4e00\u5207\u7686\u6587\u4ef6\u3002\u786c\u76d8\u3001\u7f51\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/118865.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-28T01:48:22+00:00\" \/>\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=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/118865.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/118865.html\",\"name\":\"\u4ece\u96f6\u628a Ubuntu \u6478\u719f\uff1a\u4e00\u4efd\u5199\u7ed9\u81ea\u5df1\u7684 Linux \u547d\u4ee4\u624b\u6284\u672c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-28T01:48:22+00:00\",\"dateModified\":\"2026-10-28T01:48:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/118865.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/118865.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/118865.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4ece\u96f6\u628a Ubuntu \u6478\u719f\uff1a\u4e00\u4efd\u5199\u7ed9\u81ea\u5df1\u7684 Linux \u547d\u4ee4\u624b\u6284\u672c\"}]},{\"@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":"\u4ece\u96f6\u628a Ubuntu \u6478\u719f\uff1a\u4e00\u4efd\u5199\u7ed9\u81ea\u5df1\u7684 Linux \u547d\u4ee4\u624b\u6284\u672c - \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\/118865.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4ece\u96f6\u628a Ubuntu \u6478\u719f\uff1a\u4e00\u4efd\u5199\u7ed9\u81ea\u5df1\u7684 Linux \u547d\u4ee4\u624b\u6284\u672c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e0a\u4e2a\u6708\u5728\u4e00\u53f0\u65b0\u88c5\u7684 Ubuntu \u4e0a\u914d\u8bad\u7ec3\u73af\u5883&#xff0c;\u524d\u9762\u4e09\u5929\u5168\u8017\u5728\u57fa\u7840\u64cd\u4f5c\u4e0a&#xff1a;\u88c5\u5b8c\u7cfb\u7edf\u6ca1\u6709 root \u5bc6\u7801\u3001apt \u88c5\u5b8c\u547d\u4ee4\u8fd8\u662f\u627e\u4e0d\u5230\u3001\u811a\u672c\u4e22\u8fdb\u5b9a\u65f6\u4efb\u52a1\u4e00\u58f0\u4e0d\u54cd\u3002\u663e\u5361\u9a71\u52a8\u53cd\u5012\u662f\u6700\u987a\u7684\u4e00\u6b65\u3002\u8fd9\u7bc7\u628a\u90a3\u6bb5\u6572\u8fc7\u7684\u547d\u4ee4\u548c\u67e5\u51fa\u6765\u7684\u539f\u56e0\u8bb0\u4e00\u904d&#xff0c;\u7ed9\u540c\u6837\u521a\u4e0a\u624b Ubuntu \u7684\u4eba\u770b\u3002\u4e00\u3001Linux \u8ddf Windows \u4e0d\u4e00\u6837\u7684\u5730\u65b9\u6211\u4e00\u5f00\u59cb\u62ff Windows \u7684\u4e60\u60ef\u5957 Linux&#xff0c;\u5904\u5904\u522b\u626d\u3002\u540e\u6765\u53d1\u73b0\u5dee\u522b\u5c31\u4e09\u6761\u3002Linux \u91cc\u4e00\u5207\u7686\u6587\u4ef6\u3002\u786c\u76d8\u3001\u7f51","og_url":"https:\/\/www.wsisp.com\/helps\/118865.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-28T01:48:22+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/118865.html","url":"https:\/\/www.wsisp.com\/helps\/118865.html","name":"\u4ece\u96f6\u628a Ubuntu \u6478\u719f\uff1a\u4e00\u4efd\u5199\u7ed9\u81ea\u5df1\u7684 Linux \u547d\u4ee4\u624b\u6284\u672c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-28T01:48:22+00:00","dateModified":"2026-10-28T01:48:22+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/118865.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/118865.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/118865.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4ece\u96f6\u628a Ubuntu \u6478\u719f\uff1a\u4e00\u4efd\u5199\u7ed9\u81ea\u5df1\u7684 Linux \u547d\u4ee4\u624b\u6284\u672c"}]},{"@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\/118865","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=118865"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/118865\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=118865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=118865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=118865"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=118865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}