{"id":251006,"date":"2022-08-31T10:29:46","date_gmt":"2022-08-31T02:29:46","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=251006"},"modified":"2022-08-25T14:30:09","modified_gmt":"2022-08-25T06:30:09","slug":"linux-guanli","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-guanli.html","title":{"rendered":"\u5728 Linux \u4e2d\u5982\u4f55\u4f7f\u7528\u547d\u4ee4\u884c\u7ba1\u7406\u6587\u4ef6"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5982\u679c\u4f60\u66f4\u559c\u6b22\u7528\u7ec8\u7aef\u4e0e\u7cfb\u7edf\u4ea4\u4e92\uff0c\u8bf7\u4e86\u89e3\u4e00\u4e0b\u6211\u6700\u559c\u6b22\u7684\u7ba1\u7406\u6587\u4ef6\u7684\u547d\u4ee4\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u5728\u5982 GNOME \u6216 KDE \u7b49\u56fe\u5f62\u684c\u9762\u4e2d\u4f7f\u7528\u9f20\u6807\u70b9\u51fb\u7ba1\u7406\u6587\u4ef6\u3002\u4f60\u70b9\u51fb\u6587\u4ef6\u7684\u56fe\u6807\uff0c\u5c06\u5b83\u79fb\u52a8\u5230\u53e6\u4e00\u4e2a\u6587\u4ef6\u5939\u4e2d\uff0c\u6216\u8005\u79fb\u52a8\u5230\u56de\u6536\u7ad9\u91cc\u3002\u56fe\u5f62\u4ea4\u4e92\u4f7f\u5f97\u684c\u9762\u8ba1\u7b97\u673a\u4fbf\u4e8e\u4f7f\u7528\u3002<\/p>\n

\u4f46\u662f\u5728 Linux \u4e2d\uff0c\u6211\u4eec\u5e76\u4e0d\u603b\u662f\u4e0e\u56fe\u5f62\u754c\u9762\u4ea4\u4e92\u3002\u5982\u679c\u4f60\u5728\u670d\u52a1\u5668\u4e0a\u5de5\u4f5c\uff0c\u90a3\u4e48\u4f60\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u547d\u4ee4\u884c\u6765\u89e3\u51b3\u95ee\u9898\u3002\u5373\u4f7f\u50cf\u6211\u8fd9\u6837\u4f7f\u7528\u684c\u9762\u7684\u7528\u6237\uff0c\u53ef\u80fd\u4e5f\u66f4\u559c\u6b22\u4f7f\u7528\u7ec8\u7aef\u548c\u547d\u4ee4\u884c\u548c\u7cfb\u7edf\u4ea4\u4e92\u3002\u6211\u503e\u5411\u4e8e\u901a\u8fc7\u547d\u4ee4\u884c\u8fd0\u884c\u547d\u4ee4\u6765\u7ba1\u7406\u6211\u7684\u6587\u4ef6\uff1a<\/p>\n

\u4f7f\u7528 ls \u663e\u793a\u6587\u4ef6<\/p>\n

\r\nls\r\n<\/pre>\n

\u5bf9\u4efb\u4f55\u4f7f\u7528\u547d\u4ee4\u884c\u7684\u4eba\u6765\u8bf4\uff0c\u5982\u679c\u4e0d\u77e5\u9053\u6709\u4ec0\u4e48\u6587\u4ef6\uff0c\u5de5\u4f5c\u5c06\u5f88\u96be\u8fdb\u884c\u4e0b\u53bb\u3002\u200b\u200bls \u547d\u4ee4\u200b\u200b\u200b \u4f1a\u7f57\u5217\u51fa\u6587\u4ef6\u5939\u4e2d\u7684\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u8981\u67e5\u770b Web \u670d\u52a1\u5668\u7684\u6587\u6863\u6839\u76ee\u5f55 \u200b\u200b\/var\/www\/html\u200b\u200b \u4e2d\u7684\u5185\u5bb9\uff0c\u4f60\u53ef\u4ee5\u952e\u5165\uff1a<\/p>\n

\r\n    ls \/var\/www\/html\r\n<\/pre>\n

\u5927\u591a\u6570\u60c5\u51b5\uff0c\u6211\u4f7f\u7528 \u200b\u200bls\u200b\u200b\u200b \u547d\u4ee4\u67e5\u770b\u5f53\u524d\u6587\u4ef6\u5939\u5185\u7684\u6587\u4ef6\u3002\u53ea\u9700\u8981\u8f93\u5165 \u200b\u200bls\u200b\u200b\u200b \u5373\u53ef\u67e5\u770b\u6240\u6709\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u5f53\u6211\u5728\u6211\u7684\u7f51\u9875\u9879\u76ee\u7684\u6839\u76ee\u5f55\u65f6\uff0c\u8f93\u5165 \u200b\u200bls\u200b\u200b \u540e\u53ef\u4ee5\u770b\u5230\u8fd9\u4e9b\uff1a<\/p>\n

\r\n    $ ls\r\n    about  fontawesome      fonts   index.php  styles\r\n    docs   fontawesome.zip  images  prism\r\n<\/pre>\n

\u200b\u200bls\u200b\u200b\u200b \u547d\u4ee4\u5305\u542b 60 \u79cd\u9009\u9879\uff0c\u53ef\u4ee5\u4ee5\u4efb\u610f\u65b9\u5f0f\u663e\u793a\u6587\u4ef6\u548c\u76ee\u5f55\u3002\u200b\u200b-l\u200b\u200b \u662f\u4e00\u4e2a\u5f88\u6709\u7528\u7684\u9009\u9879\uff0c\u53ef\u4ee5\u8be6\u7ec6\u7684\u663e\u793a\u6587\u4ef6\uff0c\u5305\u542b\u6743\u9650\u3001\u6587\u4ef6\u5927\u5c0f\u4ee5\u53ca\u6240\u6709\u8005\u7b49\u4fe1\u606f\u3002<\/p>\n

\r\n    $ ls -l\r\n    total 6252\r\n    drwxrwxr-x. 2 jhall jhall    4096 Jun 22 16:18 about\r\n    drwxr-xr-x. 2 jhall jhall    4096 Jun 25 16:35 docs\r\n    drwxr-xr-x. 2 jhall jhall    4096 Jun  7 00:00 fontawesome\r\n    -rw-r--r--. 1 jhall jhall 6365962 Jun  2 16:26 fontawesome.zip\r\n    drwxrwxr-x. 2 jhall jhall    4096 Jun 22 16:17 fonts\r\n    drwxr-xr-x. 2 jhall jhall    4096 Jun 25 13:03 images\r\n    -rw-rw-r--. 1 jhall jhall     327 Jun 22 16:38 index.php\r\n    drwxrwxr-x. 2 jhall jhall    4096 Jun 22 16:18 prism\r\n    drwxrwxr-x. 2 jhall jhall    4096 Jun 22 16:17 styles\r\n<\/pre>\n

\u4e0a\u65b9\u7684\u6587\u4ef6\u5927\u5c0f\u662f\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff0c\u6216\u8bb8\u770b\u8d77\u6765\u6709\u70b9\u5403\u529b\u3002\u60f3\u8981\u4ee5\u65b9\u4fbf\u6211\u4eec\u9605\u8bfb\u7684\u683c\u5f0f\u67e5\u770b\u6587\u4ef6\u5927\u5c0f\uff0c\u53ea\u9700\u8981\u6dfb\u52a0 \u200b\u200b-h\u200b\u200b\u200b \u6216 \u200b\u200b--human-readable\u200b\u200b\u200b \u9009\u9879\uff0c\u80fd\u4ee5 \u200b\u200bG\u200b\u200b\u200b \u3001\u200b\u200bM\u200b\u200b\u200b \u3001\u200b\u200bK\u200b\u200b \u4e3a\u5355\u4f4d\u663e\u793a\u6587\u4ef6\u5927\u5c0f\u3002<\/p>\n

\u73b0\u5728\uff0c\u200b\u200bls\u200b\u200b\u200b \u5c06 zip \u6587\u4ef6\u663e\u793a\u4e3a \u200b\u200b6.1M\u200b\u200b\u200b \u6216\u521a\u521a\u8d85\u8fc7 6 MB \u7684\u6587\u4ef6\u5927\u5c0f\uff0c\u800c\u4e0d\u662f \u200b\u200b6365962\u200b\u200b\u3002<\/p>\n

\r\n    $ ls -l --human-readable\r\n    total 6.2M\r\n    drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:18 about\r\n    drwxr-xr-x. 2 jhall jhall 4.0K Jun 25 16:35 docs\r\n    drwxr-xr-x. 2 jhall jhall 4.0K Jun  7 00:00 fontawesome\r\n    -rw-r--r--. 1 jhall jhall 6.1M Jun  2 16:26 fontawesome.zip\r\n    drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:17 fonts\r\n    drwxr-xr-x. 2 jhall jhall 4.0K Jun 25 13:03 images\r\n    -rw-rw-r--. 1 jhall jhall  327 Jun 22 16:38 index.php\r\n    drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:18 prism\r\n    drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:17 styles\r\n<\/pre>\n

\u4f7f\u7528 cat\u3001head \u548c tail \u547d\u4ee4\u67e5\u770b\u6587\u4ef6<\/p>\n

\r\ncat\r\n\r\nhead\r\n\r\n\r\ntail\r\n<\/pre>\n

\u5f53\u663e\u793a\u51fa\u6587\u4ef6\u540e\uff0c\u9700\u8981\u68c0\u67e5\u6587\u4ef6\u5939\u4e2d\u7684\u5185\u5bb9\u3002\u4f7f\u7528\u5f88\u5c11\u51e0\u4e2a\u547d\u4ee4\u5373\u53ef\u505a\u5230\u3002\u4ee5\u6211\u7684 Web \u670d\u52a1\u5668\u4e2d\u7684 \u200b\u200bdocs\u200b\u200b \u6587\u4ef6\u5939\u4e3a\u4f8b\uff1a<\/p>\n

\r\n$ ls docs\r\n    chapter1.tex  chapter4.tex  chapter7.tex  lorem.txt\r\n    chapter2.tex  chapter5.tex  chapter8.tex  readme.txt\r\n    chapter3.tex  chapter6.tex  chapter9.tex  workbook.tex\r\n<\/pre>\n

\u8fd9\u4e9b\u6587\u4ef6\u662f\u4ec0\u4e48\uff1f\u6211\u4e0d\u77e5\u9053\uff0c\u5e78\u8fd0\u7684\u662f\u8be5\u76ee\u5f55\u4e2d\u6709\u4e00\u4e2a \u200b\u200breadme.txt\u200b\u200b\u200b \u6587\u4ef6\uff0c\u6211\u731c\u5b83\u5305\u542b\u4e86\u8fd9\u4e2a\u9879\u76ee\u76ee\u5f55\u4e2d\u6587\u4ef6\u7684\u63cf\u8ff0\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u662f\u5f88\u957f\uff0c\u90a3\u6211\u53ef\u4ee5\u4f7f\u7528 \u200b\u200bcat\u200b\u200b \u547d\u4ee4\u67e5\u770b\u5b83\uff1a<\/p>\n

\r\n    $ cat docs\/readme.txt \r\n    This is the workbook for the C programming self-paced\r\n    video series. The main file is the workbook.tex file,\r\n    which includes the other chapters.\r\n<\/pre>\n

\u5982\u679c\u8fd9\u4e2a\u6587\u4ef6\u5f88\u957f\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528 \u200b\u200bhead\u200b\u200b\u200b \u547d\u4ee4\u67e5\u770b\u6587\u4ef6\u7684\u524d\u51e0\u884c\u3002\u8be5\u547d\u4ee4\u901a\u5e38\u663e\u793a\u524d 10 \u884c\u7684\u5185\u5bb9\uff0c\u4e0d\u8fc7\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528 \u200b\u200b-n\u200b\u200b\u200b \u6216\u8005 \u200b\u200b--lines\u200b\u200b\u200b \u9009\u9879\u6765\u6307\u5b9a\u884c\u6570\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u8fd9\u4e24\u4e2a \u200b\u200bhead\u200b\u200b\u200b \u547d\u4ee4\u7684\u9009\u9879\u67e5\u770b \u200b\u200blorem.txt\u200b\u200b \u6587\u4ef6\u7684\u524d\u4e09\u884c\uff1a<\/p>\n

\r\n    $ head -n 3 docs\/lorem.txt \r\n    Lorem ipsum dolor sit amet, consectetur adipiscing\r\n    elit. Nullam at ligula eget nunc feugiat pharetra. Nullam\r\n    nec vulputate augue. Suspendisse tincidunt aliquet\r\n    $ head --lines=3 docs\/lorem.txt \r\n    Lorem ipsum dolor sit amet, consectetur adipiscing\r\n    elit. Nullam at ligula eget nunc feugiat pharetra. Nullam\r\n    nec vulputate augue. Suspendisse tincidunt aliquet\r\n<\/pre>\n

\u5982\u679c\u6211\u60f3\u8981\u67e5\u770b\u6587\u4ef6\u7684\u6700\u540e\u51e0\u884c\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u4ee5\u76f8\u540c\u65b9\u5f0f\u4f7f\u7528 \u200b\u200btail\u200b\u200b\u200b \u547d\u4ee4\u3002\u540c\u6837\uff0c\u8fd9\u4e24\u4e2a \u200b\u200btail\u200b\u200b\u200b \u547d\u4ee4\u5206\u522b\u663e\u793a \u200b\u200blorem.txt\u200b\u200b \u6587\u4ef6\u7684\u6700\u540e\u4e09\u884c\uff1a<\/p>\n

\r\n    $ tail -n 3 docs\/lorem.txt \r\n    egestas sodales. Vivamus tincidunt ex sed tellus tincidunt\r\n    varius. Nunc commodo volutpat risus, vitae luctus lacus\r\n    malesuada tempor. Nulla facilisi.\r\n    $ tail --lines=3 docs\/lorem.txt \r\n    egestas sodales. Vivamus tincidunt ex sed tellus tincidunt\r\n    varius. Nunc commodo volutpat risus, vitae luctus lacus\r\n    malesuada tempor. Nulla facilisi.\r\n<\/pre>\n

\u4f7f\u7528 \u200b\u200bhead\u200b\u200b\u200b \u548c \u200b\u200btail\u200b\u200b\u200b \u547d\u4ee4\u5728\u670d\u52a1\u5668\u4e2d\u67e5\u770b\u65e5\u5fd7\u6587\u4ef6\u5341\u5206\u6709\u7528\u3002\u6211\u6709\u4e00\u4e2a\u5c0f\u578b Web \u670d\u52a1\u5668\u8fd0\u884c\u5728\u5bb6\u5ead\u7f51\u7edc\uff0c\u7528\u4e8e\u5728\u7f51\u7ad9\u4e0a\u7ebf\u524d\u7684\u6d4b\u8bd5\u3002\u6700\u8fd1\u6211\u53d1\u73b0 Web \u670d\u52a1\u5668\u7684\u65e5\u5fd7\u5f88\u957f\uff0c\u6211\u597d\u5947\u5b83\u5b58\u5728\u591a\u4e45\u4e86\u3002\u4f7f\u7528 \u200b\u200bhead\u200b\u200b \u547d\u4ee4\uff0c\u6211\u53ea\u6253\u5370\u7b2c\u4e00\u884c\uff0c\u53ef\u4ee5\u770b\u5230\u8be5\u65e5\u5fd7\u6587\u4ef6\u662f\u5728 2020 \u5e74 12 \u6708\u521b\u5efa\u7684\uff1a<\/p>\n

\r\n    $ ls -l --human-readable \/var\/log\/httpd\r\n    total 13M\r\n    -rw-r--r--. 1 root root 13M Jun 25 16:23 access_log\r\n    -rw-r--r--. 1 root root 45K Jun  2 00:00 error_log\r\n    $ sudo head -n 1 \/var\/log\/httpd\/access_log\r\n    10.0.0.177 - - [05\/Dec\/2020:14:58:35 -0600] \"GET \/ HTTP\/1.1\" 403 5564 \"-\" \"Mozilla\/5.0 (X11; Fedora; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/87.0.4280.88 Safari\/537.36\"\r\n<\/pre>\n

\u4f7f\u7528 rm \u547d\u4ee4\u5220\u9664\u6587\u4ef6<\/p>\n

\r\nrm\r\n<\/pre>\n

\u5728\u5305\u542b\u793a\u4f8b\u6587\u672c\u6587\u4ef6\u7684\u76ee\u5f55\u4e2d\uff0c\u200b\u200blorem.txt\u200b\u200b\u200b \u6587\u4ef6\u4e2d\u5305\u542b \u201c\u4e71\u6570\u5047\u6587Lorem Ipsum\u201d \u6587\u672c\u3002\u8fd9\u53ea\u662f\u5370\u5237\u884c\u4e1a\u4e2d\u4f7f\u7528\u7684\u865a\u62df\u6587\u672c\uff0c\u56e0\u6b64 \u200b\u200blorem.txt\u200b\u200b\u200b \u6587\u4ef6\u5e76\u4e0d\u5c5e\u4e8e\u8be5\u9879\u76ee\u3002\u8ba9\u6211\u4eec\u7528 \u200b\u200brm\u200b\u200b \u547d\u4ee4\u5220\u9664\u8fd9\u6837\u7684\u6587\u4ef6\uff1a<\/p>\n

\r\n    $ ls docs\r\n    chapter1.tex  chapter4.tex  chapter7.tex  lorem.txt\r\n    chapter2.tex  chapter5.tex  chapter8.tex  readme.txt\r\n    chapter3.tex  chapter6.tex  chapter9.tex  workbook.tex\r\n    $ rm docs\/lorem.txt \r\n    $ ls docs\r\n    chapter1.tex  chapter4.tex  chapter7.tex  readme.txt\r\n    chapter2.tex  chapter5.tex  chapter8.tex  workbook.tex\r\n    chapter3.tex  chapter6.tex  chapter9.tex\r\n<\/pre>\n

\u7531\u4e8e\u7528 \u200b\u200brm\u200b\u200b\u200b \u547d\u4ee4\u5220\u9664\u7684\u6587\u4ef6\u4f1a\u76f4\u63a5\u5220\u9664\uff0c\u800c\u4e0d\u4f1a\u653e\u5165\u56de\u6536\u7ad9\uff0c\u56e0\u6b64\u5b83\u5f88\u5371\u9669\u3002\u5b89\u88c5 \u200b\u200btrash\u200b\u200b\u200b \u547d\u4ee4\u6bd4\u8f83\u5b89\u5168\uff0c\u4f8b\u5982 \u200b\u200btrashy\u200b\u200b\u200b \u6216 \u200b\u200btrash-cli\u200b\u200b \u547d\u4ee4\u3002\u8fd9\u6837\u4f60\u53ef\u4ee5\u5728\u6587\u4ef6\u6c38\u4e45\u5220\u9664\u524d\uff0c\u5c06\u5176\u653e\u5165\u6682\u5b58\u533a\u3002<\/p>\n

\r\n    $ rm docs\/lorem.txt\r\n<\/pre>\n

\u53ea\u9700\u5f88\u5c11\u7684\u547d\u4ee4\u5373\u53ef\u5728\u547d\u4ee4\u884c\u4e2d\u7ba1\u7406\u6587\u4ef6\u3002\u4f7f\u7528 \u200b\u200bls\u200b\u200b\u200b \u547d\u4ee4\u663e\u793a\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\uff0c\u4f7f\u7528 \u200b\u200bcat\u200b\u200b\u200b \u3001\u200b\u200bhead\u200b\u200b\u200b \u548c \u200b\u200btail\u200b\u200b\u200b \u547d\u4ee4\u67e5\u770b\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u3002\u4f7f\u7528 \u200b\u200brm\u200b\u200b\u200b \u6216\u8005\u5b89\u5168\u7684 \u200b\u200btrash\u200b\u200b\u200b \u547d\u4ee4\u5c06\u4e0d\u9700\u8981\u7684\u6587\u4ef6\u5220\u9664\u3002\u8fd9\u4e94\u4e2a\u547d\u4ee4\u8db3\u4ee5\u5e2e\u4f60\u5728 Linux \u4e2d\u7ba1\u7406\u6587\u4ef6\u3002\u60f3\u8981\u4e86\u89e3\u66f4\u591a\uff0c\u53ef\u4ee5\u4f7f\u7528 \u200b\u200b--help\u200b\u200b\u200b \u9009\u9879\u6765\u67e5\u770b\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u547d\u4ee4\u3002\u4f8b\u5982\u4f7f\u7528 \u200b\u200bls --help\u200b\u200b\u200b \u67e5\u770b \u200b\u200bls\u200b\u200b \u547d\u4ee4\u5982\u4f55\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u5982 GNOME \u6216 KDE \u7b49\u56fe\u5f62\u684c\u9762\u4e2d\u4f7f\u7528\u9f20\u6807\u70b9\u51fb\u7ba1\u7406\u6587\u4ef6\u3002\u4f60\u70b9\u51fb\u6587\u4ef6\u7684\u56fe\u6807\uff0c\u5c06\u5b83\u79fb\u52a8\u5230\u53e6\u4e00\u4e2a\u6587\u4ef6\u5939\u4e2d\uff0c\u6216 […]<\/p>\n","protected":false},"author":1469,"featured_media":251008,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-251006","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/251006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=251006"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/251006\/revisions"}],"predecessor-version":[{"id":251009,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/251006\/revisions\/251009"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/251008"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=251006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=251006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=251006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}