{"id":1407,"date":"2024-06-02T22:55:46","date_gmt":"2024-06-02T22:55:46","guid":{"rendered":""},"modified":"2024-06-05T06:12:19","modified_gmt":"2024-06-04T22:12:19","slug":"%e4%b8%80%e4%bb%bd%e5%89%8d%e7%ab%af%e5%a4%9f%e7%94%a8%e7%9a%84-linux-%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/www.lccc.top\/?p=1407","title":{"rendered":"\u4e00\u4efd\u524d\u7aef\u591f\u7528\u7684 Linux \u547d\u4ee4"},"content":{"rendered":"<td class=\"d-block comment-body markdown-body  js-comment-body\">\n<h2 dir=\"auto\">\u524d\u8a00<\/h2>\n<p dir=\"auto\">\u5728\u7ffb\u8bd1\u5b8c TypeScript \u5b98\u65b9\u6587\u6863\u540e\uff0c\u6211\u7528 VuePress \u642d\u5efa\u535a\u5ba2\uff0c\u53c8\u5b9e\u73b0\u4e86 GitHub \u548c Gitee Pages \u7684\u81ea\u52a8\u90e8\u7f72\uff0c\u4f46\u6211\u6700\u7ec8\u8fd8\u662f\u51b3\u5b9a\u81ea\u5df1\u5efa\u7ad9\uff0c\u800c\u5728\u5efa\u7ad9\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5fc5\u4e0d\u53ef\u5c11\u4f1a\u7528\u5230 Linux \u547d\u4ee4\uff0c\u6240\u4ee5\u6b64\u7bc7\u5199\u4e00\u4efd\u57fa\u672c\u591f\u7528\u7684  Linux \u547d\u4ee4\uff0c\u4f1a\u6db5\u76d6\u535a\u5ba2\u642d\u5efa\u7cfb\u5217\u6587\u7ae0\u7528\u5230\u7684\u5404\u79cd\u547d\u4ee4\uff0c\u65b9\u4fbf\u67e5\u8be2\u548c\u5b66\u4e60\u4f7f\u7528\u3002<\/p>\n<h2 dir=\"auto\">0. Owner\u3001Group\u3001Others\u3001Root<\/h2>\n<p dir=\"auto\">Linux \u7cfb\u7edf\u662f\u4e00\u79cd\u591a\u7528\u6237\u7cfb\u7edf\uff0c\u5b83\u5c06\u6587\u4ef6\u8bbf\u95ee\u8005\u8eab\u4efd\u5206\u4e3a\u4e09\u79cd\uff1a<\/p>\n<h3 dir=\"auto\">\u6587\u4ef6\u6240\u6709\u8005\uff08Owner\uff09<\/h3>\n<p dir=\"auto\">\u5f53\u521b\u5efa\u4e00\u4e2a\u7528\u6237\u7684\u65f6\u5019\uff0cLinux \u4f1a\u4e3a\u8be5\u7528\u6237\u521b\u5efa\u4e00\u4e2a\u4e3b\u76ee\u5f55\uff0c\u8def\u5f84\u4e3a <code class=\"notranslate\">\/home\/&lt;username&gt;<\/code>\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 <code class=\"notranslate\">cd ~<\/code>\uff0c\u5feb\u6377\u8fdb\u5165\u4e3b\u76ee\u5f55\u3002\u5982\u679c\u4f60\u60f3\u653e\u4e00\u4e2a\u79c1\u5bc6\u6587\u4ef6\uff0c\u5c31\u53ef\u4ee5\u653e\u5728\u81ea\u5df1\u7684\u4e3b\u76ee\u5f55\u91cc\uff0c\u7136\u540e\u8bbe\u7f6e\u53ea\u80fd\u81ea\u5df1\u67e5\u770b\u3002<\/p>\n<h3 dir=\"auto\">\u7fa4\u7ec4\uff08Group\uff09<\/h3>\n<p dir=\"auto\">\u6bcf\u4e2a\u7528\u6237\u90fd\u6709\u4e00\u4e2a\u7528\u6237\u7ec4\uff0c\u65b9\u4fbf\u591a\u4eba\u64cd\u4f5c\u7684\u65f6\u5019\uff0c\u4e3a\u4e00\u7fa4\u4eba\u5206\u914d\u6743\u9650\u3002\u5f53\u521b\u5efa\u7528\u6237\u7684\u65f6\u5019\uff0c\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a\u4e0e\u5b83\u540c\u540d\u7684\u7528\u6237\u7ec4\u3002<\/p>\n<p dir=\"auto\">\u5982\u679c\u4e00\u4e2a\u7528\u6237\u540c\u65f6\u5c5e\u4e8e\u591a\u4e2a\u7ec4\uff0c\u7528\u6237\u9700\u8981\u5728\u7528\u6237\u7ec4\u4e4b\u95f4\u5207\u6362\uff0c\u624d\u80fd\u5177\u6709\u5176\u4ed6\u7528\u6237\u7ec4\u7684\u6743\u9650\u3002<\/p>\n<h3 dir=\"auto\">\u5176\u4ed6\u4eba\uff08Others\uff09<\/h3>\n<p dir=\"auto\">\u65e2\u4e0d\u662f\u6587\u4ef6\u6240\u6709\u8005\u53c8\u4e0d\u662f\u6587\u4ef6\u6240\u5c5e\u7fa4\u7ec4\u6210\u5458\u7684\u7528\u6237\uff0c\u5c31\u662f\u5176\u4ed6\u4eba\u3002<\/p>\n<h3 dir=\"auto\">\u8d85\u7ea7\u7528\u6237\uff08Root\uff09<\/h3>\n<p dir=\"auto\">Root \u7528\u6237\u662f\u4e00\u7c7b\u7279\u6b8a\u7684\u7528\u6237\uff0c\u8be5\u7528\u6237\u53ef\u4ee5\u8bbf\u95ee\u6240\u6709\u6587\u4ef6\u3002<\/p>\n<h2 dir=\"auto\">1. adduser \u6dfb\u52a0\u7528\u6237 \u548c passwd \u66f4\u6539\u5bc6\u7801<\/h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# \u6dfb\u52a0\u4e00\u4e2a\u540d\u4e3a git \u7684\u7528\u6237\nadduser git\n# \u8bbe\u7f6e git \u7528\u6237\u7684\u5bc6\u7801\npasswd git\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u6dfb\u52a0\u4e00\u4e2a\u540d\u4e3a git \u7684\u7528\u6237<\/span>\nadduser git\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u8bbe\u7f6e git \u7528\u6237\u7684\u5bc6\u7801<\/span>\npasswd git<\/pre>\n<\/div>\n<p dir=\"auto\">\u4f46\u662f\u7531\u4e8e\u521b\u5efa\u7684\u7528\u6237\u6743\u9650\u8f83\u4f4e\uff0c\u6709\u7684\u65f6\u5019\u6211\u4eec\u9700\u8981\u4e3a\u7528\u6237\u63d0\u6743\uff0c\u6b64\u65f6\u6211\u4eec\u53ef\u4ee5\u8fd9\u6837\u505a\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# \u4f1a\u6253\u5f00 sudoers \u914d\u7f6e\u6587\u4ef6\nsudo visudo\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u4f1a\u6253\u5f00 sudoers \u914d\u7f6e\u6587\u4ef6<\/span>\nsudo visudo<\/pre>\n<\/div>\n<p dir=\"auto\">\u6ce8\u610f\u540c\u6837\u662f\u7f16\u8f91 <code class=\"notranslate\">sudoers<\/code> \u914d\u7f6e\u6587\u4ef6\uff0c\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u6bd4\u4f7f\u7528 <code class=\"notranslate\">sudo vim \/etc\/ sudoers<\/code> \u66f4\u5b89\u5168\uff0c \u9664\u4e86\u5bf9\u8bed\u6cd5\u6709\u6821\u9a8c\uff0c\u5e76\u4e14\u8fd8\u4f1a\u5728\u591a\u7528\u6237\u7f16\u8f91\u7684\u65f6\u5019\u9501\u4f4f\u6587\u4ef6\u3002<\/p>\n<p dir=\"auto\">\u6253\u5f00 <code class=\"notranslate\">sudoers<\/code> \u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u6211\u4eec\u6dfb\u52a0\u8fd9\u6837\u4e00\u884c\u914d\u7f6e\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# Allow git to run any commands anywhere\ngit ALL=(ALL:ALL) ALL \"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> Allow git to run any commands anywhere<\/span>\ngit ALL=(ALL:ALL) ALL <\/pre>\n<\/div>\n<p dir=\"auto\">\u7b80\u5355\u89e3\u91ca\u4e0b\u8fd9\u53e5\u8bdd <code class=\"notranslate\">git ALL=(ALL:ALL) ALL <\/code>\uff1a<\/p>\n<ul dir=\"auto\">\n<li>git \u8868\u793a\u89c4\u5219\u5e94\u7528\u7684\u7528\u6237\u540d<\/li>\n<li>\u7b2c\u4e00\u4e2a <code class=\"notranslate\">ALL<\/code> \u8868\u793a\u89c4\u5219\u5e94\u7528\u4e8e\u6240\u6709 hosts<\/li>\n<li>\u7b2c\u4e8c\u4e2a <code class=\"notranslate\">ALL<\/code> \u8868\u793a\u89c4\u5219\u5e94\u7528\u4e8e\u6240\u6709 users<\/li>\n<li>\u7b2c\u4e09\u4e2a <code class=\"notranslate\">ALL<\/code> \u8868\u793a\u89c4\u5219\u5e94\u7528\u4e8e\u6240\u6709 groups<\/li>\n<li>\u7b2c\u56db\u4e2a <code class=\"notranslate\">ALL<\/code> \u8868\u793a\u89c4\u5219\u5e94\u7528\u4e8e\u6240\u6709 commands<\/li>\n<\/ul>\n<p dir=\"auto\">\u6211\u4eec\u4fdd\u5b58\u9000\u51fa\u540e\uff0c<code class=\"notranslate\">git<\/code> \u7528\u6237\u5c31\u4f1a\u83b7\u5f97 root \u6743\u9650\u3002<\/p>\n<h2 dir=\"auto\">2. ls \u5217\u51fa\u6587\u4ef6\u548c\u76ee\u5f55<\/h2>\n<ol dir=\"auto\">\n<li><code class=\"notranslate\">ls<\/code> \u5217\u51fa\u6587\u4ef6\u548c\u76ee\u5f55<\/li>\n<\/ol>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[root@iZ2ze learn-typescript.git]# ls\nbranches  config  description  HEAD  hooks  index  info  objects  refs\"><\/p>\n<pre class=\"notranslate\">[root@iZ2ze learn-typescript.git]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> ls<\/span>\nbranches  config  description  HEAD  hooks  index  info  objects  refs<\/pre>\n<\/div>\n<ol start=\"2\" dir=\"auto\">\n<li><code class=\"notranslate\">ls -la<\/code> \u7531 <code class=\"notranslate\">-a<\/code> \u663e\u793a\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55\uff08\u5305\u62ec\u9690\u85cf\uff09\u548c <code class=\"notranslate\">-l<\/code> \u663e\u793a\u8be6\u7ec6\u5217\u8868\u7ec4\u6210\uff1a<\/li>\n<\/ol>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[root@iZ2ze learn-typescript.git]# ls -la\n\u603b\u7528\u91cf 20\ndrwxrwxr-x  7 git git  132 12\u6708 15 12:33 .\ndrwx------  3 git git  127 12\u6708 15 14:51 ..\ndrwxrwxr-x  2 git git    6 12\u6708 15 12:21 branches\n-rw-rw-r--  1 git git   66 12\u6708 15 12:21 config\n-rw-rw-r--  1 git git   73 12\u6708 15 12:21 description\n-rw-rw-r--  1 git git   23 12\u6708 15 12:21 HEAD\ndrwxrwxr-x  2 git git 4096 12\u6708 15 13:10 hooks\n-rw-rw-r--  1 git git  217 12\u6708 15 12:33 index\ndrwxrwxr-x  2 git git   21 12\u6708 15 12:21 info\ndrwxrwxr-x 10 git git   90 12\u6708 15 12:33 objects\ndrwxrwxr-x  4 git git   31 12\u6708 15 12:21 refs\"><\/p>\n<pre class=\"notranslate\">[root@iZ2ze learn-typescript.git]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> ls -la<\/span>\n\u603b\u7528\u91cf 20\ndrwxrwxr-x  7 git git  132 12\u6708 15 12:33 <span class=\"pl-c1\">.<\/span>\ndrwx------  3 git git  127 12\u6708 15 14:51 ..\ndrwxrwxr-x  2 git git    6 12\u6708 15 12:21 branches\n-rw-rw-r--  1 git git   66 12\u6708 15 12:21 config\n-rw-rw-r--  1 git git   73 12\u6708 15 12:21 description\n-rw-rw-r--  1 git git   23 12\u6708 15 12:21 HEAD\ndrwxrwxr-x  2 git git 4096 12\u6708 15 13:10 hooks\n-rw-rw-r--  1 git git  217 12\u6708 15 12:33 index\ndrwxrwxr-x  2 git git   21 12\u6708 15 12:21 info\ndrwxrwxr-x 10 git git   90 12\u6708 15 12:33 objects\ndrwxrwxr-x  4 git git   31 12\u6708 15 12:21 refs<\/pre>\n<\/div>\n<p dir=\"auto\">\u6bcf\u4e00\u884c\u90fd\u6709 7 \u5217\uff0c\u6211\u4eec\u4ee5 <code class=\"notranslate\">branches<\/code> \u4e3a\u4f8b\u8bb2\u89e3\u6bcf\u5217\u7684\u542b\u4e49\uff1a<\/p>\n<table role=\"table\">\n<thead>\n<tr>\n<th>drwxrwxr-x<\/th>\n<th>2<\/th>\n<th>git<\/th>\n<th>git<\/th>\n<th>6<\/th>\n<th>12\u6708 15 12:21<\/th>\n<th>branches<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u6587\u4ef6\u7c7b\u578b\u548c\u6743\u9650\u4fe1\u606f<\/td>\n<td>\u94fe\u63a5\u6570\u6216\u8005\u4e00\u7ea7\u5b50\u76ee\u5f55\u6570<\/td>\n<td>\u6240\u6709\u8005<\/td>\n<td>\u6240\u5c5e\u7ec4<\/td>\n<td>\u6587\u4ef6\u5927\u5c0f\uff0c\u5355\u4f4d\u5b57\u8282<\/td>\n<td>\u6700\u540e\u4fee\u6539\u65f6\u95f4<\/td>\n<td>\u6587\u4ef6\u540d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p dir=\"auto\">\u91cd\u70b9\u770b\u7b2c 1 \u5217\u7684\u5185\u5bb9\uff0c\u4ee5 <code class=\"notranslate\">drwxrwxr-x<\/code> \u4e3a\u4f8b\uff0c\u8fd9\u91cc\u4e00\u5171 10 \u4f4d\uff0c\u7b2c 1 \u4f4d\u8868\u793a\u6587\u4ef6\u7c7b\u578b\uff0c\u5176\u4e2d <code class=\"notranslate\">-<\/code> \u8868\u793a\u666e\u901a\u6587\u4ef6\uff0c<code class=\"notranslate\">d<\/code> \u8868\u793a\u76ee\u5f55\u6587\u4ef6\u3002<\/p>\n<p dir=\"auto\">\u7b2c 2 \u5230\u7b2c 4 \u4f4d\uff0c\u8868\u793a\u6240\u6709\u8005\u6743\u9650\uff0c\u5176\u4e2d <code class=\"notranslate\">r<\/code> \u8868\u793a\u8bfb\u6743\u9650\uff0c<code class=\"notranslate\">w<\/code> \u8868\u793a\u5199\u6743\u9650\uff0c<code class=\"notranslate\">x<\/code> \u8868\u793a\u53ef\u6267\u884c\u6743\u9650\uff0c <code class=\"notranslate\">-<\/code>\u8868\u793a\u65e0\u6743\u9650\uff0c\u7b2c 2 \u5230 5 \u4f4d\u4e3a <code class=\"notranslate\">rwx<\/code>\uff0c\u8868\u793a\u6240\u6709\u8005\u53ef\u8bfb\u53ef\u5199\u53ef\u6267\u884c\u3002<\/p>\n<p dir=\"auto\">\u7b2c 5 \u5230\u7b2c 7 \u4f4d\uff0c\u8868\u793a\u7ec4\u7528\u6237\u6743\u9650\uff0c\u8fd9\u91cc\u4e5f\u662f <code class=\"notranslate\">rwx<\/code>\u3002<\/p>\n<p dir=\"auto\">\u7b2c 8 \u5230\u7b2c 10 \u4f4d\uff0c\u8868\u793a\u5176\u4ed6\u7528\u6237\u6743\u9650\uff0c\u8fd9\u91cc\u662f <code class=\"notranslate\">r-x<\/code>\uff0c\u8868\u793a\u6709\u53ef\u8bfb\u53ef\u6267\u884c\u6743\u9650\uff0c\u65e0\u5199\u5165\u6743\u9650\u3002<\/p>\n<p dir=\"auto\">\u8fd9\u91cc\u518d\u989d\u5916\u8865\u5145\u4e00\u70b9\uff1a<\/p>\n<p dir=\"auto\">\u50cf <code class=\"notranslate\">root<\/code> \u7528\u6237\u521b\u5efa\u6587\u4ef6\u5939\u7684\u9ed8\u8ba4\u6743\u9650\u4e3a <code class=\"notranslate\">rwxr-xr-x<\/code>:<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[root@iZ2ze www]# mkdir test\n[root@iZ2ze www]# ls -l\n\ndrwxr-xr-x  2 root root  6 12\u6708 17 23:53 test\"><\/p>\n<pre class=\"notranslate\">[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> mkdir test<\/span>\n[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> ls -l<\/span>\n\ndrwxr-xr-x  2 root root  6 12\u6708 17 23:53 <span class=\"pl-c1\">test<\/span><\/pre>\n<\/div>\n<p dir=\"auto\">\u800c\u521b\u5efa\u6587\u4ef6\u7684\u9ed8\u8ba4\u6743\u9650\u662f <code class=\"notranslate\">rw-r--r--<\/code>\uff0c\u6ce8\u610f\u521b\u5efa\u6587\u4ef6\u9ed8\u8ba4\u4f1a\u53bb\u6389 <code class=\"notranslate\">x<\/code> \u6743\u9650\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[root@iZ2ze www]# touch index.html\n[root@iZ2ze www]# ls -l\n\n-rw-r--r--  1 root root  0 12\u6708 17 23:54 index.html\"><\/p>\n<pre class=\"notranslate\">[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> touch index.html<\/span>\n[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> ls -l<\/span>\n\n-rw-r--r--  1 root root  0 12\u6708 17 23:54 index.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u6211\u4eec\u6709\u7684\u65f6\u5019\u9700\u8981\u5728\u521b\u5efa\u6587\u4ef6\u540e\uff0c\u53c8\u52a0\u4e0a\u6267\u884c\u6743\u9650\u3002<\/p>\n<h2 dir=\"auto\">3. chown \u66f4\u6539\u6587\u4ef6\u5c5e\u4e3b\uff0c\u4e5f\u53ef\u4ee5\u540c\u65f6\u66f4\u6539\u6587\u4ef6\u5c5e\u7ec4<\/h2>\n<p dir=\"auto\"><strong>chown (change owner)<\/strong> \u8bed\u6cd5\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# -R\uff1a\u9012\u5f52\u66f4\u6539\u6587\u4ef6\u5c5e\u7ec4\nchown [\u2013R] \u5c5e\u4e3b\u540d \u6587\u4ef6\u540d\nchown [-R] \u5c5e\u4e3b\u540d\uff1a\u5c5e\u7ec4\u540d \u6587\u4ef6\u540d\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> -R\uff1a\u9012\u5f52\u66f4\u6539\u6587\u4ef6\u5c5e\u7ec4<\/span>\nchown [\u2013R] \u5c5e\u4e3b\u540d \u6587\u4ef6\u540d\nchown [-R] \u5c5e\u4e3b\u540d\uff1a\u5c5e\u7ec4\u540d \u6587\u4ef6\u540d<\/pre>\n<\/div>\n<p dir=\"auto\">\u5c06 <code class=\"notranslate\">index.html<\/code> \u7684\u6240\u6709\u8005\u66f4\u6539\u4e3a <code class=\"notranslate\">git<\/code>\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[root@iZ2ze www]# chown git index.html\n[root@iZ2ze www]# ls -\n\n-rw-r--r-- 1 git  root  0 12\u6708 17 23:54 index.html\"><\/p>\n<pre class=\"notranslate\">[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> chown git index.html<\/span>\n[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> ls -<\/span>\n\n-rw-r--r-- 1 git  root  0 12\u6708 17 23:54 index.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u5c06 <code class=\"notranslate\">index.html<\/code> \u7684\u6240\u6709\u8005\u548c\u7fa4\u7ec4\u90fd\u6539\u4e3a <code class=\"notranslate\">git<\/code>\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[root@iZ2ze www]# chown git:git index.html\n[root@iZ2ze www]# ls -l\n\n-rw-r--r-- 1 git  git   0 12\u6708 17 23:54 index.html\"><\/p>\n<pre class=\"notranslate\">[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> chown git:git index.html<\/span>\n[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> ls -l<\/span>\n\n-rw-r--r-- 1 git  git   0 12\u6708 17 23:54 index.html<\/pre>\n<\/div>\n<h2 dir=\"auto\">4. chmod \u66f4\u6539\u6587\u4ef6\u6743\u9650<\/h2>\n<p dir=\"auto\">\u6743\u9650\u9664\u4e86\u7528 <code class=\"notranslate\">r<\/code> <code class=\"notranslate\">w<\/code> <code class=\"notranslate\">x<\/code> \u8fd9\u79cd\u65b9\u5f0f\u8868\u793a\uff0c\u4e5f\u53ef\u4ee5\u7528\u6570\u5b57\u8868\u793a\uff0c\u6570\u7ec4\u4e0e\u5b57\u6bcd\u7684\u5bf9\u5e94\u5173\u7cfb\u4e3a\uff1a<\/p>\n<ul dir=\"auto\">\n<li>r:4<\/li>\n<li>w:2<\/li>\n<li>x:1<\/li>\n<\/ul>\n<p dir=\"auto\">\u4e4b\u6240\u6709\u5982\u6b64\u5bf9\u5e94\u5173\u7cfb\uff0c\u4e3b\u8981\u8fd8\u662f\u4e3a\u4e86\u65b9\u4fbf\u63a8\u5bfc\uff0c\u6bd4\u5982\u6211\u4eec\u5e0c\u671b\u4e00\u4e2a\u6587\u4ef6\u53ef\u8bfb\u53ef\u5199\uff0c\u90a3\u6211\u4eec\u53ef\u4ee5\u65b9\u4fbf\u7684\u8bbe\u7f6e\u6743\u9650\u4e3a 6\uff084 + 2\uff09\uff0c\u540c\u6837\uff0c\u5982\u679c\u6211\u4eec\u77e5\u9053\u4e00\u4e2a\u6743\u9650\u4e3a 3\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u63a8\u5bfc\u51fa\u6743\u9650\u4e3a\u53ef\u5199\u53ef\u6267\u884c\uff0c\u56e0\u4e3a\u53ea\u6709 2 + 1 \u624d\u53ef\u80fd\u7b49\u4e8e 3\u3002\u200b<\/p>\n<p dir=\"auto\">\u6211\u4eec\u770b\u4e0b <strong>chmod \uff08change mode\uff09<\/strong> \u7684\u5177\u4f53\u8bed\u6cd5\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# -R\uff1a\u9012\u5f52\u66f4\u6539\u6587\u4ef6\u5c5e\u7ec4\nchmod [-R] xyz \u6587\u4ef6\u6216\u76ee\u5f55\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> -R\uff1a\u9012\u5f52\u66f4\u6539\u6587\u4ef6\u5c5e\u7ec4<\/span>\nchmod [-R] xyz \u6587\u4ef6\u6216\u76ee\u5f55<\/pre>\n<\/div>\n<p dir=\"auto\">\u5176\u4e2d xyz \u5206\u522b\u8868\u793a Owner\u3001Group\u3001Others \u7684\u6743\u9650\uff0c\u5982\u679c\u6211\u4eec\u8fd9\u6837\u8bbe\u7f6e\u4e00\u4e2a\u6587\u4ef6\u7684\u6743\u9650\uff1a<\/p>\n<div class=\"highlight highlight-source-ts notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"chmod 750 index.html\">\n<pre class=\"notranslate\"><span class=\"pl-s1\">chmod<\/span> <span class=\"pl-c1\">750<\/span> <span class=\"pl-s1\">index<\/span><span class=\"pl-kos\">.<\/span><span class=\"pl-c1\">html<\/span><\/pre>\n<\/div>\n<p dir=\"auto\">\u6211\u4eec\u53ef\u4ee5\u5f97\u77e5\uff0cOwner \u7684\u6743\u9650\u4e3a 7\uff0c\u4e3a\u53ef\u8bfb\u53ef\u5199\u53ef\u6267\u884c\uff0cGroup \u7684\u6743\u9650\u4e3a 5\uff0c\u4e3a\u53ef\u8bfb\u53ef\u6267\u884c\uff0cOthers \u7684\u6743\u9650\u4e3a 0\uff0c\u8868\u793a\u4e0d\u53ef\u8bfb\u5199\u4e0d\u53ef\u6267\u884c\u3002\u5bf9\u5e94\u5b57\u6bcd\u4e3a\uff1a<code class=\"notranslate\">rwxr-x---<\/code>\u3002<\/p>\n<p dir=\"auto\">\u9664\u4e86\u8fd9\u79cd\u6570\u5b57\u7684\u65b9\u5f0f\uff0c\u8fd8\u6709\u4e00\u79cd\u4f7f\u7528\u7b26\u53f7\u7c7b\u578b\u6539\u53d8\u6743\u9650\u7684\u65b9\u5f0f\uff1a<\/p>\n<p dir=\"auto\">\u5728\u8fd9\u79cd\u65b9\u5f0f\u91cc\uff0c\u6211\u4eec\u5c06\u4e09\u79cd\u8eab\u4efd <code class=\"notranslate\">Owner<\/code>\u3001<code class=\"notranslate\">Group<\/code>\u3001<code class=\"notranslate\">Others<\/code>\uff0c\u5206\u522b\u7b80\u5199\u4e3a <code class=\"notranslate\">u\uff08User\uff09<\/code>\u3001<code class=\"notranslate\">g<\/code>\u3001<code class=\"notranslate\">o<\/code>\uff0c\u7528 <code class=\"notranslate\">a<\/code> \u8868\u793a\u6240\u6709\u8eab\u4efd\uff0c\u518d\u4f7f\u7528 <code class=\"notranslate\">+<\/code> <code class=\"notranslate\">-<\/code> <code class=\"notranslate\">=<\/code> \u8868\u793a\u52a0\u5165\u3001\u53bb\u9664\u3001\u8bbe\u5b9a\u4e00\u4e2a\u6743\u9650\uff0c<code class=\"notranslate\">r<\/code> <code class=\"notranslate\">w<\/code> <code class=\"notranslate\">x<\/code> \u5219\u7ee7\u7eed\u8868\u793a\u8bfb\uff0c\u5199\uff0c\u6267\u884c\u6743\u9650\uff0c\u4e3e\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"chmod u+x,g-x,o-x index.html\">\n<pre class=\"notranslate\">chmod u+x,g-x,o-x index.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u610f\u601d\u5c31\u662f <code class=\"notranslate\">Owner<\/code> \u52a0\u4e0a\u6267\u884c\u6743\u9650\uff0c<code class=\"notranslate\">Group<\/code> \u548c <code class=\"notranslate\">Others<\/code> \u53bb\u9664\u6267\u884c\u6743\u9650\u3002<\/p>\n<p dir=\"auto\">\u5f53\u7136\u6211\u4eec\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8bbe\u5b9a\u6743\u9650<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"chmod u=rwx,g=rx,o=r index.html\">\n<pre class=\"notranslate\">chmod u=rwx,g=rx,o=r index.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u6b64\u65f6\u6587\u4ef6\u7684\u6743\u9650\u5c31\u76f8\u5f53\u4e8e <code class=\"notranslate\">-rwxr-xr--<\/code>\u3002<\/p>\n<p dir=\"auto\">\u6b64\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u7701\u7565\u4e0d\u5199 <code class=\"notranslate\">ugoa<\/code> \u8fd9\u7c7b\u8eab\u4efd\u5185\u5bb9\uff0c\u76f4\u63a5\u5199\uff1a<\/p>\n<div class=\"highlight highlight-source-ts notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"chmod +x index.html\">\n<pre class=\"notranslate\"><span class=\"pl-s1\">chmod<\/span> <span class=\"pl-c1\">+<\/span><span class=\"pl-s1\">x<\/span> <span class=\"pl-s1\">index<\/span><span class=\"pl-kos\">.<\/span><span class=\"pl-c1\">html<\/span><\/pre>\n<\/div>\n<p dir=\"auto\">\u6b64\u65f6\u76f8\u5f53\u4e8e\u4f7f\u7528\u4e86 <code class=\"notranslate\">a<\/code>\uff0c\u4f1a\u7ed9\u6240\u6709\u8eab\u4efd\u6dfb\u52a0\u6267\u884c\u6743\u9650\u3002<\/p>\n<h2 dir=\"auto\">5. su \u5207\u6362\u8eab\u4efd<\/h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# \u5207\u6362\u4e3a git \u7528\u6237\nsu git\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u5207\u6362\u4e3a git \u7528\u6237<\/span>\nsu git<\/pre>\n<\/div>\n<h2 dir=\"auto\">6. whoami \u663e\u793a\u7528\u6237\u540d<\/h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# whoami \nroot\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> whoami <\/span>\nroot<\/pre>\n<\/div>\n<h2 dir=\"auto\">7. pwd \u663e\u793a\u5f53\u524d\u76ee\u5f55<\/h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[git@iZ2ze www]$ pwd\n\/home\/www\"><\/p>\n<pre class=\"notranslate\">[git@iZ2ze www]$ <span class=\"pl-c1\">pwd<\/span>\n\/home\/www<\/pre>\n<\/div>\n<h2 dir=\"auto\">9. cd \u5207\u6362\u5de5\u4f5c\u76ee\u5f55<\/h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# \u8fdb\u5165 \/home\/www\/\ncd \/home\/www\n\n# \u8fdb\u5165\u81ea\u5df1\u7684\u4e3b\u76ee\u5f55\ncd ~\n\n# \u8fdb\u5165\u5f53\u524d\u76ee\u5f55\u7684\u4e0a\u4e0a\u4e24\u5c42 :\ncd ..\/..\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u8fdb\u5165 \/home\/www\/<\/span>\n<span class=\"pl-c1\">cd<\/span> \/home\/www\n\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u8fdb\u5165\u81ea\u5df1\u7684\u4e3b\u76ee\u5f55<\/span>\n<span class=\"pl-c1\">cd<\/span> <span class=\"pl-k\">~<\/span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u8fdb\u5165\u5f53\u524d\u76ee\u5f55\u7684\u4e0a\u4e0a\u4e24\u5c42 :<\/span>\n<span class=\"pl-c1\">cd<\/span> ..\/..<\/pre>\n<\/div>\n<h2 dir=\"auto\">10. mkdir \u521b\u5efa\u76ee\u5f55<\/h2>\n<ol dir=\"auto\">\n<li><code class=\"notranslate\">mkdir<\/code> \u521b\u5efa\u76ee\u5f55\uff1a<\/li>\n<\/ol>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"mkdir new_folder\">\n<pre class=\"notranslate\">mkdir new_folder<\/pre>\n<\/div>\n<ol start=\"2\" dir=\"auto\">\n<li><code class=\"notranslate\">mkdir -p<\/code> \u9012\u5f52\u521b\u5efa\u76ee\u5f55\uff1a<\/li>\n<\/ol>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"mkdir -p one\/two\/three\">\n<pre class=\"notranslate\">mkdir -p one\/two\/three<\/pre>\n<\/div>\n<h2 dir=\"auto\">11. touch \u521b\u5efa\u6587\u4ef6<\/h2>\n<p dir=\"auto\">\u7528\u4e8e\u4fee\u6539\u6587\u4ef6\u6216\u8005\u76ee\u5f55\u7684\u65f6\u95f4\u5c5e\u6027\uff0c\u5f53\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u7cfb\u7edf\u4f1a\u521b\u5efa\u7a7a\u767d\u6587\u4ef6<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"touch new_file\">\n<pre class=\"notranslate\">touch new_file<\/pre>\n<\/div>\n<h2 dir=\"auto\">12. echo \u6253\u5370\u8f93\u51fa<\/h2>\n<p dir=\"auto\">echo \u662f Shell \u547d\u4ee4\uff0c\u7528\u4e8e\u6253\u5370\u8f93\u51fa\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content='# \u663e\u793a\u8f6c\u4e49\u5b57\u7b26\necho \"\\\"test content\\\"\"'><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u663e\u793a\u8f6c\u4e49\u5b57\u7b26<\/span>\n<span class=\"pl-c1\">echo<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span><span class=\"pl-cce\">\\\"<\/span>test content<span class=\"pl-cce\">\\\"<\/span><span class=\"pl-pds\">\"<\/span><\/span><\/pre>\n<\/div>\n<p dir=\"auto\">\u521b\u5efa\u6216\u8986\u76d6\u6587\u4ef6\u5185\u5bb9\u4e3a &#8220;test content&#8221;\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content='echo \"test content\" &gt; index.html'>\n<pre class=\"notranslate\"><span class=\"pl-c1\">echo<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>test content<span class=\"pl-pds\">\"<\/span><\/span> <span class=\"pl-k\">&gt;<\/span> index.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u5982\u679c\u662f\u60f3\u8ffd\u52a0\u5185\u5bb9\uff0c\u5c31\u7528 <code class=\"notranslate\">&gt;&gt;<\/code> \uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content='[root@iZ2ze www]# echo \"test content\" &gt; index.html\n[root@iZ2ze www]# cat index.html\ntest content\n[root@iZ2ze www]# echo \"test content\" &gt;&gt; index.html\n[root@iZ2ze www]# cat index.html\ntest content\ntest content'><\/p>\n<pre class=\"notranslate\">[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> echo \"test content\" &gt; index.html<\/span>\n[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> cat index.html<\/span>\n<span class=\"pl-c1\">test<\/span> content\n[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> echo \"test content\" &gt;&gt; index.html<\/span>\n[root@iZ2ze www]<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> cat index.html<\/span>\n<span class=\"pl-c1\">test<\/span> content\n<span class=\"pl-c1\">test<\/span> content<\/pre>\n<\/div>\n<h2 dir=\"auto\">13. cat \u8fde\u63a5\u6587\u4ef6\u5e76\u6253\u5370\u8f93\u51fa<\/h2>\n<p dir=\"auto\">\u67e5\u770b\u6587\u4ef6\u5185\u5bb9\uff1a<\/p>\n<div class=\"highlight highlight-source-ts notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cat ~\/.ssh\/id_rsa.pub\">\n<pre class=\"notranslate\"><span class=\"pl-s1\">cat<\/span> <span class=\"pl-c1\">~<\/span><span class=\"pl-pds\"><span class=\"pl-c1\">\/<\/span>.ssh<span class=\"pl-c1\">\/<\/span><\/span><span class=\"pl-s1\">id_rsa<\/span><span class=\"pl-kos\">.<\/span><span class=\"pl-c1\">pub<\/span><\/pre>\n<\/div>\n<p dir=\"auto\">\u6e05\u7a7a index.html \u5185\u5bb9\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cat \/dev\/null &gt; index.html\">\n<pre class=\"notranslate\">cat \/dev\/null <span class=\"pl-k\">&gt;<\/span> index.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u628a index.html \u7684\u5185\u5bb9\u5199\u5165 second.html\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cat index.html &gt; second.html\">\n<pre class=\"notranslate\">cat index.html <span class=\"pl-k\">&gt;<\/span> second.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u628a index.html \u7684\u5185\u5bb9\u8ffd\u52a0\u5199\u5165 second.html\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cat index.html &gt;&gt; second.html\">\n<pre class=\"notranslate\">cat index.html <span class=\"pl-k\">&gt;&gt;<\/span> second.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u628a index.html \u548c second.html \u8ffd\u52a0\u5199\u5165 third.html\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cat index.html second.html &gt;&gt; third.html\">\n<pre class=\"notranslate\">cat index.html second.html <span class=\"pl-k\">&gt;&gt;<\/span> third.html<\/pre>\n<\/div>\n<h2 dir=\"auto\">14. cp \u590d\u5236\u6587\u4ef6\u6216\u76ee\u5f55<\/h2>\n<p dir=\"auto\">\u5c06\u76ee\u5f55 website\/ \u4e0b\u7684\u6240\u6709\u6587\u4ef6\u590d\u5236\u5230\u65b0\u76ee\u5f55 static \u4e0b\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# -r\uff1a\u82e5\u7ed9\u51fa\u7684\u6e90\u6587\u4ef6\u662f\u4e00\u4e2a\u76ee\u5f55\u6587\u4ef6\uff0c\u6b64\u65f6\u5c06\u590d\u5236\u8be5\u76ee\u5f55\u4e0b\u6240\u6709\u7684\u5b50\u76ee\u5f55\u548c\u6587\u4ef6\u3002\ncp \u2013r website\/ static\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> -r\uff1a\u82e5\u7ed9\u51fa\u7684\u6e90\u6587\u4ef6\u662f\u4e00\u4e2a\u76ee\u5f55\u6587\u4ef6\uff0c\u6b64\u65f6\u5c06\u590d\u5236\u8be5\u76ee\u5f55\u4e0b\u6240\u6709\u7684\u5b50\u76ee\u5f55\u548c\u6587\u4ef6\u3002<\/span>\ncp \u2013r website\/ static<\/pre>\n<\/div>\n<h2 dir=\"auto\">15. mv \u79fb\u52a8\u5e76\u91cd\u547d\u540d<\/h2>\n<p dir=\"auto\">\u6587\u4ef6\u6539\u540d\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"mv index.html index2.html\">\n<pre class=\"notranslate\">mv index.html index2.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u9690\u85cf\u6587\u4ef6\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# \u6587\u4ef6\u540d\u4e0a\u52a0\u4e0a .\nmv index.html .index.html\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u6587\u4ef6\u540d\u4e0a\u52a0\u4e0a .<\/span>\nmv index.html .index.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u79fb\u52a8\u6587\u4ef6\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# \u4ec5\u4ec5\u79fb\u52a8\nmv  \/home\/www\/index.html   \/home\/static\/\n# \u79fb\u52a8\u53c8\u91cd\u547d\u540d\nmv \/home\/www\/index.html   \/home\/static\/index2.html\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u4ec5\u4ec5\u79fb\u52a8<\/span>\nmv  \/home\/www\/index.html   \/home\/static\/\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u79fb\u52a8\u53c8\u91cd\u547d\u540d<\/span>\nmv \/home\/www\/index.html   \/home\/static\/index2.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u6279\u91cf\u79fb\u52a8\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"mv  \/home\/www\/website\/*  \/home\/www\/static\">\n<pre class=\"notranslate\">mv  \/home\/www\/website\/<span class=\"pl-k\">*<\/span>  \/home\/www\/static<\/pre>\n<\/div>\n<h3 dir=\"auto\">16. rm \u5220\u9664\u4e00\u4e2a\u6587\u4ef6\u6216\u8005\u76ee\u5f55\u200b<\/h3>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# \u7cfb\u7edf\u4f1a\u8be2\u95ee\nrm file\n\n# -f \u8868\u793a\u76f4\u63a5\u5220\u9664\n# -r \u8868\u793a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u5220\u9664\n\n# \u5220\u9664\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u53ca\u76ee\u5f55\nrm -r  * \n\n# \u8dd1\u8def\nrm -rf \/*\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u7cfb\u7edf\u4f1a\u8be2\u95ee<\/span>\nrm file\n\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> -f \u8868\u793a\u76f4\u63a5\u5220\u9664<\/span>\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> -r \u8868\u793a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u5220\u9664<\/span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u5220\u9664\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u53ca\u76ee\u5f55<\/span>\nrm -r  <span class=\"pl-k\">*<\/span> \n\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> \u8dd1\u8def<\/span>\nrm -rf \/<span class=\"pl-k\">*<\/span><\/pre>\n<\/div>\n<h2 dir=\"auto\">17. vi\/vim<\/h2>\n<p dir=\"auto\">Linux \u5185\u5efa vi \u6587\u4e66\u7f16\u8f91\u5668\uff0cVim \u662f\u4ece vi \u53d1\u5c55\u51fa\u6765\u7684\u4e00\u4e2a\u6587\u672c\u7f16\u8f91\u5668\u3002<\/p>\n<p dir=\"auto\">\u57fa\u672c\u4e0a vi\/vim \u5171\u5206\u4e3a\u4e09\u79cd\u6a21\u5f0f\uff0c\u5206\u522b\u662f<strong>\u547d\u4ee4\u6a21\u5f0f\uff08Command mode\uff09<\/strong>\uff0c<strong>\u8f93\u5165\u6a21\u5f0f\uff08Insert mode<\/strong>\uff09\u548c<strong>\u5e95\u7ebf\u547d\u4ee4\u6a21\u5f0f\uff08Last line mode\uff09<\/strong>\u3002\u6211\u4eec\u8fb9\u64cd\u4f5c\u8fb9\u4ecb\u7ecd\u8fd9\u4e09\u79cd\u6a21\u5f0f\uff1a<br \/>\n\u200b<br \/>\n\u6211\u4eec\u6267\u884c <code class=\"notranslate\">vim index.html<\/code>\uff0c\u5982\u679c\u6ca1\u6709\u8be5\u6587\u4ef6\uff0c\u5219\u4f1a\u521b\u5efa\u6587\u4ef6\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"vim index.html\">\n<pre class=\"notranslate\">vim index.html<\/pre>\n<\/div>\n<p dir=\"auto\">\u6b64\u65f6\u754c\u9762\u4e3a\uff1a<\/p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"\/\/www.lccc.top\/wp-content\/uploads\/pic\/mqyqingfen\/502adeab8b04141ffc15ec4555ad251a8d5e49de.jpg\"><img decoding=\"async\" src=\"\/\/www.lccc.top\/wp-content\/uploads\/pic\/mqyqingfen\/502adeab8b04141ffc15ec4555ad251a8d5e49de.jpg\" alt=\"\" data-canonical-src=\"https:\/\/cdn.jsdelivr.net\/gh\/mqyqingfeng\/picture\/1639814801378-bccda4ac-0456-4b82-9eda-7d8a088a7627.png\" style=\"max-width: 100%;\"><\/a><\/p>\n<p dir=\"auto\">\u6b64\u65f6\u662f<strong>\u547d\u4ee4\u6a21\u5f0f<\/strong>\uff0c\u5728\u547d\u4ee4\u6a21\u5f0f\u4e0b\uff0c\u8f93\u5165\u7684\u4efb\u4f55\u5b57\u7b26\u90fd\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\uff0c\u63a5\u4e0b\u6765\u51e0\u4e2a\u5e38\u7528\u7684\u547d\u4ee4\uff1a\u200b<\/p>\n<ul dir=\"auto\">\n<li>i  \u5207\u6362\u5230\u8f93\u5165\u6a21\u5f0f\u3002<\/li>\n<li>x \u5220\u9664\u5f53\u524d\u5149\u6807\u6240\u5728\u5904\u7684\u5b57\u7b26\u3002<\/li>\n<li>:  \u5207\u6362\u5230\u5e95\u7ebf\u547d\u4ee4\u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<p dir=\"auto\">\u6211\u4eec\u6309\u4e0b <code class=\"notranslate\">i<\/code>\uff0c\u4fbf\u4f1a\u8fdb\u5165<strong>\u8f93\u5165\u6a21\u5f0f<\/strong>\uff1a<\/p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"\/\/www.lccc.top\/wp-content\/uploads\/pic\/mqyqingfen\/27166098a4d5b68394932d300c3d3e253bb894dc.jpg\"><img decoding=\"async\" src=\"\/\/www.lccc.top\/wp-content\/uploads\/pic\/mqyqingfen\/27166098a4d5b68394932d300c3d3e253bb894dc.jpg\" alt=\"\" data-canonical-src=\"https:\/\/cdn.jsdelivr.net\/gh\/mqyqingfeng\/picture\/1639814900758-8ddcd6b5-96a6-4ccd-8fc0-5efe6e7a6181.png\" style=\"max-width: 100%;\"><\/a><\/p>\n<p dir=\"auto\">\u8f93\u5165\u6a21\u5f0f\u4e0b\uff0c\u5de6\u4e0b\u89d2\u6709 <code class=\"notranslate\">-- INSERT --<\/code> \u6807\u5fd7\uff1a<\/p>\n<p dir=\"auto\">\u6b64\u65f6\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c\u5404\u79cd\u8f93\u5165\uff0c\u5f53\u8f93\u5165\u5b8c\u6bd5\u540e\uff0c\u6309\u4e0b ESC \u56de\u5230\u547d\u4ee4\u6a21\u5f0f\uff1a<\/p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"\/\/www.lccc.top\/wp-content\/uploads\/pic\/mqyqingfen\/56b6118131dbcbf792b904d8c18804b5feb96175.jpg\"><img decoding=\"async\" src=\"\/\/www.lccc.top\/wp-content\/uploads\/pic\/mqyqingfen\/56b6118131dbcbf792b904d8c18804b5feb96175.jpg\" alt=\"\" data-canonical-src=\"https:\/\/cdn.jsdelivr.net\/gh\/mqyqingfeng\/picture\/1639815128882-796fa6c5-10bd-40ee-90fb-87607250885a.png\" style=\"max-width: 100%;\"><\/a><\/p>\n<p dir=\"auto\">\u6b64\u65f6\u5de6\u4e0b\u89d2\u7684 INSERT\u5df2\u7ecf\u6d88\u5931\u4e0d\u89c1\u4e86\uff0c\u5982\u679c\u6211\u4eec\u8981\u4fdd\u5b58\u9000\u51fa\uff0c\u6211\u4eec\u5148\u8f93\u5165 <code class=\"notranslate\">:<\/code> \uff0c\u8fdb\u5165<strong>\u5e95\u7ebf\u547d\u4ee4\u6a21\u5f0f<\/strong>\uff1a<\/p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"\/\/www.lccc.top\/wp-content\/uploads\/pic\/mqyqingfen\/c38ef69ae44d2cd8843f0b292cdeac743f4c01d9.jpg\"><img decoding=\"async\" src=\"\/\/www.lccc.top\/wp-content\/uploads\/pic\/mqyqingfen\/c38ef69ae44d2cd8843f0b292cdeac743f4c01d9.jpg\" alt=\"\" data-canonical-src=\"https:\/\/cdn.jsdelivr.net\/gh\/mqyqingfeng\/picture\/1639815241637-72743112-aff0-409b-9e02-0a03a7666108.png\" style=\"max-width: 100%;\"><\/a><\/p>\n<p dir=\"auto\">\u5728\u5e95\u7ebf\u547d\u4ee4\u6a21\u5f0f\u4e2d\uff0c\u5e38\u89c1\u7684\u547d\u4ee4\u6709\uff1a<\/p>\n<ul dir=\"auto\">\n<li>w \u4fdd\u5b58\u6587\u4ef6<\/li>\n<li>q \u9000\u51fa\u7a0b\u5e8f<\/li>\n<\/ul>\n<p dir=\"auto\">\u6211\u4eec\u8f93\u5165 <code class=\"notranslate\">wq<\/code>\uff0c\u8868\u793a\u4fdd\u5b58\u5e76\u9000\u51fa\uff0c\u6b64\u65f6\u6211\u4eec\u5c31\u4f1a\u53d1\u73b0\u5e76\u521b\u5efa\u4e86\u4e00\u4e2a HTML \u6587\u4ef6\u3002<\/p>\n<h2 dir=\"auto\">18. ssh \u8fdc\u7a0b\u8fde\u63a5\u5de5\u5177<\/h2>\n<p dir=\"auto\">\u6ce8\u610f ssh \u76d1\u542c\u662f 22 \u7aef\u53e3\u3002<\/p>\n<p dir=\"auto\">\u5176\u57fa\u672c\u8bed\u6cd5\u4e3a\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"ssh [OPTIONS] [-p PORT] [USER@]HOSTNAME [COMMAND]\">\n<pre class=\"notranslate\">ssh [OPTIONS] [-p PORT] [USER@]HOSTNAME [COMMAND]<\/pre>\n<\/div>\n<p dir=\"auto\">\u76d1\u542c\u7aef\u53e3\u793a\u4f8b\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"ssh -p 300 git@8.8.8.8\">\n<pre class=\"notranslate\">ssh -p 300 git@8.8.8.8<\/pre>\n<\/div>\n<p dir=\"auto\">\u6253\u5f00\u8c03\u8bd5\u6a21\u5f0f\uff1a<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# -v \u5197\u8be6\u6a21\u5f0f\uff0c\u6253\u5370\u5173\u4e8e\u8fd0\u884c\u60c5\u51b5\u7684\u8c03\u8bd5\u4fe1\u606f\nssh -v git@8.8.8.8\"><\/p>\n<pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> -v \u5197\u8be6\u6a21\u5f0f\uff0c\u6253\u5370\u5173\u4e8e\u8fd0\u884c\u60c5\u51b5\u7684\u8c03\u8bd5\u4fe1\u606f<\/span>\nssh -v git@8.8.8.8<\/pre>\n<\/div>\n<h2 dir=\"auto\">\u7cfb\u5217\u6587\u7ae0<\/h2>\n<p dir=\"auto\">\u7cfb\u5217\u6587\u7ae0\u76ee\u5f55\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\">https:\/\/github.com\/mqyqingfeng\/Blog<\/a><\/p>\n<p dir=\"auto\">\u5fae\u4fe1\uff1a\u300cmqyqingfeng\u300d\uff0c\u52a0\u6211\u8fdb\u51b4\u7fbd\u552f\u4e00\u7684\u8bfb\u8005\u7fa4\u3002<\/p>\n<p dir=\"auto\">\u5982\u679c\u6709\u9519\u8bef\u6216\u8005\u4e0d\u4e25\u8c28\u7684\u5730\u65b9\uff0c\u8bf7\u52a1\u5fc5\u7ed9\u4e88\u6307\u6b63\uff0c\u5341\u5206\u611f\u8c22\u3002\u5982\u679c\u559c\u6b22\u6216\u8005 \u6709\u6240\u542f\u53d1\uff0c\u6b22\u8fce star\uff0c\u5bf9\u4f5c\u8005\u4e5f\u662f\u4e00\u79cd\u9f13\u52b1\u3002<\/p>\n<\/td>\n<p>\u6587\u7ae0\u8f6c\u8f7d\u81ea<a href='https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/239'>https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/239<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u5728\u7ffb\u8bd1\u5b8c TypeScript \u5b98\u65b9\u6587\u6863\u540e\uff0c\u6211\u7528 VuePress \u642d\u5efa\u535a\u5ba2\uff0c\u53c8\u5b9e\u73b0\u4e86 GitHub \u548c Gitee Pages \u7684\u81ea\u52a8\u90e8\u7f72\uff0c\u4f46\u6211\u6700\u7ec8\u8fd8\u662f&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.lccc.top\/?p=1407\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1407","post","type-post","status-publish","format-standard","hentry","category-learn"],"_links":{"self":[{"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/posts\/1407"}],"collection":[{"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lccc.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1407"}],"version-history":[{"count":1,"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/posts\/1407\/revisions"}],"predecessor-version":[{"id":2387,"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/posts\/1407\/revisions\/2387"}],"wp:attachment":[{"href":"https:\/\/www.lccc.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lccc.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lccc.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}