{"id":508,"date":"2025-03-09T01:52:20","date_gmt":"2025-03-08T17:52:20","guid":{"rendered":"https:\/\/www.ooboou.com\/?p=508"},"modified":"2025-03-09T01:58:59","modified_gmt":"2025-03-08T17:58:59","slug":"centos7-6%e8%af%a6%e7%bb%86%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"http:\/\/www.ooboou.com\/?p=508","title":{"rendered":"CentOS7.6\u8be6\u7ec6\u8bf4\u660e"},"content":{"rendered":"<h3>\u4e00\u3001Linux\u76ee\u5f55\u7ed3\u6784<\/h3>\n<ol>\n<li>\/bin\uff1a\u662f Binary \u7684\u7f29\u5199, \u8fd9\u4e2a\u76ee\u5f55\u5b58\u653e\u7740\u6700\u7ecf\u5e38\u4f7f\u7528\u7684\u547d\u4ee4\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/p>\n<\/li>\n<li>\n<p>\/sbin\uff1a\u5c31\u662f Super User \u7684\u610f\u601d\uff0c\u8fd9\u91cc\u5b58\u653e\u7684\u662f\u7cfb\u7edf\u7ba1\u7406\u5458\u4f7f\u7528\u7684\u7cfb\u7edf\u7ba1\u7406\u7a0b\u5e8f\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/p>\n<\/li>\n<li>\n<p>\/home\uff1a\u5b58\u653e\u666e\u901a\u7528\u6237\u7684\u4e3b\u76ee\u5f55\uff0c\u5728 Linux \u4e2d\u6bcf\u4e2a\u7528\u6237\u90fd\u6709\u4e00\u4e2a\u81ea\u5df1\u7684\u76ee\u5f55\uff0c\u4e00\u822c\u8be5\u76ee\u5f55\u540d\u662f\u4ee5\u7528\u6237\u7684\u8d26\u53f7\u547d\u540d\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/p>\n<\/li>\n<li>\n<p>\/root\uff1a\u8be5\u76ee\u5f55\u4e3a\u7cfb\u7edf\u7ba1\u7406\u5458\uff0c\u4e5f\u79f0\u4f5c\u8d85\u7ea7\u6743\u9650\u8005\u7684\u7528\u6237\u4e3b\u76ee\u5f55\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/p>\n<\/li>\n<li>\n<p>\/lib\uff1a\u7cfb\u7edf\u5f00\u673a\u6240\u9700\u8981\u6700\u57fa\u672c\u7684\u52a8\u6001\u8fde\u63a5\u5171\u4eab\u5e93\uff0c\u5176\u4f5c\u7528\u7c7b\u4f3c\u4e8e Windows \u91cc\u7684 DLL \u6587\u4ef6\u3002\u51e0\u4e4e\u6240\u6709\u7684\u5e94\u7528\u7a0b\u5e8f\u90fd\u9700\u8981<br \/>\n\u7528\u5230\u8fd9\u4e9b\u5171\u4eab\u5e93\u3002<\/p>\n<\/li>\n<li>\n<p>\/lost+found\uff1a\u8fd9\u4e2a\u76ee\u5f55\u4e00\u822c\u60c5\u51b5\u4e0b\u662f\u7a7a\u7684\uff0c\u5f53\u7cfb\u7edf\u975e\u6cd5\u5173\u673a\u540e\uff0c\u8fd9\u91cc\u5c31\u5b58\u653e\u4e86\u4e00\u4e9b\u6587\u4ef6\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u9690\u85cf\u76ee\u5f55]<\/span><\/p>\n<\/li>\n<li>\n<p>\/etc\uff1a\u6240\u6709\u7684\u7cfb\u7edf\u7ba1\u7406\u6240\u9700\u8981\u7684<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u914d\u7f6e\u6587\u4ef6<\/span>\u548c\u5b50\u76ee\u5f55, \u6bd4\u5982\u5b89\u88c5 mysql \u6570\u636e\u5e93 my.conf\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/p>\n<\/li>\n<li>\n<p>\/usr\uff1a\u8fd9\u662f\u4e00\u4e2a<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u975e\u5e38\u91cd\u8981\u7684\u76ee\u5f55<\/span>\uff0c\u7528\u6237\u7684\u5f88\u591a<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u5b89\u88c5\u7684\u5e94\u7528\u7a0b\u5e8f<\/span>\u548c\u6587\u4ef6\u90fd\u653e\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\uff0c\u7c7b\u4f3c\u4e0e windows \u4e0b\u7684 program files \u76ee\u5f55\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/p>\n<\/li>\n<li>\n<p>\/boot\uff1a<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u975e\u5e38\u91cd\u8981\u7684\u76ee\u5f55<\/span>\uff0c\u5b58\u653e\u7684\u662f\u542f\u52a8 Linux \u65f6\u4f7f\u7528\u7684\u4e00\u4e9b\u6838\u5fc3\u6587\u4ef6\uff0c\u5305\u62ec\u4e00\u4e9b\u8fde\u63a5\u6587\u4ef6\u4ee5\u53ca\u955c\u50cf\u6587\u4ef6\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/p>\n<\/li>\n<li>\n<p>\/proc\uff1a\u8fd9\u4e2a\u76ee\u5f55\u662f\u4e00\u4e2a\u865a\u62df\u7684\u76ee\u5f55\uff0c\u5b83\u662f\u7cfb\u7edf\u5185\u5b58\u7684\u6620\u5c04\uff0c\u8bbf\u95ee\u8fd9\u4e2a\u76ee\u5f55\u6765\u83b7\u53d6\u7cfb\u7edf\u4fe1\u606f\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u4e0d\u80fd\u52a8]<\/span><\/p>\n<\/li>\n<li>\n<p>\/srv\uff1aservice \u7f29\u5199\uff0c\u8be5\u76ee\u5f55\u5b58\u653e\u4e00\u4e9b\u670d\u52a1\u542f\u52a8\u4e4b\u540e\u9700\u8981\u63d0\u53d6\u7684\u6570\u636e\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u4e0d\u80fd\u52a8]<\/span><\/p>\n<\/li>\n<li>\n<p>\/sys\uff1a\u8fd9\u662f linux2.6 \u5185\u6838\u7684\u4e00\u4e2a\u5f88\u5927\u7684\u53d8\u5316\u3002\u8be5\u76ee\u5f55\u4e0b\u5b89\u88c5\u4e86 2.6 \u5185\u6838\u4e2d\u65b0\u51fa\u73b0\u7684\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf sysfs\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u4e0d\u80fd\u52a8]<\/span><\/p>\n<\/li>\n<li>\/tmp\uff1a\u8fd9\u4e2a\u76ee\u5f55\u662f\u7528\u6765\u5b58\u653e\u4e00\u4e9b\u4e34\u65f6\u6587\u4ef6\u7684\u3002<\/li>\n<li>\/dev\uff1a\u7c7b\u4f3c\u4e8e windows \u7684\u8bbe\u5907\u7ba1\u7406\u5668\uff0c\u628a\u6240\u6709\u7684\u786c\u4ef6\u7528\u6587\u4ef6\u7684\u5f62\u5f0f\u5b58\u50a8\u3002<\/li>\n<li>\/media\uff1alinux \u7cfb\u7edf\u4f1a\u81ea\u52a8\u8bc6\u522b\u4e00\u4e9b\u8bbe\u5907\uff0c\u4f8b\u5982 U \u76d8\u3001\u5149\u9a71\u7b49\u7b49\uff0c\u5f53\u8bc6\u522b\u540e\uff0clinux \u4f1a\u628a\u8bc6\u522b\u7684\u8bbe\u5907\u6302\u8f7d\u5230\u8fd9\u4e2a<br \/>\n\u76ee\u5f55\u4e0b\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/li>\n<li>\/mnt \uff1a\u7cfb\u7edf\u63d0\u4f9b\u8be5\u76ee\u5f55\u662f\u4e3a\u4e86\u8ba9\u7528\u6237\u4e34\u65f6<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6302\u8f7d\u522b\u7684\u6587\u4ef6\u7cfb\u7edf<\/span>\u7684\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u5916\u90e8\u7684\u5b58\u50a8\u6302\u8f7d\u5728\/mnt\/\u4e0a\uff0c\u7136\u540e\u8fdb\u5165\u8be5\u76ee\u5f55\u5c31\u53ef\u4ee5\u67e5\u770b\u91cc\u7684\u5185\u5bb9\u4e86\u3002 \u5982\uff1ad:\/myshare\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/li>\n<li>\/opt\uff1a\u8fd9\u662f\u7ed9\u4e3b\u673a\u5b89\u88c5\u8f6f\u4ef6\u7684<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u5b89\u88c5\u7a0b\u5e8f<\/span>\u6240\u5b58\u653e\u7684\u76ee\u5f55\u3002\u5982ORACLE\u6570\u636e\u5e93\u7684\u5b89\u88c5\u7a0b\u5e8f\u5c31\u53ef\u653e\u5230\u8be5\u76ee\u5f55\u4e0b\u3002\u9ed8\u8ba4\u4e3a\u7a7a\u3002<\/li>\n<li>\/usr\/local\uff1a\u8fd9\u662f\u53e6\u4e00\u4e2a\u7ed9\u4e3b\u673a\u989d\u5916\u5b89\u88c5\u8f6f\u4ef6\u6240\u5b89\u88c5\u5230\u7684\u76ee\u5f55\u3002\u4e00\u822c\u662f\u901a\u8fc7\u7f16\u8bd1\u6e90\u7801\u65b9\u5f0f\u5b89\u88c5\u7684\u7a0b\u5e8f\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/li>\n<li>\/var\uff1a\u8fd9\u4e2a\u76ee\u5f55\u4e2d\u5b58\u653e\u7740\u5728\u4e0d\u65ad\u6269\u5145\u7740\u7684\u4e1c\u897f\uff0c\u4e60\u60ef\u5c06\u7ecf\u5e38\u88ab\u4fee\u6539\u7684\u76ee\u5f55\u653e\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u3002\u5305\u62ec\u5404\u79cd\u65e5\u5fd7\u6587\u4ef6\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">[\u5e38\u7528]<\/span><\/li>\n<li>\/selinux [security-enhanced linux]\uff1aSELinux \u662f\u4e00\u79cd\u5b89\u5168\u5b50\u7cfb\u7edf,\u5b83\u80fd\u63a7\u5236\u7a0b\u5e8f\u53ea\u80fd\u8bbf\u95ee\u7279\u5b9a\u6587\u4ef6, \u6709\u4e09\u79cd\u5de5\u4f5c\u6a21\u5f0f\uff0c\u53ef\u4ee5\u81ea\u884c\u8bbe\u7f6e\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u7c7b\u4f3cwindows\u7684360\u5b89\u5168\u536b\u58eb\uff0c\u8be5\u6587\u4ef6\u5939\u9700\u529f\u80fd\u542f\u7528\u624d\u4f1a\u6709\uff0c\u5426\u5219\u6ca1\u6709<\/span>\u3002<\/li>\n<\/ol>\n<h3>\u4e8c\u3001Vi \u548c Vim \u7f16\u8f91\u5668<\/h3>\n<ol>\n<li>\u6b63\u5e38\u6a21\u5f0f\uff1a\u4ee5 vim \u6253\u5f00\u4e00\u4e2a\u6863\u6848\u5c31\u76f4\u63a5\u8fdb\u5165\u4e00\u822c\u6a21\u5f0f\u4e86(\u8fd9\u662f\u9ed8\u8ba4\u7684\u6a21\u5f0f\u9ed8\u8ba4\u7684\u6a21\u5f0f)\u3002<\/li>\n<li>\u63d2\u5165\u6a21\u5f0f\uff1a\u6309\u4e0b i, I, o, O, a, A, r, R \u7b49\u4efb\u4f55\u4e00\u4e2a\u5b57\u6bcd\u4e4b\u540e\u624d\u4f1a\u8fdb\u5165\u7f16\u8f91\u6a21\u5f0f, \u4e00\u822c\u6765\u8bf4\u6309 i \u5373\u53ef\u3002<\/li>\n<li>\u547d\u4ee4\u884c\u6a21\u5f0f\uff1a\u8f93\u5165 esc \u518d\u8f93\u5165\u201d:\u201c\u3002<\/li>\n<li>vi \u548c vim \u5feb\u6377\u952e\uff1a\n<ul>\n<li>\u62f7\u8d1d\u5f53\u524d\u884cyy , \u62f7\u8d1d\u5f53\u524d\u884c\u5411\u4e0b\u7684 5 \u884c5yy\uff0c\u5e76\u7c98\u8d34\uff08\u8f93\u5165 p\uff09\u3002<\/li>\n<li>\u5220\u9664\u5f53\u524d\u884cdd, \u5220\u9664\u5f53\u524d\u884c\u5411\u4e0b\u7684 5 \u884c 5dd\u3002<\/li>\n<li>\u5728\u6587\u4ef6\u4e2d\u67e5\u627e\u67d0\u4e2a\u5355\u8bcd [\u547d\u4ee4\u884c\u4e0b \/\u5173\u952e\u5b57 \uff0c \u56de\u8f66 \u67e5\u627e ,\u8f93\u5165 n \u5c31\u662f\u67e5\u627e\u4e0b\u4e00\u4e2a ]\u3002<\/li>\n<li>\u8bbe\u7f6e\u6587\u4ef6\u7684\u884c\u53f7\uff0c\u53d6\u6d88\u6587\u4ef6\u7684\u884c\u53f7[\u547d\u4ee4\u884c\u4e0b: set nu \u548c:set nonu]\u3002<\/li>\n<li>\u7f16\u8f91 \/etc\/profile \u6587\u4ef6\uff0c\u5728\u4e00\u822c\u6a21\u5f0f\u4e0b, \u4f7f\u7528\u5feb\u6377\u952e\u5230\u8be5\u6587\u6863\u7684\u6700\u672b\u884c[G]\u548c\u6700\u9996\u884c[gg]\u3002<\/li>\n<li>\u5728\u4e00\u4e2a\u6587\u4ef6\u4e2d\u8f93\u5165 &#8220;hello&#8221; ,\u5728\u4e00\u822c\u6a21\u5f0f\u4e0b, \u7136\u540e\u53c8\u64a4\u9500\u8fd9\u4e2a\u52a8\u4f5c[u]\u3002<\/li>\n<li>\u7f16\u8f91\/etc\/profile \u6587\u4ef6\uff0c\u5728\u4e00\u822c\u6a21\u5f0f\u4e0b,\u5e76\u5c06\u5149\u6807\u79fb\u52a8\u5230\u7b2c20\u884c\uff1a\u8f93\u5165 20,\u518d\u8f93\u5165[shift+g]\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u4e09\u3001\u5f00\u673a\u3001\u91cd\u542f<\/h3>\n<ol>\n<li>shutdown \u2013h now \u8bf4\u660e\uff1a\u7acb\u8be5\u8fdb\u884c\u5173\u673a\u3002<\/li>\n<li>shutdown -h 1 &#8220;hello, 1 \u5206\u949f\u540e\u4f1a\u5173\u673a\u4e86&#8221; \u8bf4\u660e\uff1a1 \u5206\u949f\u540e\u4f1a\u5173\u673a\uff0c\u5e76\u63d0\u793a\u8bf4\u660e\u201chello, 1 \u5206\u949f\u540e\u4f1a\u5173\u673a\u4e86\u201d\u3002<\/li>\n<li>shutdown \u2013r now \u8bf4\u660e\uff1a\u73b0\u5728\u91cd\u65b0\u542f\u52a8\u8ba1\u7b97\u673a\u3002<\/li>\n<li>halt \u8bf4\u660e\uff1a\u5173\u673a\uff0c\u4f5c\u7528\u548c\u4e0a\u9762\u4e00\u6837\u3002<\/li>\n<li>reboot \u8bf4\u660e\uff1a\u73b0\u5728\u91cd\u65b0\u542f\u52a8\u8ba1\u7b97\u673a\u3002<\/li>\n<li>sync \u8bf4\u660e\uff1a\u628a\u5185\u5b58\u7684\u6570\u636e\u540c\u6b65\u5230\u78c1\u76d8\u3002<\/li>\n<li><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\u7ec6\u8282\uff1a<\/span>\n<ul>\n<li>\u4e0d\u7ba1\u662f\u91cd\u542f\u7cfb\u7edf\u8fd8\u662f\u5173\u95ed\u7cfb\u7edf\uff0c\u9996\u5148\u8981\u8fd0\u884c sync \u547d\u4ee4\uff0c\u628a\u5185\u5b58\u4e2d\u7684\u6570\u636e\u5199\u5230\u78c1\u76d8\u4e2d\u3002<\/li>\n<li>\u76ee\u524d\u7684 shutdown\/reboot\/halt \u7b49\u547d\u4ee4\u5747\u5df2\u7ecf\u5728\u5173\u673a\u524d\u8fdb\u884c\u4e86 sync \uff0c\u63d0\u9192: \u5c0f\u5fc3\u9a76\u5f97\u4e07\u5e74\u8239\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u56db\u3001\u7528\u6237\u767b\u5f55\u3001\u6ce8\u9500<\/h3>\n<ol>\n<li>\u5207\u6362\u6210\u7cfb\u7edf\u7ba1\u7406\u5458\u8eab\u4efd\uff1a\n<ul>\n<li>su &#8211; root\uff0c\u7136\u540e\u8f93\u5165root\u7528\u6237\u7684\u5bc6\u7801\u3002<\/li>\n<li>sudo su\uff0c\u7136\u540e\u8f93\u5165root\u7528\u6237\u7684\u5bc6\u7801<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\uff08\u8981\u6c42\uff1a\u5f53\u524d\u7528\u6237\u540d\u8981\u5728sudoers\u6587\u4ef6\u4e2d\uff09<\/span>\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u6ce8\u9500\u7528\u6237\uff1alogout\u3002<\/li>\n<li><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\u7ec6\u8282\uff1a<\/span>\n<ul>\n<li>logout \u6ce8\u9500\u6307\u4ee4\u5728\u56fe\u5f62\u8fd0\u884c\u7ea7\u522b\u65e0\u6548\uff0c\u5728\u8fd0\u884c\u7ea7\u522b 3 \u4e0b\u6709\u6548\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u4e94\u3001\u7528\u6237\u7ba1\u7406<\/h3>\n<ol>\n<li>\n<p>\u663e\u793a\u5f53\u524d\u7528\u6237\u6240\u5728\u8def\u5f84\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# pwd\n\/root\n<\/code><\/pre>\n<\/li>\n<li>\u6dfb\u52a0\u7528\u6237\uff1auseradd \u7528\u6237\u540d\uff0c\u4f8b\u5982\uff1a\n<pre><code class=\"language-shell line-numbers\">useradd milan\n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\u7ec6\u8282\uff1a<\/span>\u6dfb\u52a0\u4e00\u4e2a\u7528\u6237 milan, \u9ed8\u8ba4\u8be5\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u5728 \/home\/milan\u3002<\/p>\n<\/li>\n<li>\n<p>\u6dfb\u52a0\u7528\u6237\uff1auseradd -d \u76ee\u5f55\u540d \u7528\u6237\u540d\u3002<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\u7ec6\u8282\uff1a<\/span>\u65b0\u7684\u7528\u6237\u540d\u6307\u5b9a\u76ee\u5f55\u540d\uff0c\u7ed9\u65b0\u521b\u5efa\u7684\u7528\u6237\u6307\u5b9a\u5bb6\u76ee\u5f55\u3002<\/p>\n<\/li>\n<li>\n<p>\u6307\u5b9a\/\u4fee\u6539\u5bc6\u7801\uff1apasswd \u7528\u6237\u540d\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# passwd milan\n\u66f4\u6539\u7528\u6237 milan \u7684\u5bc6\u7801 \u3002\n\u65b0\u7684 \u5bc6\u7801\uff1a\n\u65e0\u6548\u7684\u5bc6\u7801\uff1a \u5bc6\u7801\u5c11\u4e8e 8 \u4e2a\u5b57\u7b26\n\u91cd\u65b0\u8f93\u5165\u65b0\u7684 \u5bc6\u7801\uff1a\npasswd\uff1a\u6240\u6709\u7684\u8eab\u4efd\u9a8c\u8bc1\u4ee4\u724c\u5df2\u7ecf\u6210\u529f\u66f4\u65b0\u3002\n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\uff1a\u5982\u679cpasswd\u540e\u9762\u6ca1\u6709\u8ddf\u7528\u6237\u540d\uff0c\u5c31\u662f\u7ed9\u5f53\u524d\u767b\u5f55\u7528\u6237\u4fee\u6539\u5bc6\u7801\u3002<\/span><\/p>\n<\/li>\n<li>\n<p>\u5220\u9664\u7528\u6237\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u4fdd\u7559\u5bb6\u76ee\u5f55:<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# userdel milan\n[root@alanCentos01 ~]# ls -l \/home\n\u603b\u7528\u91cf 8\ndrwx------. 5 alan alan 4096 4\u6708   5 23:17 alan\ndrwx------. 3 1001 1001 4096 4\u6708   6 21:45 milan\n<\/code><\/pre>\n<\/li>\n<li>\u4e0d\u4fdd\u7559\u5bb6\u76ee\u5f55:\n<pre><code class=\"language-shell line-numbers\">userdel -r milan\n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\u7ec6\u8282\uff1a<\/span>\u662f\u5426\u4fdd\u7559\u5bb6\u76ee\u5f55\u7684\u8ba8\u8bba? \u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u5efa\u8bae\u4fdd\u7559\u3002<\/p>\n<\/li>\n<\/ul>\n<ol start=\"6\">\n<li>\n<p>\u67e5\u8be2\u7528\u6237\u4fe1\u606f\u6307\u4ee4\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# id alan\nuid=1000(alan) gid=1000(alan) \u7ec4=1000(alan)\n[root@alanCentos01 ~]# id jerry\nid: jerry: no such user\n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\u7ec6\u8282\uff1a<\/span>\u5f53\u7528\u6237\u4e0d\u5b58\u5728\u65f6\uff0c\u8fd4\u56de\u65e0\u6b64\u7528\u6237\u3002<\/p>\n<\/li>\n<li>\n<p>\u5207\u6362\u7528\u6237\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# su - alan\n\u4e0a\u4e00\u6b21\u767b\u5f55\uff1a\u4e00 4\u6708  5 23:13:40 CST 2021\u4ece 192.168.18.1pts\/0 \u4e0a\n[alan@alanCentos01 ~]$ \n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\u7ec6\u8282\uff1a<\/span><\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\u4ece\u6743\u9650\u9ad8\u7684\u7528\u6237\u5207\u6362\u5230\u6743\u9650\u4f4e\u7684\u7528\u6237\uff0c\u4e0d\u9700\u8981\u8f93\u5165\u5bc6\u7801\uff0c\u53cd\u4e4b\u9700\u8981\u3002<\/li>\n<li>\u5f53\u9700\u8981\u8fd4\u56de\u5230\u539f\u6765\u7528\u6237\u65f6\uff0c\u4f7f\u7528 exit\/logout \u6307\u4ee4\u3002<\/li>\n<\/ul>\n<ol start=\"8\">\n<li>\n<p>\u67e5\u770b\u5f53\u524d\u7528\u6237\/\u767b\u5f55\u7528\u6237\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# whoami\nroot\n[alan@alanCentos01 ~]$ who am i\nroot     pts\/0        2021-04-06 21:44 (192.168.18.1)\n<\/code><\/pre>\n<\/li>\n<li>\u65b0\u589e\u7528\u6237\u7ec4\uff1a\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# groupadd wudang\n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<\/li>\n<li>\u5220\u9664\u7528\u6237\u7ec4\uff1a\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# groupdel wudang\n[root@alanCentos01 ~]#\n\n<\/code><\/pre>\n<\/li>\n<li>\u589e\u52a0\u7528\u6237\u65f6\u76f4\u63a5\u52a0\u4e0a\u7ec4\uff1a\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# groupadd wudang\n[root@alanCentos01 ~]# useradd -g wudang zwj\n[root@alanCentos01 ~]# id zwj\nuid=1001(zwj) gid=1001(wudang) \u7ec4=1001(wudang)\n\n<\/code><\/pre>\n<\/li>\n<li>\u4fee\u6539\u7528\u6237\u7684\u7ec4\uff1a\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# groupadd mojiao\n[root@alanCentos01 ~]# usermod -g mojiao zwj\n[root@alanCentos01 ~]# id zwj\nuid=1001(zwj) gid=1002(mojiao) \u7ec4=1002(mojiao)\n\n<\/code><\/pre>\n<\/li>\n<li>\u7528\u6237\u548c\u7ec4\u76f8\u5173\u6587\u4ef6\uff1a\n<ul>\n<li>\/etc\/passwd\u6587\u4ef6\uff1a\u7528\u6237\uff08user\uff09\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u8bb0\u5f55\u7528\u6237\u7684\u5404\u79cd\u4fe1\u606f\u3002\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# cat \/etc\/passwd |grep \"zwj\"\nzwj:x:1001:1002::\/home\/zwj:\/bin\/bash\n\n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6bcf\u884c\u7684\u542b\u4e49<\/span>\uff1a\u7528\u6237\u540d:\u53e3\u4ee4:\u7528\u6237\u6807\u8bc6\u53f7:\u7ec4\u6807\u8bc6\u53f7:\u6ce8\u91ca\u6027\u63cf\u8ff0:\u4e3b\u76ee\u5f55:\u767b\u5f55Shell\u3002<\/p>\n<\/li>\n<li>\n<p>\/etc\/shadow\u6587\u4ef6\uff1a\u53e3\u4ee4\u7684\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# cat \/etc\/shadow |grep \"zwj\"\nzwj:!!:18723:0:99999:7:::\n\n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6bcf\u884c\u7684\u542b\u4e49<\/span>\uff1a\u767b\u5f55\u540d:\u52a0\u5bc6\u53e3\u4ee4:\u6700\u540e\u4e00\u6b21\u4fee\u6539\u65f6\u95f4:\u6700\u5c0f\u65f6\u95f4\u95f4\u9694:\u6700\u5927\u65f6\u95f4\u95f4\u9694:\u8b66\u544a\u65f6\u95f4:\u4e0d\u6d3b\u52a8\u65f6\u95f4:\u5931\u6548\u65f6\u95f4:\u6807\u5fd7\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\uff1a\u201d!!\u201c\u8868\u793a\u6ca1\u6709\u8bbe\u7f6e\u5bc6\u7801\u3002<\/span><\/p>\n<\/li>\n<li>\n<p>\/etc\/group\u6587\u4ef6\uff1a\u7ec4(group)\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u8bb0\u5f55 Linux \u5305\u542b\u7684\u7ec4\u7684\u4fe1\u606f\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# cat \/etc\/group |grep \"mojiao\"\nmojiao:x:1002:\n\n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6bcf\u884c\u7684\u542b\u4e49<\/span>\uff1a\u7ec4\u540d:\u53e3\u4ee4:\u7ec4\u6807\u8bc6\u53f7:\u7ec4\u5185\u7528\u6237\u5217\u8868\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u516d\u3001\u8fd0\u884c\u7ea7\u522b\u6307\u4ee4<\/h3>\n<ol>\n<li>\u8fd0\u884c\u7ea7\u522b\uff1a<\/li>\n<\/ol>\n<ul>\n<li>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u8fd0\u884c\u7ea7\u522b\u8bf4\u660e(\u5e38\u7528\u8fd0\u884c\u7ea7\u522b\u662f 3 \u548c 5 \uff0c\u4e5f\u53ef\u4ee5\u6307\u5b9a\u9ed8\u8ba4\u8fd0\u884c\u7ea7\u522b)<\/span>\uff1a<\/p>\n<ul>\n<li>0 \uff1a\u5173\u673a<\/li>\n<li>1 \uff1a\u5355\u7528\u6237\u3010\u627e\u56de\u4e22\u5931\u5bc6\u7801\u3011<\/li>\n<li>2\uff1a\u591a\u7528\u6237\u72b6\u6001\u6ca1\u6709\u7f51\u7edc\u670d\u52a1<\/li>\n<li>3\uff1a\u591a\u7528\u6237\u72b6\u6001\u6709\u7f51\u7edc\u670d\u52a1<\/li>\n<li>4\uff1a\u7cfb\u7edf\u672a\u4f7f\u7528\u4fdd\u7559\u7ed9\u7528\u6237<\/li>\n<li>5\uff1a\u56fe\u5f62\u754c\u9762<\/li>\n<li>6\uff1a\u7cfb\u7edf\u91cd\u542f<\/li>\n<\/ul>\n<\/li>\n<li>\u547d\u4ee4\uff1ainit [0123456]\n<p>~~~shell<br \/>\n init 3<\/p>\n<p>~~~<\/p>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\u6307\u5b9a\u9ed8\u8ba4\u8fd0\u884c\u7ea7\u522b\uff1a<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u5728 centos7 \u4ee5\u524d\u7248\u672c\uff0c\/etc\/inittab \u6587\u4ef6\u4e2d\u4fee\u6539\u6570\u5b57\uff08\u8fd0\u884c\u7ea7\u522b\uff09\u3002<\/p>\n<\/li>\n<li>\n<p>\u5728 centos7\u7248\u672c\uff0c\u5bf9\/etc\/inittab \u6587\u4ef6\u8fdb\u884c\u4e86\u7b80\u5316\uff0c\u5982\u4e0b\uff1a<\/p>\n<p>multi-user.target: analogous to runlevel 3<br \/>\n graphical.target: analogous to runlevel 5<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u5f53\u524d\u8fd0\u884c\u7ea7\u522b\uff1a<\/p>\n<p>&#8220;`shell<br \/>\n [root@alancentos ~]# systemctl get-default<br \/>\n graphical.target<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<li>\n<p>\u901a\u8fc7\u547d\u4ee4\u884c\u8bbe\u7f6e\u9ed8\u8ba4\u8fd0\u884c\u7ea7\u522b\uff1a<\/p>\n<p>~~~shell<br \/>\n [root@alancentos ~]# systemctl set-default multi-user.target<br \/>\n Removed symlink \/etc\/systemd\/system\/default.target.<br \/>\n Created symlink from \/etc\/systemd\/system\/default.target to \/usr\/lib\/systemd\/system\/multi-user.target.<\/p>\n<p>[root@alancentos ~]# systemctl set-default graphical.target<br \/>\n Removed symlink \/etc\/systemd\/system\/default.target.<br \/>\n Created symlink from \/etc\/systemd\/system\/default.target to \/usr\/lib\/systemd\/system\/graphical.target.<\/p>\n<p>~~~<\/p>\n<\/li>\n<\/ul>\n<h3>\u4e03\u3001CentOS7.6\u627e\u56deroot\u5bc6\u7801<\/h3>\n<ol>\n<li>\n<p>\u9996\u5148\uff0c\u542f\u52a8\u7cfb\u7edf\uff0c\u8fdb\u5165\u5f00\u673a\u754c\u9762\uff0c\u5728\u754c\u9762\u4e2d\u6309\u201ce\u201d\u8fdb\u5165\u7f16\u8f91\u754c\u9762\u3002\u5982\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210410190950485.png\" alt=\"image-20210410190950485\" \/><\/p>\n<ol start=\"2\">\n<li>\u8fdb\u5165\u7f16\u8f91\u754c\u9762\uff0c\u4f7f\u7528\u952e\u76d8\u4e0a\u7684\u4e0a\u4e0b\u952e\u628a\u5149\u6807\u5f80\u4e0b\u79fb\u52a8\uff0c\u627e\u5230\u4ee5\u201c\u201cLinux16\u201d\u5f00\u5934\u5185\u5bb9\u6240\u5728\u7684\u884c\u6570\u201d\uff0c\u5728\u884c\u7684\u6700\u540e\u9762\u8f93\u5165\uff1ainit=\/bin\/sh\u3002\u5982\u56fe\uff1a\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210410191117688.png\" alt=\"image-20210410191117688\" \/><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u63a5\u7740\uff0c\u8f93\u5165\u5b8c\u6210\u540e\uff0c\u76f4\u63a5\u6309\u5feb\u6377\u952e\uff1aCtrl+x \u8fdb\u5165<strong>\u5355\u7528\u6237\u6a21\u5f0f<\/strong>\u3002<\/p>\n<\/li>\n<li>\n<p>\u63a5\u7740\uff0c\u5728\u5149\u6807\u95ea\u70c1\u7684\u4f4d\u7f6e\u4e2d\u8f93\u5165\uff1amount -o remount,rw \/\uff08\u6ce8\u610f\uff1a\u5404\u4e2a\u5355\u8bcd\u95f4\u6709\u7a7a\u683c\uff09\uff0c\u5b8c\u6210\u540e\u6309\u952e\u76d8\u7684\u56de\u8f66\u952e\uff08Enter\uff09\u3002\u5982\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210410191208429.png\" alt=\"image-20210410191208429\" \/><\/p>\n<\/li>\n<li>\n<p>\u5728\u65b0\u7684\u4e00\u884c\u6700\u540e\u9762\u8f93\u5165\uff1apasswd\uff0c \u5b8c\u6210\u540e\u6309\u952e\u76d8\u7684\u56de\u8f66\u952e\uff08Enter\uff09\u3002\u8f93\u5165\u5bc6\u7801\uff0c<strong>\u7136\u540e\u518d\u6b21\u786e\u8ba4\u5bc6\u7801\u5373<\/strong>\u53ef(<strong>\u63d0\u793a:<\/strong> <strong>\u5bc6\u7801\u957f\u5ea6\u6700\u597d8****\u4f4d\u4ee5\u4e0a,****\u4f46\u4e0d\u662f\u5fc5\u987b\u7684<\/strong>), \u5bc6\u7801\u4fee\u6539\u6210\u529f\u540e\uff0c\u4f1a\u663e\u793apasswd&#8230;..\u7684\u6837\u5f0f\uff0c\u8bf4\u660e\u5bc6\u7801\u4fee\u6539\u6210\u529f\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210410191301500.png\" alt=\"image-20210410191301500\" \/><\/p>\n<\/li>\n<li>\n<p>\u63a5\u7740\uff0c\u5728\u9f20\u6807\u95ea\u70c1\u7684\u4f4d\u7f6e\u4e2d\uff08\u6700\u540e\u4e00\u884c\u4e2d\uff09\u8f93\u5165\uff1atouch \/.autorelabel\uff08\u6ce8\u610f\uff1atouch\u4e0e \/\u540e\u9762\u6709\u4e00\u4e2a\u7a7a\u683c\uff09\uff0c\u5b8c\u6210\u540e\u6309\u952e\u76d8\u7684\u56de\u8f66\u952e\uff08Enter\uff09<\/p>\n<\/li>\n<li>\n<p>\u7ee7\u7eed\u5728\u5149\u6807\u95ea\u70c1\u7684\u4f4d\u7f6e\u4e2d\uff0c\u8f93\u5165\uff1aexec \/sbin\/init\uff08\u6ce8\u610f\uff1aexec\u4e0e \/\u540e\u9762\u6709\u4e00\u4e2a\u7a7a\u683c\uff09\uff0c\u5b8c\u6210\u540e\u6309\u952e\u76d8\u7684\u56de\u8f66\u952e\uff08Enter\uff09,\u7b49\u5f85\u7cfb\u7edf\u81ea\u52a8\u4fee\u6539\u5bc6\u7801(<strong>\u63d0\u793a\uff1a\u8fd9\u4e2a\u8fc7\u7a0b\u65f6\u95f4\u53ef\u80fd\u6709\u70b9\u957f\uff0c\u8010\u5fc3\u7b49\u5f85<\/strong>)\uff0c\u5b8c\u6210\u540e\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u91cd\u542f, <strong>\u65b0\u7684\u5bc6\u7801\u751f\u6548\u4e86<\/strong>\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210410191424175.png\" alt=\"image-20210410191424175\" \/><\/p>\n<\/li>\n<\/ol>\n<h3>\u516b\u3001\u5e2e\u52a9\u6307\u4ee4<\/h3>\n<ol>\n<li>\n<p>man \u83b7\u5f97\u5e2e\u52a9\u4fe1\u606f\uff1a<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1aman [\u547d\u4ee4\u6216\u914d\u7f6e\u6587\u4ef6]\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u83b7\u5f97\u5e2e\u52a9\u4fe1\u606f\uff09<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos home]# man ls\n\n<\/code><\/pre>\n<p>\u8bf4\u660e\uff1a<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u5728 linux \u4e0b\uff0c\u9690\u85cf\u6587\u4ef6\u662f\u4ee5 .\u5f00\u5934<\/span> , \u9009\u9879\u53ef\u4ee5\u7ec4\u5408\u4f7f\u7528\u6bd4\u5982 ls -al, \u6bd4\u5982 ls-al \/root<\/p>\n<\/li>\n<li>\n<p>help \u6307\u4ee4\uff1a<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1ahelp \u547d\u4ee4 \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u83b7\u5f97 shell \u5185\u7f6e\u547d\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f\uff09<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos home]# help cd\n\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u4e5d\u3001\u6587\u4ef6\u76ee\u5f55\u7c7b<\/h3>\n<ol>\n<li>pwd\u6307\u4ee4\uff1a\n<p>\u57fa\u672c\u8bed\u6cd5 \uff1apwd(\u529f\u80fd\u63cf\u8ff0\uff1a\u663e\u793a\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u7684\u7edd\u5bf9\u8def\u5f84)<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos home]# pwd\n\/home\n\n<\/code><\/pre>\n<\/li>\n<li>ls\u6307\u4ee4\uff1a\n<p>\u57fa\u672c\u8bed\u6cd5\uff1als [\u9009\u9879\uff1a\u76ee\u5f55\u6216\u662f\u6587\u4ef6]<br \/>\n\u5e38\u7528\u9009\u9879\uff1a<br \/>\n-a \uff1a\u663e\u793a\u5f53\u524d\u76ee\u5f55\u6240\u6709\u7684\u6587\u4ef6\u548c\u76ee\u5f55\uff0c\u5305\u62ec\u9690\u85cf\u7684\u3002<br \/>\n-l\uff1a\u4ee5\u5217\u8868\u7684\u65b9\u5f0f\u663e\u793a\u4fe1\u606f\u3002<\/p>\n<p>-h\uff1a\u4ee5\u65b9\u4fbf\u4eba\u7c7b\u8bfb\u53d6\u7684\u65b9\u5f0f\u663e\u793a\u4fe1\u606f\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 \/]# ls -lh\n\u603b\u7528\u91cf 68K\nlrwxrwxrwx.   1 root root    7 4\u6708   2 00:24 bin -&gt; usr\/bin\ndr-xr-xr-x.   6 root root 4.0K 4\u6708   5 22:41 boot\ndrwxr-xr-x.  19 root root 3.3K 4\u6708  11 12:35 dev\ndrwxr-xr-x. 144 root root  12K 4\u6708  11 12:37 etc\ndrwxr-xr-x.   3 root root 4.0K 4\u6708  11 13:55 home\nlrwxrwxrwx.   1 root root    7 4\u6708   2 00:24 lib -&gt; usr\/lib\nlrwxrwxrwx.   1 root root    9 4\u6708   2 00:24 lib64 -&gt; usr\/lib64\ndrwx------.   2 root root  16K 4\u6708   2 00:23 lost+found\ndrwxr-xr-x.   2 root root 4.0K 4\u6708  11 2018 media\ndrwxr-xr-x.   3 root root 4.0K 4\u6708   3 22:08 mnt\ndrwxr-xr-x.   4 root root 4.0K 4\u6708   3 22:07 opt\ndr-xr-xr-x. 227 root root    0 4\u6708  11 12:35 proc\ndr-xr-x---.  16 root root 4.0K 4\u6708  11 13:16 root\ndrwxr-xr-x.  42 root root 1.3K 4\u6708  11 12:35 run\nlrwxrwxrwx.   1 root root    8 4\u6708   2 00:24 sbin -&gt; usr\/sbin\ndrwxr-xr-x.   2 root root 4.0K 4\u6708  11 2018 srv\ndr-xr-xr-x.  13 root root    0 4\u6708  11 12:35 sys\ndrwxrwxrwt.  41 root root 4.0K 4\u6708  11 13:55 tmp\ndrwxr-xr-x.  13 root root 4.0K 4\u6708   2 00:24 usr\ndrwxr-xr-x.  21 root root 4.0K 4\u6708   2 00:34 var\n\n<\/code><\/pre>\n<\/li>\n<li>cd\u6307\u4ee4\uff1a\n<p>\u57fa\u672c\u8bed\u6cd5\uff1acd[\u53c2\u6570-\u529f\u80fd\u63cf\u8ff0\uff1a\u5207\u6362\u5230\u6307\u5b9a\u76ee\u5f55]<\/p>\n<p>cd ~ \u6216\u8005 cd \uff1a\u56de\u5230\u81ea\u5df1\u7684\u5bb6\u76ee\u5f55, \u6bd4\u5982 \u4f60\u662f root \uff0c cd ~ \u5230 \/root\u3002<br \/>\ncd .. \u56de\u5230\u5f53\u524d\u76ee\u5f55\u7684\u4e0a\u4e00\u7ea7\u76ee\u5f55\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos home]# cd \/root\n[root@alancentos ~]# \n\n<\/code><\/pre>\n<\/li>\n<li>mkdir\u6307\u4ee4\n<p>\u8bf4\u660e\uff1amkdir \u6307\u4ee4\u7528\u4e8e\u521b\u5efa\u76ee\u5f55<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1amkdir[\u9009\u9879]\u8981\u521b\u5efa\u7684\u76ee\u5f55<\/p>\n<p>\u521b\u5efa\u4e00\u7ea7\u76ee\u5f55\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos ~]# mkdir \/home\/dog\n\n<\/code><\/pre>\n<p>\u521b\u5efa\u591a\u7ea7\u76ee\u5f55\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos ~]# mkdir \/home\/animal\/tiger\nmkdir: \u65e0\u6cd5\u521b\u5efa\u76ee\u5f55\"\/home\/animal\/tiger\": \u6ca1\u6709\u90a3\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55\n[root@alancentos ~]# mkdir -p \/home\/animal\/tiger\n\n<\/code><\/pre>\n<\/li>\n<li>rmdir\u6307\u4ee4\n<p>\u8bf4\u660e\uff1a\u5220\u9664\u7a7a\u76ee\u5f55<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1armdir[\u9009\u9879]\u8981\u5220\u9664\u7684\u7a7a\u76ee\u5f55\u3002<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u4f7f\u7528\u7ec6\u8282<\/span>\uff1a<br \/>\nrmdir\u5220\u9664\u7684\u662f\u7a7a\u76ee\u5f55\uff0c\u5982\u679c\u76ee\u5f55\u4e0b\u6709\u5185\u5bb9\u65f6\u65e0\u6cd5\u5220\u9664\u7684\u3002<br \/>\n\u63d0\u793a\uff1a\u5982\u679c\u9700\u8981\u5220\u9664\u975e\u7a7a\u76ee\u5f55\uff0c\u9700\u8981\u4f7f\u7528rm -rf\u8981\u5220\u9664\u7684\u76ee\u5f55\u3002<br \/>\n\u6bd4\u5982\uff1a rm -rf \/home\/animal<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos ~]# rmdir \/home\/dog\n[root@alancentos ~]# rmdir \/home\/animal\nrmdir: \u5220\u9664 \"\/home\/animal\" \u5931\u8d25: \u76ee\u5f55\u975e\u7a7a\n[root@alancentos ~]# rm -rf \/home\/animal\n[root@alancentos ~]#\n\n<\/code><\/pre>\n<\/li>\n<li>touch\u6307\u4ee4\n<p>\u8bf4\u660e\uff1atouch\u6307\u4ee4\u521b\u5efa\u7a7a\u6587\u4ef6<br \/>\n\u57fa\u672c\u8bed\u6cd5\uff1atouch \u6587\u4ef6\u540d\u79f0<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos \/]# touch \/home\/hello.txt\n[root@alancentos \/]# ls \/home\nalan  hello.txt\n\n<\/code><\/pre>\n<\/li>\n<li>cp\u6307\u4ee4\n<p>\u8bf4\u660e\uff1acp\u6307\u4ee4\u62f7\u8d1d\u6587\u4ef6\u5230\u6307\u5b9a\u76ee\u5f55<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1acp [\u9009\u9879] source dest<br \/>\n\u5e38\u7528\u9009\u9879\uff1a<br \/>\n-r \uff1a\u9012\u5f52\u590d\u5236\u6574\u4e2a\u6587\u4ef6\u5939<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a<br \/>\n\u6848\u4f8b 1: \u5c06 \/home\/hello.txt \u62f7\u8d1d\u5230\/home\/bbb\u76ee\u5f55\u4e0b\uff08<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\uff1a\u5982\u679c\/home\/bbb\u6587\u4ef6\u5939\u4e0d\u5b58\u5728\uff0c\u5219\u4f1a\u628ahello.txt\u62f7\u8d1d\u5e76\u6539\u540d\u4e3abbb\u6587\u4ef6<\/span>\uff09\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos \/]# cp \/home\/hello.txt \/home\/bbb\n\n<\/code><\/pre>\n<p>\u6848\u4f8b 2: \u9012\u5f52\u590d\u5236\u6574\u4e2a\u6587\u4ef6\u5939\uff0c\u4e3e\u4f8b, \u6bd4\u5982\u5c06 \/home\/bbb \u6574\u4e2a\u76ee\u5f55\uff0c \u62f7\u8d1d\u5230 \/opt\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos \/]# cp -r \/home\/bbb \/opt\n[root@alancentos \/]# ls \/opt\nbbb  rh  VMwareTools-10.3.10-13959562.tar.gz  vmware-tools-distrib\n\n<\/code><\/pre>\n<p>\u4f7f\u7528\u7ec6\u8282\uff1a<br \/>\n\u5f3a\u5236\u8986\u76d6\u4e0d\u63d0\u793a\u7684\u65b9\u6cd5\uff1a\\cp\uff0c\u5982\uff1a \\cp -r \/home\/bbb \/opt<\/p>\n<\/li>\n<li>\n<p>rm\u6307\u4ee4<\/p>\n<p>\u8bf4\u660e\uff1arm \u6307\u4ee4\u79fb\u9664\u6587\u4ef6\u6216\u76ee\u5f55<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>rm [\u9009\u9879] \u8981\u5220\u9664\u7684\u6587\u4ef6\u6216\u76ee\u5f55<br \/>\n\u5e38\u7528\u9009\u9879\uff1a<br \/>\n-r \uff1a\u9012\u5f52\u5220\u9664\u6574\u4e2a\u6587\u4ef6\u5939<br \/>\n-f \uff1a \u5f3a\u5236\u5220\u9664\u4e0d\u63d0\u793a<\/p>\n<p>\u4f7f\u7528\u7ec6\u8282\uff1a<br \/>\n\u5f3a\u5236\u5220\u9664\u4e0d\u63d0\u793a\u7684\u65b9\u6cd5\uff1a\u5e26\u4e0a -f \u53c2\u6570\u5373\u53ef<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos \/]# rm \/home\/bbb\nrm\uff1a\u662f\u5426\u5220\u9664\u666e\u901a\u7a7a\u6587\u4ef6 \"\/home\/bbb\"\uff1fy\n[root@alancentos \/]# rm -rf \/opt\/bbb\n\n<\/code><\/pre>\n<\/li>\n<li>mv\u6307\u4ee4\n<p>\u8bf4\u660e\uff1amv\u79fb\u52a8\u6587\u4ef6\u4e0e\u76ee\u5f55\u6216\u91cd\u547d\u540d<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<br \/>\nmv oldNameFile newNameFile(\u529f\u80fd\u63cf\u8ff0\uff1a\u91cd\u547d\u540d)<br \/>\nmv \/temp\/movefile \/targetFolder (\u529f\u80fd\u63cf\u8ff0\uff1a\u79fb\u52a8\u6587\u4ef6)<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos \/]# mv \/home\/hello.txt \/home\/cat.txt\n[root@alancentos \/]# ls \/home\nalan  bbb  cat.txt\n[root@alancentos \/]# mv \/home\/cat.txt \/home\/bbb\/\n[root@alancentos \/]# ls \/home\/bbb\ncat.txt\n\n<\/code><\/pre>\n<\/li>\n<li>cat \u6307\u4ee4\n<p>\u8bf4\u660e\uff1acat\u67e5\u770b\u6587\u4ef6\u5185\u5bb9<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1acat [\u9009\u9879] \u8981\u67e5\u770b\u7684\u6587\u4ef6<\/p>\n<p>\u5e38\u7528\u9009\u9879\uff1a<\/p>\n<p>-n \uff1a\u663e\u793a\u884c\u53f7<\/p>\n<p>\u4f7f\u7528\u7ec6\u8282\uff1a<\/p>\n<p>cat\u53ea\u80fd\u6d4f\u89c8\u6587\u4ef6\uff0c\u800c\u4e0d\u80fd\u4fee\u6539\u6587\u4ef6\uff0c\u4e3a\u4e86\u6d4f\u89c8\u65b9\u4fbf\uff0c\u4e00\u822c\u4f1a\u5e26\u4e0a\u7ba1\u9053\u547d\u4ee4(<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u7ba1\u9053\u547d\u4ee4\u7684\u4f5c\u7528\uff1a\u628a\u524d\u9762\u7684\u7ed3\u679c\u4ea4\u7ed9\u201c|\u201d\u540e\u9762\u7684\u547d\u4ee4\u7ee7\u7eed\u5904\u7406<\/span>)|more<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos \/]# cat -n \/etc\/profile |more\n\n<\/code><\/pre>\n<\/li>\n<li>more\u6307\u4ee4\n<p>\u8bf4\u660e\uff1amore \u6307\u4ee4\u662f\u4e00\u4e2a\u57fa\u4e8e VI \u7f16\u8f91\u5668\u7684\u6587\u672c\u8fc7\u6ee4\u5668\uff0c\u5b83\u4ee5\u5168\u5c4f\u5e55\u7684\u65b9\u5f0f\u6309\u9875\u663e\u793a\u6587\u672c\u6587\u4ef6\u7684\u5185\u5bb9\u3002more \u6307\u4ee4\u4e2d\u5185\u7f6e\u4e86\u82e5<br \/>\n\u5e72\u5feb\u6377\u952e(\u4ea4\u4e92\u7684\u6307\u4ee4)\u3002<\/p>\n<p>\u64cd\u4f5c\u8bf4\u660e\uff1a<\/p>\n<ul>\n<li>\u7a7a\u767d\u952e\uff1a\u5411\u4e0b\u7ffb\u4e00\u9875<\/li>\n<li>Enter\uff1a\u5411\u4e0b\u7ffb\u4e00\u884c<\/li>\n<li>q\uff1a\u4ee3\u8868\u7acb\u523b\u79bb\u5f00more\uff0c\u4e0d\u518d\u663e\u793a\u8be5\u6587\u4ef6\u5185\u5bb9<\/li>\n<li>=\uff1a\u8f93\u51fa\u5f53\u524d\u884c\u884c\u53f7<\/li>\n<li>:f\uff1a\u663e\u793a\u8f93\u51fa\u6587\u4ef6\u540d\u548c\u5f53\u524d\u884c\u884c\u53f7<\/li>\n<li>Ctrl+f\uff1a\u5411\u4e0b\u6eda\u52a8\u4e00\u5c4f<\/li>\n<\/ul>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# more \/etc\/profile\n\n<\/code><\/pre>\n<\/li>\n<li>less\u6307\u4ee4\n<p>\u8bf4\u660e\uff1aless \u6307\u4ee4\u7528\u6765\u5206\u5c4f\u67e5\u770b\u6587\u4ef6\u5185\u5bb9\uff0c\u5b83\u7684\u529f\u80fd\u4e0e more \u6307\u4ee4\u7c7b\u4f3c\uff0c\u4f46\u662f\u6bd4 more \u6307\u4ee4\u66f4\u52a0\u5f3a\u5927\uff0c\u652f\u6301\u5404\u79cd\u663e\u793a\u7ec8\u7aef\u3002less\u6307\u4ee4\u5728\u663e\u793a\u6587\u4ef6\u5185\u5bb9\u65f6\uff0c\u5e76\u4e0d\u662f\u4e00\u6b21\u5c06\u6574\u4e2a\u6587\u4ef6\u52a0\u8f7d\u4e4b\u540e\u624d\u663e\u793a\uff0c\u800c\u662f\u6839\u636e\u663e\u793a\u9700\u8981\u52a0\u8f7d\u5185\u5bb9\uff0c\u5bf9\u4e8e\u663e\u793a\u5927\u578b\u6587\u4ef6\u5177\u6709\u8f83\u9ad8\u7684\u6548\u7387\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>less \u8981\u67e5\u770b\u7684\u6587\u4ef6<\/p>\n<p>\u64cd\u4f5c\u8bf4\u660e\uff1a<\/p>\n<ul>\n<li>\u7a7a\u767d\u952e\uff1a\u5411\u4e0b\u7ffb\u4e00\u9875<\/li>\n<li>[PageDown]\u6309\u94ae\uff1a\u5411\u4e0b\u7ffb\u4e00\u9875<\/li>\n<li>[PageUp]\u6309\u94ae\uff1a\u5411\u4e0a\u7ffb\u4e00\u9875<\/li>\n<li>\u201c\/\u201d\u5b57\u4e32\uff1a\u5411\u4e0b\u641c\u7d22\u3010\u5b57\u4e32\u3011\u7684\u529f\u80fd\uff0cn\uff1a\u5411\u4e0b\u67e5\u627e\uff0cN\uff1a\u5411\u4e0a\u67e5\u627e<\/li>\n<li>\u201c?\u201d\u5b57\u4e32\uff1a\u5411\u4e0a\u641c\u7d22\u3010\u5b57\u4e32\u3011\u7684\u529f\u80fd\uff0cn\uff1a\u5411\u4e0a\u67e5\u627e\uff0cN\uff1a\u5411\u4e0b\u67e5\u627e<\/li>\n<li>q\uff1a\u79bb\u5f00\u8fd9\u4e2aless\u7a0b\u5e8f<\/li>\n<\/ul>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# less \/etc\/profile\n[root@alanCentos01 home]# cat -n \/etc\/profile | less\n\n<\/code><\/pre>\n<\/li>\n<li>echo\u6307\u4ee4\n<p>\u8bf4\u660e\uff1aecho\u8f93\u51fa\u5185\u5bb9\u5230\u63a7\u5236\u53f0\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>echo [\u9009\u9879\uff1a\u8f93\u51fa\u5185\u5bb9]<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# echo <span class=\"katex math inline\">path\n\n[root@alanCentos01 home]# echo<\/span>PATH\n\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/root\/bin\n[root@alanCentos01 home]# echo $HOSTNAME\nalanCentos01\n[root@alanCentos01 home]# echo hello,world!\nhello,world!\n\n<\/code><\/pre>\n<\/li>\n<li>head\u6307\u4ee4\n<p>\u8bf4\u660e\uff1ahead \u7528\u4e8e\u663e\u793a\u6587\u4ef6\u7684\u5f00\u5934\u90e8\u5206\u5185\u5bb9\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b head \u6307\u4ee4\u663e\u793a\u6587\u4ef6\u7684\u524d 10 \u884c\u5185\u5bb9\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>head \u6587\u4ef6\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u67e5\u770b\u6587\u4ef6\u593410\u884c\u5185\u5bb9\uff09<\/p>\n<p>head -n 5 \u6587\u4ef6\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u67e5\u770b\u6587\u4ef6\u5934 5 \u884c\u5185\u5bb9\uff0c5 \u53ef\u4ee5\u662f\u4efb\u610f\u884c\u6570\uff09<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# head -n 5 \/etc\/profile\n# \/etc\/profile\n\n# System wide environment and startup programs, for login setup\n# Functions and aliases go in \/etc\/bashrc\n\n<\/code><\/pre>\n<\/li>\n<li>tail\u6307\u4ee4\n<p>\u8bf4\u660e\uff1atail\u7528\u4e8e\u8f93\u51fa\u6587\u4ef6\u4e2d\u5c3e\u90e8\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b tail \u6307\u4ee4\u663e\u793a\u6587\u4ef6\u7684\u524d 10 \u884c\u5185\u5bb9\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<ul>\n<li>tail\u6587\u4ef6\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u67e5\u770b\u6587\u4ef6\u5c3e10\u884c\u5185\u5bb9\uff09<\/li>\n<li>tail -n 5 \u6587\u4ef6\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u67e5\u770b\u6587\u4ef6\u5c3e5\u884c\u5185\u5bb9\uff0c5\u53ef\u4ee5\u662f\u4efb\u610f\u884c\u6570\uff09<\/li>\n<li>tail -f \u6587\u4ef6\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u5b9e\u65f6\u8ffd\u8e2a\u8be5\u6587\u6863\u7684\u6240\u6709\u66f4\u65b0\uff0c<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u4e00\u822c\u7528\u4e8e\u8ffd\u8e2a\u663e\u793a\u65e5\u5fd7<\/span>\uff09<\/li>\n<\/ul>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# tail -n 5 \/etc\/profile\n    fi\ndone\n\nunset i\nunset -f pathmunge\n[root@alanCentos01 \/]# tail -f \/var\/log\/vmware-install.log \nThe configuration of VMware Tools 10.3.10 build-13959562 for Linux for this \nrunning kernel completed successfully.\n\nFound VMware Tools CDROM mounted at \/run\/media\/root\/VMware Tools. Ejecting \ndevice \/dev\/sr0 ...\nEnjoy,\n\n--the VMware team\n\nSat Apr  3 22:09:16 2021 vmware-install.pl end\n\n<\/code><\/pre>\n<\/li>\n<li>\u201c>\u201d \u6307\u4ee4 \u548c \u201c>>\u201d \u6307\u4ee4\n<p>\u8bf4\u660e\uff1a\u201c>\u201d \u8f93\u51fa\u91cd\u5b9a\u5411\u548c \u201c>>\u201d \u8ffd\u52a0<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<ul>\n<li>ls -l >\u6587\u4ef6\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u5217\u8868\u7684\u5185\u5bb9\u5199\u5165\u6587\u4ef6a.txt\u4e2d\uff08\u8986\u76d6\u5199\uff09\uff09<\/li>\n<li>ls -al >>\u6587\u4ef6 \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u5217\u8868\u7684\u5185\u5bb9\u8ffd\u52a0\u5230\u6587\u4ef6aa.txt\u7684\u672b\u5c3e\uff09<\/li>\n<li>cat \u6587\u4ef61 > \u6587\u4ef62\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u5c06\u6587\u4ef61\u7684\u5185\u5bb9\u8986\u76d6\u5230\u6587\u4ef62\uff09<\/li>\n<li>echo &#8220;\u5185\u5bb9&#8221;>> \u6587\u4ef6 \uff08\u8ffd\u52a0\uff09<\/li>\n<\/ul>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 \/]# ls -l \/home &gt; \/home\/info.txt\n[root@alanCentos01 \/]# cat -n \/home\/info.txt | more\n     1  \u603b\u7528\u91cf 4\n     2  drwx------. 5 alan alan 4096 4\u6708   5 23:17 alan\n     3  -rw-r--r--. 1 root root    0 4\u6708  11 13:40 info.txt\n[root@alanCentos01 home]# ls\nalan  info.txt\n[root@alanCentos01 home]# cat info.txt &gt; cat.txt\n[root@alanCentos01 home]# ls\nalan  cat.txt  info.txt\n[root@alanCentos01 home]# cat cat.txt -n | more\n     1  \u603b\u7528\u91cf 4\n     2  drwx------. 5 alan alan 4096 4\u6708   5 23:17 alan\n     3  -rw-r--r--. 1 root root    0 4\u6708  11 13:40 info.txt\n[root@alanCentos01 home]# echo \"\u6211\u662f\u8ffd\u52a0\u7684\u5185\u5bb9\uff0c\u54c8\u54c8\u54c8\" &gt;&gt; info.txt \n[root@alanCentos01 home]# cat -n info.txt | more\n     1  \u603b\u7528\u91cf 4\n     2  drwx------. 5 alan alan 4096 4\u6708   5 23:17 alan\n     3  -rw-r--r--. 1 root root    0 4\u6708  11 13:40 info.txt\n     4  \u6211\u662f\u8ffd\u52a0\u7684\u5185\u5bb9\uff0c\u54c8\u54c8\u54c8\n[root@alanCentos01 home]# cal &gt;&gt; info.txt\n[root@alanCentos01 home]# cat -n info.txt | more\n     1  \u603b\u7528\u91cf 4\n     2  drwx------. 5 alan alan 4096 4\u6708   5 23:17 alan\n     3  -rw-r--r--. 1 root root    0 4\u6708  11 13:40 info.txt\n     4  \u6211\u662f\u8ffd\u52a0\u7684\u5185\u5bb9\uff0c\u54c8\u54c8\u54c8\n     5        \u56db\u6708 2021     \n     6  \u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d\n     7               1  2  3\n     8   4  5  6  7  8  9 10\n     9  11 12 13 14 15 16 17\n    10  18 19 20 21 22 23 24\n    11  25 26 27 28 29 30     \n\n<\/code><\/pre>\n<\/li>\n<li>ln\u6307\u4ee4\n<p>\u8bf4\u660e\uff1a\u8f6f\u94fe\u63a5\u4e5f\u79f0\u4e3a\u7b26\u53f7\u94fe\u63a5\uff0c\u7c7b\u4f3c\u4e8e windows \u91cc\u7684\u5feb\u6377\u65b9\u5f0f\uff0c\u4e3b\u8981\u5b58\u653e\u4e86\u94fe\u63a5\u5176\u4ed6\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>ln -s [\u539f\u6587\u4ef6\u6216\u76ee\u5f55] [\u8f6f\u94fe\u63a5\u540d] \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u7ed9\u539f\u6587\u4ef6\u521b\u5efa\u4e00\u4e2a\u8f6f\u94fe\u63a5\uff09<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# ln -s \/root \/home\/myroot\n[root@alanCentos01 home]# ls -l \/home\n\u603b\u7528\u91cf 12\ndrwx------. 5 alan alan 4096 4\u6708   5 23:17 alan\n-rw-r--r--. 1 root root  114 4\u6708  11 13:43 cat.txt\n-rw-r--r--. 1 root root  302 4\u6708  11 13:49 info.txt\nlrwxrwxrwx. 1 root root    5 4\u6708  11 13:51 myroot -&gt; \/root\n\n<\/code><\/pre>\n<p>\u5220\u9664\u8f6f\u8fde\u63a5\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# rm \/home\/myroot\nrm\uff1a\u662f\u5426\u5220\u9664\u7b26\u53f7\u94fe\u63a5 \"\/home\/myroot\"\uff1fy\n[root@alanCentos01 home]# ls -l \/home\/\n\u603b\u7528\u91cf 12\ndrwx------. 5 alan alan 4096 4\u6708   5 23:17 alan\n-rw-r--r--. 1 root root  114 4\u6708  11 13:43 cat.txt\n-rw-r--r--. 1 root root  302 4\u6708  11 13:49 info.txt\n[root@alanCentos01 home]#\n\n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u7ec6\u8282\u8bf4\u660e<\/span>\uff1a\u5f53\u6211\u4eec\u4f7f\u7528 pwd \u6307\u4ee4\u67e5\u770b\u76ee\u5f55\u65f6\uff0c\u4ecd\u7136\u770b\u5230\u7684\u662f\u8f6f\u94fe\u63a5\u6240\u5728\u76ee\u5f55\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# ln -s \/root \/home\/myroot\n[root@alanCentos01 home]# ls\nalan  cat.txt  info.txt  myroot\n[root@alanCentos01 home]# cd \/home\/myroot\n[root@alanCentos01 myroot]# pwd\n\/home\/myroot\n\n<\/code><\/pre>\n<\/li>\n<li>history\u6307\u4ee4\n<p>\u8bf4\u660e\uff1a\u67e5\u770b\u5df2\u7ecf\u6267\u884c\u8fc7\u5386\u53f2\u547d\u4ee4,\u4e5f\u53ef\u4ee5\u6267\u884c\u5386\u53f2\u6307\u4ee4\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>history \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u67e5\u770b\u5df2\u7ecf\u6267\u884c\u8fc7\u5386\u53f2\u547d\u4ee4\uff09<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# history\n    1  ls\n    2  exit\n    3  sync\n    4  shutdown -h now\n    5  sync\n    6  reboot\n    7  logout\n    8  cd \/root\n    9  ls\n   10  cd \/\n   11  ls\n   12  logout\n   13  ls\n   14  cd \/root\n   15  logout\n   16  ls\n   17  cd \/home\n   18  ls\n   19  userdel milan\n   20  userdel zwj\n   21  ls\n   22  userdel -r\n   23  userdel -r zwj\n   24  useradd milan\n   25  userdel -r milan\n   26  ls\n   27  useradd zwj\n   28  userdel -r zwj\n   29  ls\n   30  ls -l \/opt\n   31  cat -n \/etc\/profile\n   32  cat -n \/etc\/profile |more\n   33  man more\n   34  cat -n \/etc\/profile |more\n   35  more \/etc\/profile\n   36  more \/etc\/profiled\n   37  more \/etc\/profile\n   38  cat -n \/etc\/profile | more\n   39  more \/etc\/profile\n   40  cat -n \/etc\/profile | less\n   41  less \/etc\/profile\n   42  echo <span class=\"katex math inline\">path\n   43  echo<\/span>PATH\n   44  echo <span class=\"katex math inline\">HOSTHOME\n   45  echo<\/span>HOSTNAME\n   46  echo hello,world\n   47  echo hello,world!\n   48  cat \/etc\/profile | head\n   49  cat \/etc\/profile | head 1\n   50  cat \/etc\/profile | head -n 1\n   51  cat \/etc\/profile | head -n 2\n   52  cat \/etc\/profile | head -n 3\n   53  head -n 5 \/etc\/profile\n   54  tail -n 5 \/etc\/profile\n   55  ls\n   56  cd \/\n   57  ls\n   58  ls -l \/var\n   59  ls \/var\/account\n   60  tail -f \/var\/account\/pacct \n   61  ls \/var\/cache\n   62  ls \/var\/cache\/opt\n   63  ls \/var\/cache\n   64  ls \/var\/opt\n   65  ls \/var\/tmp\n   66  ls \/var\n   67  ls \/var\/local\n   68  ls \/var\/adm\n   69  ls \/var\/db\n   70  ls \/var\/db\/Makefile \n   71  less \/var\/db\/Makefile \n   72  less \/var\/\n   73  ls -l \/var\/\n   74  ls -l \/var\/log\n   75  tail -f \/var\/log\/vmware-install.log \n   76  ls -l \/home &gt; \/home\/info.txt\n   77  cat -n \/home\/info.txt\n   78  cat -n \/home\/info.txt | more\n   79  cd \/home\n   80  ls\n   81  cat info.txt &gt; cat.txt\n   82  cat -n cat.txt | more\n   83  ls\n   84  cat cat.txt -n | more\n   85  echo \"\u6211\u662f\u8ffd\u52a0\u7684\u5185\u5bb9\uff0c\u54c8\u54c8\u54c8\" &gt;&gt; info.txt \n   86  cat -n info.txt | more\n   87  cal\n   88  cal &gt;&gt; info.txt\n   89  cat -n info.txt | more\n   90  ln -s \/root \/home\/myroot\n   91  ls -l \/home\n   92  rm \/home\/myroot\n   93  ls -l \/home\/\n   94  ln -s \/root \/home\/myroot\n   95  ls\n   96  cd \/home\/myroot\n   97  pwd\n   98  rm \/home\/myroot\n   99  pwd\n  100  cd ..\n  101  ls\n  102  cd \/home\n  103  ls\n  104  ls -l\n  105  history\n[root@alanCentos01 home]# history 10\n   97  pwd\n   98  rm \/home\/myroot\n   99  pwd\n  100  cd ..\n  101  ls\n  102  cd \/home\n  103  ls\n  104  ls -l\n  105  history\n  106  history 10\n\n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6267\u884c\u5386\u53f2\u7f16\u53f7\u4e3a 97 \u7684\u6307\u4ee4<\/span>\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# !97\npwd\n\/home\n\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u5341\u3001\u65f6\u95f4\u65e5\u671f\u7c7b<\/h3>\n<ol>\n<li>date\u6307\u4ee4\n<p>\u8bf4\u660e\uff1a\u663e\u793a\u5f53\u524d\u65e5\u671f<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>date\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u663e\u793a\u5f53\u524d\u65f6\u95f4\uff09<\/li>\n<li>date +%Y\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u663e\u793a\u5f53\u524d\u5e74\u4efd\uff09<\/li>\n<li>date +%m\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u663e\u793a\u5f53\u524d\u6708\u4efd\uff09<\/li>\n<li>date +%d \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u663e\u793a\u5f53\u524d\u662f\u54ea\u4e00\u5929\uff09<\/li>\n<li>\n<p>date &#8220;+%Y-%m-%d %H:%M:%S&#8221;\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u663e\u793a\u5e74\u6708\u65e5\u65f6\u5206\u79d2\uff09<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# date\n2021\u5e74 04\u6708 11\u65e5 \u661f\u671f\u65e5 15:33:06 CST\n[root@alanCentos01 home]# date \"+%Y-%m-%d\"\n2021-04-11\n[root@alanCentos01 home]#  date \"+%Y-%m-%d %H:%M:%S\"\n2021-04-11 15:34:28\n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>date\u6307\u4ee4\n<p>\u8bf4\u660e\uff1a\u8bbe\u7f6e\u65e5\u671f<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>date -s \u5b57\u7b26\u4e32\u65f6\u95f4<\/p>\n<pre><code class=\"language-shell line-numbers\"> date -s \u201c2020-11-03 20:02:10\u201d\n\n<\/code><\/pre>\n<\/li>\n<li>cal\u6307\u4ee4\n<p>\u8bf4\u660e\uff1a\u67e5\u770b\u65e5\u5386\u6307\u4ee4cal<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>cal [\u9009\u9879]\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u4e0d\u52a0\u9009\u9879\uff0c\u663e\u793a\u672c\u6708\u65e5\u5386\uff09<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# cal\n     \u56db\u6708 2021     \n\u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d\n            1  2  3\n4  5  6  7  8  9 10\n11 12 13 14 15 16 17\n18 19 20 21 22 23 24\n25 26 27 28 29 30\n\n[root@alanCentos01 home]# cal 2020\n                              2020                               \n\n       \u4e00\u6708                   \u4e8c\u6708                   \u4e09\u6708        \n\u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d   \u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d   \u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d\n         1  2  3  4                      1    1  2  3  4  5  6  7\n5  6  7  8  9 10 11    2  3  4  5  6  7  8    8  9 10 11 12 13 14\n12 13 14 15 16 17 18    9 10 11 12 13 14 15   15 16 17 18 19 20 21\n19 20 21 22 23 24 25   16 17 18 19 20 21 22   22 23 24 25 26 27 28\n26 27 28 29 30 31      23 24 25 26 27 28 29   29 30 31\n\n       \u56db\u6708                   \u4e94\u6708                   \u516d\u6708        \n\u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d   \u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d   \u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d\n         1  2  3  4                   1  2       1  2  3  4  5  6\n5  6  7  8  9 10 11    3  4  5  6  7  8  9    7  8  9 10 11 12 13\n12 13 14 15 16 17 18   10 11 12 13 14 15 16   14 15 16 17 18 19 20\n19 20 21 22 23 24 25   17 18 19 20 21 22 23   21 22 23 24 25 26 27\n26 27 28 29 30         24 25 26 27 28 29 30   28 29 30\n                      31\n       \u4e03\u6708                   \u516b\u6708                   \u4e5d\u6708        \n\u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d   \u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d   \u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d\n         1  2  3  4                      1          1  2  3  4  5\n5  6  7  8  9 10 11    2  3  4  5  6  7  8    6  7  8  9 10 11 12\n12 13 14 15 16 17 18    9 10 11 12 13 14 15   13 14 15 16 17 18 19\n19 20 21 22 23 24 25   16 17 18 19 20 21 22   20 21 22 23 24 25 26\n26 27 28 29 30 31      23 24 25 26 27 28 29   27 28 29 30\n                      30 31\n       \u5341\u6708                  \u5341\u4e00\u6708                 \u5341\u4e8c\u6708       \n\u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d   \u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d   \u65e5 \u4e00 \u4e8c \u4e09 \u56db \u4e94 \u516d\n            1  2  3    1  2  3  4  5  6  7          1  2  3  4  5\n4  5  6  7  8  9 10    8  9 10 11 12 13 14    6  7  8  9 10 11 12\n11 12 13 14 15 16 17   15 16 17 18 19 20 21   13 14 15 16 17 18 19\n18 19 20 21 22 23 24   22 23 24 25 26 27 28   20 21 22 23 24 25 26\n25 26 27 28 29 30 31   29 30                  27 28 29 30 31\n[root@alanCentos01 home]#  \n\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u5341\u4e00\u3001\u641c\u7d22\u67e5\u627e\u7c7b<\/h3>\n<ol>\n<li>find\u6307\u4ee4\n<p>\u8bf4\u660e\uff1afind\u6307\u4ee4\u5c06\u4ece\u6307\u5b9a\u76ee\u5f55\u5411\u4e0b\u9012\u5f52\u5730\u904d\u5386\u5176\u5404\u4e2a\u5b50\u76ee\u5f55\uff0c\u5c06\u6ee1\u8db3\u6761\u4ef6\u7684\u6587\u4ef6\u6216\u8005\u76ee\u5f55\u663e\u793a\u5728\u7ec8\u7aef\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>find[\u641c\u7d22\u8303\u56f4\uff1a\u9009\u9879]<\/p>\n<p>\u9009\u9879\u8bf4\u660e\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>-name&lt;\u67e5\u8be2\u65b9\u5f0f>\uff1a\u5bf9\u7167\u6307\u5b9a\u7684\u6587\u4ef6\u540d\u67e5\u627e\u6587\u4ef6<\/li>\n<li>-user&lt;\u7528\u6237\u540d>\uff1a\u67e5\u627e\u5c5e\u4e8e\u6307\u5b9a\u7528\u6237\u540d\u7684\u6240\u6709\u6587\u4ef6<\/li>\n<li>\n<p>-size&lt;\u6587\u4ef6\u5927\u5c0f>\uff1a\u6309\u6307\u5b9a\u7684\u6587\u4ef6\u5927\u5c0f\u67e5\u627e\u6587\u4ef6\uff08+n \u5927\u4e8e-n \u5c0f\u4e8en \u7b49\u4e8e, \u5355\u4f4d\u6709 k,M,G\uff09<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 \/]# find \/home -name info.txt\n\/home\/info.txt\n[root@alanCentos01 \/]# find \/home -name *.txt\n\/home\/info.txt\n\/home\/cat.txt\n[root@alanCentos01 \/]# find \/home -user root\n\/home\n\/home\/info.txt\n\/home\/cat.txt\n[root@alanCentos01 \/]# find \/opt -size +10M\n\/opt\/VMwareTools-10.3.10-13959562.tar.gz\n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>locate\u6307\u4ee4\n<p>\u8bf4\u660e\uff1alocate \u6307\u4ee4\u53ef\u4ee5\u5feb\u901f\u5b9a\u4f4d\u6587\u4ef6\u8def\u5f84\u3002locate \u6307\u4ee4\u5229\u7528\u4e8b\u5148\u5efa\u7acb\u7684\u7cfb\u7edf\u4e2d\u6240\u6709\u6587\u4ef6\u540d\u79f0\u53ca\u8def\u5f84\u7684 locate \u6570\u636e\u5e93\u5b9e\u73b0\u5feb\u901f\u5b9a\u4f4d\u7ed9\u5b9a\u7684\u6587\u4ef6\u3002Locate \u6307\u4ee4\u65e0\u9700\u904d\u5386\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\uff0c\u67e5\u8be2\u901f\u5ea6\u8f83\u5feb\u3002\u4e3a\u4e86\u4fdd\u8bc1\u67e5\u8be2\u7ed3\u679c\u7684\u51c6\u786e\u5ea6\uff0c\u7ba1\u7406\u5458\u5fc5\u987b\u5b9a\u671f\u66f4\u65b0locate\u6570\u636e\u5e93\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>locate \u641c\u7d22\u6587\u4ef6<\/p>\n<p>\u7279\u522b\u8bf4\u660e\uff1a\u7531\u4e8e locate \u6307\u4ee4\u57fa\u4e8e\u6570\u636e\u5e93\u8fdb\u884c\u67e5\u8be2\uff0c\u6240\u4ee5\u7b2c\u4e00\u6b21\u8fd0\u884c\u524d\uff08<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6216\u7cfb\u7edf\u91cc\u9762\u6709\u65b0\u7684\u6587\u4ef6<\/span>\uff09\uff0c\u5fc5\u987b\u4f7f\u7528 updatedb \u6307\u4ee4\u521b\u5efa locate \u6570\u636e\u5e93\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 \/]# updatedb\n[root@alanCentos01 \/]# locate info.txt\n\/home\/info.txt\n\/usr\/share\/doc\/git-1.8.3.1\/git-mailinfo.txt\n\/usr\/share\/doc\/git-1.8.3.1\/git-update-server-info.txt\n\/usr\/share\/doc\/lshw-B.02.18\/proc_usb_info.txt\n\n<\/code><\/pre>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">which\u6216whereis\u6307\u4ee4\uff0c\u53ef\u4ee5\u67e5\u770b\u67d0\u4e2a\u6307\u4ee4\u5728\u54ea\u4e2a\u76ee\u5f55\u4e0b\uff0c\u6bd4\u5982 ls \u6307\u4ee4\u5728\u54ea\u4e2a\u76ee\u5f55<\/span><\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# which ls\nalias ls='ls --color=auto'\n\/usr\/bin\/ls\n[root@alanCentos01 home]# whereis ls\nls: \/usr\/bin\/ls \/usr\/share\/man\/man1\/ls.1.gz \/usr\/share\/man\/man1p\/ls.1p.gz\n\n<\/code><\/pre>\n<\/li>\n<li>grep\u6307\u4ee4\u548c\u7ba1\u9053\u7b26\u53f7\u201c|\u201d\n<p>\u8bf4\u660e\uff1agrep\u8fc7\u6ee4\u67e5\u627e \uff0c\u7ba1\u9053\u7b26\u201c|\u201d\uff0c\u8868\u793a\u5c06\u524d\u4e00\u4e2a\u547d\u4ee4\u7684\u5904\u7406\u7ed3\u679c\u8f93\u51fa\u4f20\u9012\u7ed9\u540e\u9762\u7684\u547d\u4ee4\u5904\u7406\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>grep [\u9009\u9879] \u67e5\u627e\u5185\u5bb9 \u6e90\u6587\u4ef6<\/p>\n<p>\u5e38\u7528\u9009\u9879\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>-n\uff1a\u663e\u793a\u5339\u914d\u884c\u53ca\u884c\u53f7<\/li>\n<li>\n<p>-i\uff1a\u5ffd\u7565\u5b57\u6bcd\u5927\u5c0f\u5199<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# cat -n hello.txt | grep -i \"yes\"\n    1   yes no yees y yes ok any kyes\n[root@alanCentos01 home]# grep -n -i \"yes\" hello.txt\n1:yes no yees y yes ok any kyes     \n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>\u5341\u4e8c\u3001\u538b\u7f29\u548c\u89e3\u538b\u7c7b<\/h3>\n<ol>\n<li>gzip\/gunzip\u6307\u4ee4\n<p>\u8bf4\u660e\uff1agzip\u7528\u4e8e\u538b\u7f29\u6587\u4ef6\uff0c gunzip\u7528\u4e8e\u89e3\u538b\u7684\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>gzip\u6587\u4ef6\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u538b\u7f29\u6587\u4ef6\uff0c\u53ea\u80fd\u5c06\u6587\u4ef6\u538b\u7f29\u4e3a*.gz \u6587\u4ef6\uff09<\/p>\n<\/li>\n<li>\n<p>gunzip\u6587\u4ef6.gz \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u89e3\u538b\u7f29\u6587\u4ef6\u547d\u4ee4\uff09<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]#  gzip \/home\/hello.txt\n[root@alanCentos01 home]# ls\nalan  cat.txt  dog.txt  hello.txt.gz  info.txt\n[root@alanCentos01 home]# gunzip \/home\/hello.txt.gz\n[root@alanCentos01 home]# ls\nalan  cat.txt  dog.txt  hello.txt  info.txt\n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>zip\/unzip\u6307\u4ee4\n<p>\u8bf4\u660e\uff1azip \u7528\u4e8e\u538b\u7f29\u6587\u4ef6\uff0c unzip \u7528\u4e8e\u89e3\u538b\u7684\uff0c\u8fd9\u4e2a\u5728\u9879\u76ee\u6253\u5305\u53d1\u5e03\u4e2d\u5f88\u6709\u7528\u7684\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>zip [\u9009\u9879] XXX.zip\u5c06\u8981\u538b\u7f29\u7684\u5185\u5bb9\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u538b\u7f29\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u547d\u4ee4\uff09<\/li>\n<li>\n<p>unzip [\u9009\u9879] XXX.zip\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u89e3\u538b\u7f29\u6587\u4ef6\uff09<\/p>\n<p>zip\u5e38\u7528\u9009\u9879\uff1a<\/p>\n<p>-r\uff1a\u9012\u5f52\u538b\u7f29\uff0c\u5373\u538b\u7f29\u76ee\u5f55<\/p>\n<p>unzip \u7684\u5e38\u7528\u9009\u9879\uff1a<\/p>\n<p>-d&lt;\u76ee\u5f55> \uff1a\u6307\u5b9a\u89e3\u538b\u540e\u6587\u4ef6\u7684\u5b58\u653e\u76ee\u5f55<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# zip -r myhome.zip \/home\/\n adding: home\/ (stored 0%)\n adding: home\/info.txt (deflated 25%)\n adding: home\/cat.txt (deflated 20%)\n adding: home\/dog.txt (deflated 20%)\n adding: home\/alan\/ (stored 0%)\n adding: home\/alan\/.bashrc (deflated 23%)\n adding: home\/alan\/.config\/ (stored 0%)\n adding: home\/alan\/.config\/abrt\/ (stored 0%)\n adding: home\/alan\/.bash_profile (deflated 21%)\n adding: home\/alan\/.bash_history (deflated 64%)\n adding: home\/alan\/.mozilla\/ (stored 0%)\n adding: home\/alan\/.mozilla\/plugins\/ (stored 0%)\n adding: home\/alan\/.mozilla\/extensions\/ (stored 0%)\n adding: home\/alan\/.cache\/ (stored 0%)\n adding: home\/alan\/.cache\/abrt\/ (stored 0%)\n adding: home\/alan\/.cache\/abrt\/lastnotification (stored 0%)\n adding: home\/alan\/.bash_logout (stored 0%)\n adding: home\/alan\/.Xauthority (stored 0%)\n adding: home\/hello.txt (deflated 7%)\n[root@alanCentos01 home]# ls\nalan  cat.txt  dog.txt  hello.txt  info.txt  myhome.zip\n[root@alanCentos01 home]# mkdir \/opt\/tmp\n[root@alanCentos01 home]# ls \/opt\/\nrh  tmp  VMwareTools-10.3.10-13959562.tar.gz  vmware-tools-distrib\n[root@alanCentos01 home]# unzip -d \/opt\/tmp \/home\/myhome.zip\nArchive:  \/home\/myhome.zip\n  creating: \/opt\/tmp\/home\/\n inflating: \/opt\/tmp\/home\/info.txt  \n inflating: \/opt\/tmp\/home\/cat.txt   \n inflating: \/opt\/tmp\/home\/dog.txt   \n  creating: \/opt\/tmp\/home\/alan\/\n inflating: \/opt\/tmp\/home\/alan\/.bashrc  \n  creating: \/opt\/tmp\/home\/alan\/.config\/\n  creating: \/opt\/tmp\/home\/alan\/.config\/abrt\/\n inflating: \/opt\/tmp\/home\/alan\/.bash_profile  \n inflating: \/opt\/tmp\/home\/alan\/.bash_history  \n  creating: \/opt\/tmp\/home\/alan\/.mozilla\/\n  creating: \/opt\/tmp\/home\/alan\/.mozilla\/plugins\/\n  creating: \/opt\/tmp\/home\/alan\/.mozilla\/extensions\/\n  creating: \/opt\/tmp\/home\/alan\/.cache\/\n  creating: \/opt\/tmp\/home\/alan\/.cache\/abrt\/\nextracting: \/opt\/tmp\/home\/alan\/.cache\/abrt\/lastnotification  \nextracting: \/opt\/tmp\/home\/alan\/.bash_logout  \nextracting: \/opt\/tmp\/home\/alan\/.Xauthority  \n inflating: \/opt\/tmp\/home\/hello.txt  \n[root@alanCentos01 home]# ls \/opt\/tmp\nhome\n[root@alanCentos01 home]#\n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ol start=\"3\">\n<li>tar\u6307\u4ee4\n<p>\u8bf4\u660e\uff1atar\u6307\u4ee4\u662f\u6253\u5305\u6307\u4ee4\uff0c\u6700\u540e\u6253\u5305\u540e\u7684\u6587\u4ef6\u662f .tar.gz\u7684\u6587\u4ef6\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>tar [\u9009\u9879] XXX.tar.gz \u6253\u5305\u7684\u5185\u5bb9 (\u529f\u80fd\u63cf\u8ff0\uff1a\u6253\u5305\u76ee\u5f55\uff0c\u538b\u7f29\u540e\u7684\u6587\u4ef6\u683c\u5f0f.tar.gz)<\/p>\n<p>\u9009\u9879\u8bf4\u660e\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>-c\uff1a\u4ea7\u751f.tar\u6253\u5305\u6587\u4ef6<\/li>\n<li>-v\uff1a\u663e\u793a\u8be6\u7ec6\u4fe1\u606f<\/li>\n<li>-f\uff1a\u6307\u5b9a\u538b\u7f29\u540e\u7684\u6587\u4ef6\u540d<\/li>\n<li>-z\uff1a\u6253\u5305\u540c\u65f6\u538b\u7f29<\/li>\n<li>\n<p>-x\uff1a\u89e3\u5305.tar\u6587\u4ef6<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 \/]# tar -zcvf \/home\/pc.tar.gz home\/cat.txt home\/dog.txt\nhome\/cat.txt\nhome\/dog.txt\n[root@alanCentos01 \/]# ls -lh \/home\/\n\u603b\u7528\u91cf 24K\ndrwx------. 5 alan alan 4.0K 4\u6708   5 23:17 alan\n-rw-r--r--. 1 root root  114 4\u6708  11 13:43 cat.txt\n-rw-r--r--. 1 root root  114 4\u6708  11 22:49 dog.txt\n-rw-r--r--. 1 root root   30 4\u6708  11 22:55 hello.txt\n-rw-r--r--. 1 root root  302 4\u6708  11 13:49 info.txt\n-rw-r--r--. 1 root root  235 4\u6708  12 22:56 pc.tar.gz\n[root@alanCentos01 \/]# tar -zcvf \/opt\/myhome.tar.gz home\/\nhome\/\nhome\/info.txt\nhome\/cat.txt\nhome\/dog.txt\nhome\/pc.tar.gz\nhome\/alan\/\nhome\/alan\/.bashrc\nhome\/alan\/.config\/\nhome\/alan\/.config\/abrt\/\nhome\/alan\/.bash_profile\nhome\/alan\/.bash_history\nhome\/alan\/.mozilla\/\nhome\/alan\/.mozilla\/plugins\/\nhome\/alan\/.mozilla\/extensions\/\nhome\/alan\/.cache\/\nhome\/alan\/.cache\/abrt\/\nhome\/alan\/.cache\/abrt\/lastnotification\nhome\/alan\/.bash_logout\nhome\/alan\/.Xauthority\nhome\/hello.txt\n[root@alanCentos01 \/]# ls -lh \/opt\n\u603b\u7528\u91cf 54M\n-rw-r--r--. 1 root root 1.6K 4\u6708  12 23:03 myhome.tar.gz\ndrwxr-xr-x. 2 root root 4.0K 10\u6708 31 2018 rh\n-rw-r--r--. 1 root root  54M 6\u6708  13 2019 VMwareTools-10.3.10-13959562.tar.gz\ndrwxr-xr-x. 9 root root 4.0K 6\u6708  13 2019 vmware-tools-distrib\n[root@alanCentos01 home]# ls\nalan  cat.txt  dog.txt  hello.txt  info.txt  pc.tar.gz\n[root@alanCentos01 home]# tar -zxvf pc.tar.gz\nhome\/cat.txt\nhome\/dog.txt\n[root@alanCentos01 home]# ls\nalan  cat.txt  dog.txt  hello.txt  home  info.txt  pc.tar.gz\n[root@alanCentos01 opt]# tar -zxvf myhome.tar.gz -C \/opt\/tmp\/\nhome\/\nhome\/info.txt\nhome\/cat.txt\nhome\/dog.txt\nhome\/pc.tar.gz\nhome\/alan\/\nhome\/alan\/.bashrc\nhome\/alan\/.config\/\nhome\/alan\/.config\/abrt\/\nhome\/alan\/.bash_profile\nhome\/alan\/.bash_history\nhome\/alan\/.mozilla\/\nhome\/alan\/.mozilla\/plugins\/\nhome\/alan\/.mozilla\/extensions\/\nhome\/alan\/.cache\/\nhome\/alan\/.cache\/abrt\/\nhome\/alan\/.cache\/abrt\/lastnotification\nhome\/alan\/.bash_logout\nhome\/alan\/.Xauthority\nhome\/hello.txt\n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>\u5341\u4e09\u3001\u7ec4\u7ba1\u7406\u548c\u6743\u9650\u7ba1\u7406<\/h3>\n<ol>\n<li>\u67e5\u770b\u6587\u4ef6\u7684\u6240\u6709\u8005\n<p>\u6307\u4ee4\uff1als \u2013ahl<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# ls -alh\n\u603b\u7528\u91cf 28K\ndrwxr-xr-x.  3 root root 4.0K 4\u6708  12 23:14 .\ndr-xr-xr-x. 18 root root 4.0K 4\u6708  12 22:59 ..\ndrwx------.  5 alan alan 4.0K 4\u6708   5 23:17 alan\n-rw-r--r--.  1 root root  114 4\u6708  11 13:43 cat.txt\n-rw-r--r--.  1 root root  114 4\u6708  11 22:49 dog.txt\n-rw-r--r--.  1 root root   30 4\u6708  11 22:55 hello.txt\n-rw-r--r--.  1 root root  302 4\u6708  11 13:49 info.txt\n\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210413222656406.png\" alt=\"image-20210413222656406\" \/><\/p>\n<\/li>\n<li>\n<p>\u4fee\u6539\u6587\u4ef6\u6240\u6709\u8005<\/p>\n<p>\u6307\u4ee4\uff1achown \u7528\u6237\u540d \u6587\u4ef6\u540d<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# ls -lh\n\u603b\u7528\u91cf 20K\ndrwx------. 5 alan alan 4.0K 4\u6708   5 23:17 alan\n-rw-r--r--. 1 root root    0 4\u6708  13 22:29 apple.txt\n-rw-r--r--. 1 root root  114 4\u6708  11 13:43 cat.txt\n-rw-r--r--. 1 root root  114 4\u6708  11 22:49 dog.txt\n-rw-r--r--. 1 root root   30 4\u6708  11 22:55 hello.txt\n-rw-r--r--. 1 root root  302 4\u6708  11 13:49 info.txt\n[root@alanCentos01 home]# chown alan apple.txt \n[root@alanCentos01 home]# ls -lh\n\u603b\u7528\u91cf 20K\ndrwx------. 5 alan alan 4.0K 4\u6708   5 23:17 alan\n-rw-r--r--. 1 alan root    0 4\u6708  13 22:29 apple.txt\n-rw-r--r--. 1 root root  114 4\u6708  11 13:43 cat.txt\n-rw-r--r--. 1 root root  114 4\u6708  11 22:49 dog.txt\n-rw-r--r--. 1 root root   30 4\u6708  11 22:55 hello.txt\n-rw-r--r--. 1 root root  302 4\u6708  11 13:49 info.txt\n[root@alanCentos01 home]# \n\n<\/code><\/pre>\n<\/li>\n<li>\u7ec4\u7684\u521b\u5efa\n<p>\u6307\u4ee4\uff1agroupadd \u7ec4\u540d<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# groupadd monster\n[root@alanCentos01 home]# useradd -g monster fox\n[root@alanCentos01 home]# id fox\nuid=1001(fox) gid=1003(monster) \u7ec4=1003(monster)\n\n<\/code><\/pre>\n<\/li>\n<li>\u6587\u4ef6\/\u76ee\u5f55\u6240\u5728\u7ec4\n<p>\u8bf4\u660e\uff1a\u5f53\u67d0\u4e2a\u7528\u6237\u521b\u5efa\u4e86\u4e00\u4e2a\u6587\u4ef6\u540e\uff0c\u8fd9\u4e2a\u6587\u4ef6\u7684\u6240\u5728\u7ec4\u5c31\u662f\u8be5\u7528\u6237\u6240\u5728\u7684\u7ec4(\u9ed8\u8ba4)\u3002<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u6587\u4ef6\/\u76ee\u5f55\u6240\u5728\u7ec4<\/p>\n<p>\u6307\u4ee4\uff1als -ahl<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# ls -ahl\n\u603b\u7528\u91cf 32K\ndrwxr-xr-x.  4 root root    4.0K 4\u6708  13 22:34 .\ndr-xr-xr-x. 18 root root    4.0K 4\u6708  12 22:59 ..\ndrwx------.  5 alan alan    4.0K 4\u6708   5 23:17 alan\n-rw-r--r--.  1 alan root       0 4\u6708  13 22:29 apple.txt\n-rw-r--r--.  1 root root     114 4\u6708  11 13:43 cat.txt\n-rw-r--r--.  1 root root     114 4\u6708  11 22:49 dog.txt\ndrwx------.  3 fox  monster 4.0K 4\u6708  13 22:34 fox\n-rw-r--r--.  1 root root      30 4\u6708  11 22:55 hello.txt\n-rw-r--r--.  1 root root     302 4\u6708  11 13:49 info.txt\n[root@alanCentos01 home]# \n\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210413223853905.png\" alt=\"image-20210413223853905\" \/><\/p>\n<\/li>\n<li>\n<p>\u4fee\u6539\u6587\u4ef6\/\u76ee\u5f55\u6240\u5728\u7684\u7ec4<\/p>\n<p>\u6307\u4ee4\uff1achgrp \u7ec4\u540d \u6587\u4ef6\u540d<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 home]# groupadd fruit\n[root@alanCentos01 home]# touch orange.txt\n[root@alanCentos01 home]# ls -alh\n\u603b\u7528\u91cf 32K\ndrwxr-xr-x.  4 root root    4.0K 4\u6708  13 22:40 .\ndr-xr-xr-x. 18 root root    4.0K 4\u6708  12 22:59 ..\ndrwx------.  5 alan alan    4.0K 4\u6708   5 23:17 alan\n-rw-r--r--.  1 alan root       0 4\u6708  13 22:29 apple.txt\n-rw-r--r--.  1 root root     114 4\u6708  11 13:43 cat.txt\n-rw-r--r--.  1 root root     114 4\u6708  11 22:49 dog.txt\ndrwx------.  3 fox  monster 4.0K 4\u6708  13 22:34 fox\n-rw-r--r--.  1 root root      30 4\u6708  11 22:55 hello.txt\n-rw-r--r--.  1 root root     302 4\u6708  11 13:49 info.txt\n-rw-r--r--.  1 root root       0 4\u6708  13 22:40 orange.txt\n[root@alanCentos01 home]# chgrp fruit orange.txt \n[root@alanCentos01 home]# ls -alh\n\u603b\u7528\u91cf 32K\ndrwxr-xr-x.  4 root root    4.0K 4\u6708  13 22:40 .\ndr-xr-xr-x. 18 root root    4.0K 4\u6708  12 22:59 ..\ndrwx------.  5 alan alan    4.0K 4\u6708   5 23:17 alan\n-rw-r--r--.  1 alan root       0 4\u6708  13 22:29 apple.txt\n-rw-r--r--.  1 root root     114 4\u6708  11 13:43 cat.txt\n-rw-r--r--.  1 root root     114 4\u6708  11 22:49 dog.txt\ndrwx------.  3 fox  monster 4.0K 4\u6708  13 22:34 fox\n-rw-r--r--.  1 root root      30 4\u6708  11 22:55 hello.txt\n-rw-r--r--.  1 root root     302 4\u6708  11 13:49 info.txt\n-rw-r--r--.  1 root fruit      0 4\u6708  13 22:40 orange.txt\n[root@alanCentos01 home]# \n\n<\/code><\/pre>\n<\/li>\n<li>\u5176\u5b83\u7ec4\n<p>\u8bf4\u660e\uff1a\u9664\u6587\u4ef6\u7684\u6240\u6709\u8005\u548c\u6240\u5728\u7ec4\u7684\u7528\u6237\u5916\uff0c\u7cfb\u7edf\u7684\u5176\u5b83\u7528\u6237\u90fd\u662f\u6587\u4ef6\u7684\u5176\u5b83\u7ec4\u3002<\/p>\n<\/li>\n<li>\n<p>\u6539\u53d8\u7528\u6237\u6240\u5728\u7ec4<\/p>\n<p>\u6307\u4ee4\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>usermod \u2013g \u65b0\u7ec4\u540d \u7528\u6237\u540d<\/p>\n<\/li>\n<li>\n<p>usermod \u2013d \u76ee\u5f55\u540d \u7528\u6237\u540d \u6539\u53d8\u8be5\u7528\u6237\u767b\u9646\u7684\u521d\u59cb\u76ee\u5f55\u3002\u7279\u522b\u8bf4\u660e\u7279\u522b\u8bf4\u660e\uff1a\u7528\u6237\u9700\u8981\u6709\u8fdb\u5165\u5230\u65b0\u76ee\u5f55\u7684\u6743\u9650\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 idea]# id zwj\nid: zwj: no such user\n[root@alanCentos01 idea]# useradd -g mojiao zwj\n[root@alanCentos01 idea]# id zwj\nuid=1002(zwj) gid=1002(mojiao) \u7ec4=1002(mojiao)\n[root@alanCentos01 idea]# cat \/etc\/group | grep wudang\nwudang:x:1001:\n[root@alanCentos01 idea]# usermod -g wudang zwj\n[root@alanCentos01 idea]# id zwj\nuid=1002(zwj) gid=1001(wudang) \u7ec4=1001(wudang)\n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ol start=\"9\">\n<li>\u6743\u9650\u7684\u57fa\u672c\u4ecb\u7ecd\n<p>ls -l \u4e2d\u663e\u793a\u7684\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p>-rwxrw-r&#8211; 1 root root 1213 Feb 2 09:39 abc<\/p>\n<p>0-9 \u4f4d\u8bf4\u660e\uff1a<\/p>\n<p>\u7b2c 0 \u4f4d\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b(d, &#8211; , l , c , b)<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>l\u662f\u94fe\u63a5\uff0c\u76f8\u5f53\u4e8e windows \u7684\u5feb\u6377\u65b9\u5f0f\u7684\u5feb\u6377\u65b9\u5f0f<\/p>\n<ul>\n<li>d\u662f\u76ee\u5f55\uff0c\u76f8\u5f53\u4e8e windows \u7684\u6587\u4ef6\u5939\u7684\u6587\u4ef6\u5939<\/p>\n<\/li>\n<li>\n<p>c\u662f\u5b57\u7b26\u8bbe\u5907\u6587\u4ef6\uff0c\u9f20\u6807\uff0c\u952e\u76d8<\/p>\n<\/li>\n<li>\n<p>b\u662f\u5757\u8bbe\u5907\uff0c\u6bd4\u5982\u786c\u76d8<\/p>\n<\/li>\n<li>\n<p>-\u4ee3\u8868\u662f\u4e00\u4e2a\u666e\u901a\u6587\u4ef6<\/p>\n<\/li>\n<\/ul>\n<p>\u7b2c1-3\u4f4d\u786e\u5b9a\u6240\u6709\u8005\uff08\u8be5\u6587\u4ef6\u7684\u6240\u6709\u8005\uff09\u62e5\u6709\u8be5\u6587\u4ef6\u7684\u6743\u9650&#8212;User<\/p>\n<p>\u7b2c4-6\u4f4d\u786e\u5b9a\u6240\u5c5e\u7ec4\uff08\u540c\u7528\u6237\u7ec4\u7684\uff09\u62e5\u6709\u8be5\u6587\u4ef6\u7684\u6743\u9650&#8212;Group<\/p>\n<p>\u7b2c7-9\u4f4d\u786e\u5b9a\u5176\u4ed6\u7528\u6237\u62e5\u6709\u8be5\u6587\u4ef6\u7684\u6743\u9650&#8212;Other<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210414221527911.png\" alt=\"image-20210414221527911\" \/><\/p>\n<p>\u5176\u5b83\u8bf4\u660e\uff1a<\/p>\n<ul>\n<li>1 &#8211; \u6587\u4ef6\uff1a\u786c\u8fde\u63a5\u6570\uff08\u76ee\u5f55\uff1a\u5b50\u76ee\u5f55\u6570\uff09<\/li>\n<li>root &#8211; \u7528\u6237<\/li>\n<li>root &#8211; \u7ec4<\/li>\n<li>1213\u6587\u4ef6\u5927\u5c0f(\u5b57\u8282)\uff0c\u5982\u679c\u662f\u6587\u4ef6\u5939\uff0c\u663e\u793a 4096 \u5b57\u8282<\/li>\n<li>Feb 2 09:39\u6700\u540e\u4fee\u6539\u65e5\u671f<\/li>\n<li>abc\u6587\u4ef6\u540d<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ol start=\"10\">\n<li>rwx\u6743\u9650\u8be6\u89e3\n<p>rwx\u4f5c\u7528\u5230\u6587\u4ef6\uff1a<\/p>\n<ul>\n<li>[ r ]\u4ee3\u8868\u53ef\u8bfb(read)\uff1a\u53ef\u4ee5\u8bfb\u53d6\u3001\u67e5\u770b\u3002<\/li>\n<li>[ w ]\u4ee3\u8868\u53ef\u5199(write)\uff1a\u53ef\u4ee5\u4fee\u6539\uff0c<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u4f46\u662f\u4e0d\u4ee3\u8868\u53ef\u4ee5\u5220\u9664\u8be5\u6587\u4ef6\uff0c\u5220\u9664\u4e00\u4e2a\u6587\u4ef6\u7684\u524d\u63d0\u6761\u4ef6\u662f\u5bf9\u8be5\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u6709\u5199\u6743\u9650\uff0c\u624d\u80fd\u5220\u9664\u8be5\u6587\u4ef6<\/span>\u3002<\/li>\n<li>[ x ]\u4ee3\u8868\u53ef\u6267\u884c(execute)\uff1a\u53ef\u4ee5\u88ab\u6267\u884c\u3002<\/li>\n<\/ul>\n<p>rwx\u4f5c\u7528\u5230\u76ee\u5f55\uff1a<\/p>\n<ul>\n<li>[ r ]\u4ee3\u8868\u53ef\u8bfb(read)\uff1a\u53ef\u4ee5\u8bfb\u53d6\uff0cls \u67e5\u770b\u76ee\u5f55\u5185\u5bb9\u3002<\/li>\n<li>[ w ]\u4ee3\u8868\u53ef\u5199(write)\uff1a\u53ef\u4ee5\u4fee\u6539, <span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u5bf9\u76ee\u5f55\u5185\u521b\u5efa+\u5220\u9664+\u91cd\u547d\u540d\u76ee\u5f55<\/span>\u3002<\/li>\n<li>[ x ]\u4ee3\u8868\u53ef\u6267\u884c(execute)\uff1a\u53ef\u4ee5\u8fdb\u5165\u8be5\u76ee\u5f55\u3002<\/li>\n<\/ul>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u8bf4\u660e\uff1a\u53ef\u7528\u6570\u5b57\u8868\u793a\u4e3a: r=4,w=2,x=1 \u56e0\u6b64 rwx=4+2+1=7 , \u6570\u5b57\u53ef\u4ee5\u8fdb\u884c\u7ec4\u5408\uff08\u59827\u5c31\u8868\u793a\u6743\u9650rwx\uff09\u3002<\/span><\/p>\n<\/li>\n<li>\n<p>\u4fee\u6539\u6743\u9650<\/p>\n<p>\u57fa\u672c\u8bf4\u660e\uff1a\u901a\u8fc7 chmod \u6307\u4ee4\uff0c\u53ef\u4ee5\u4fee\u6539\u6587\u4ef6\u6216\u8005\u76ee\u5f55\u6587\u4ef6\u6216\u8005\u76ee\u5f55\u7684\u6743\u9650\u3002<\/p>\n<ul>\n<li>\u7b2c\u4e00\u79cd\u65b9\u5f0f\uff1a+ \u3001-\u3001= \u53d8\u66f4\u6743\u9650\n<p>u\uff1a\u6240\u6709\u8005\uff0cg\uff1a\u6240\u6709\u7ec4\uff0co\uff1a\u5176\u4ed6\u4eba\uff0ca\uff1a\u6240\u6709\u4eba(u\u3001g\u3001o \u7684\u603b\u548c)<\/p>\n<p>1) chmod u=rwx,g=rx,o=x \u6587\u4ef6\/\u76ee\u5f55\u540d<\/p>\n<p>2) chmod o+w \u6587\u4ef6\/\u76ee\u5f55\u540d<\/p>\n<p>3) chmod a-x \u6587\u4ef6\/\u76ee\u5f55\u540d<\/p>\n<pre><code class=\"language-shell line-numbers\">chmod u=rwx,g=rx,o=rx abc.txt\nchmod u-x,g+w abc.txt\nchmod a+r abc.txt\n\n<\/code><\/pre>\n<\/li>\n<li>\u7b2c\u4e8c\u79cd\u65b9\u5f0f\uff1a\u901a\u8fc7\u6570\u5b57\u53d8\u66f4\u6743\u9650\n<p>r=4\uff0cw=2\uff0cx=1\uff0crwx=4+2+1=7<\/p>\n<p>chmod u=rwx,g=rx,o=x \u6587\u4ef6\u76ee\u5f55\u540d\uff1a\u76f8\u5f53\u4e8e chmod 751 \u6587\u4ef6\/\u76ee\u5f55\u540d<\/p>\n<pre><code class=\"language-shell line-numbers\">chmod 755 \/home\/abc.txt\n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u4fee\u6539\u6587\u4ef6\u6240\u6709\u8005\n<p>\u57fa\u672c\u4ecb\u7ecd\uff1a<\/p>\n<p>chown newowner \u6587\u4ef6\/\u76ee\u5f55 \u6539\u53d8\u6240\u6709\u8005<\/p>\n<p>chown newowner:newgroup \u6587\u4ef6\/\u76ee\u5f55 \u6539\u53d8\u6240\u6709\u8005\u548c\u6240\u5728\u7ec4<\/p>\n<p>-R \u5982\u679c\u662f\u76ee\u5f55 \u5219\u4f7f\u5176\u4e0b\u6240\u6709\u5b50\u6587\u4ef6\u6216\u76ee\u5f55\u9012\u5f52\u751f\u6548<\/p>\n<pre><code class=\"language-shell line-numbers\">chown tom \/home\/abc.txt\nchown -R tom \/home\/test\n\n<\/code><\/pre>\n<\/li>\n<li>\u4fee\u6539\u6587\u4ef6\/\u76ee\u5f55\u6240\u5728\u7ec4\n<p>\u57fa\u672c\u4ecb\u7ecd\uff1a<\/p>\n<p>chgrp newgroup \u6587\u4ef6\/\u76ee\u5f55<\/p>\n<pre><code class=\"language-shell line-numbers\">groupadd shaolin\nchgrp shaolin \/home\/abc.txt\nchgrp -R shaolin \/home\/test\n\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u5341\u56db\u3001\u5b9a\u65f6\u4efb\u52a1\u8c03\u5ea6<\/h3>\n<ol>\n<li>crond\u4efb\u52a1\u8c03\u5ea6\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>crontab [\u9009\u9879]<\/p>\n<p>\u5e38\u7528\u9009\u9879\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>-e\uff1a\u7f16\u8f91crontab\u5b9a\u65f6\u4efb\u52a1<\/li>\n<li>-l\uff1a\u67e5\u8be2\u5f53\u524d\u7528\u6237crontab\u4efb\u52a1<\/li>\n<li>\n<p>-r\uff1a\u5220\u9664\u5f53\u524d\u7528\u6237\u6240\u6709\u7684crontab\u4efb\u52a1<\/p>\n<p>\u5feb\u901f\u5165\u95e8\uff1a<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u7f6e\u4efb\u52a1\u8c03\u5ea6\u6587\u4ef6\uff1a\/etc\/crontab<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u7f6e\u4e2a\u4eba\u4efb\u52a1\u8c03\u5ea6\uff1a\u6267\u884c crontab \u2013e \u547d\u4ee4\uff0c\u63a5\u7740\u8f93\u5165\u4efb\u52a1\u5230\u8c03\u5ea6\u6587\u4ef6\u3002<\/p>\n<p>\u5982\uff1a*\/1 * * * * ls \u2013l\/etc\/ > \/tmp\/to.txt\uff08\u610f\u601d\u8bf4\u6bcf\u5c0f\u65f6\u7684\u6bcf\u5206\u949f\u6267\u884c ls \u2013l \/etc\/ > \/tmp\/to.txt \u547d\u4ee4\uff09<\/p>\n<p>\u53c2\u6570\u7ec6\u8282\u8bf4\u660e\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210417114946984.png\" alt=\"image-20210417114946984\" \/><\/p>\n<p>\u7279\u6b8a\u7b26\u53f7\u7684\u8bf4\u660e\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210417115049322.png\" alt=\"image-20210417115049322\" \/><\/p>\n<p>\u7279\u6b8a\u65f6\u95f4\u6267\u884c\u6848\u4f8b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210417115147076.png\" alt=\"image-20210417115147076\" \/><\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a<\/p>\n<p>\u6848\u4f8b 1\uff1a\u6bcf\u9694 1 \u5206\u949f\uff0c\u5c31\u5c06\u5f53\u524d\u7684\u65e5\u671f\u4fe1\u606f\uff0c\u8ffd\u52a0\u5230 \/tmp\/mydate \u6587\u4ef6\u4e2d<\/p>\n<p>*\/1 * * * * date >> \/tmp\/mydate<\/p>\n<p>\u6848\u4f8b 2\uff1a\u6bcf\u9694 1 \u5206\u949f\uff0c \u5c06\u5f53\u524d\u65e5\u671f\u548c\u65e5\u5386\u90fd\u8ffd\u52a0\u5230 \/home\/mycal \u6587\u4ef6\u4e2d<\/p>\n<p>\u6b65\u9aa4:<\/p>\n<p>(1) vim \/home\/my.sh\u5199\u5165\u5185\u5bb9 date >> \/home\/mycal \u548c cal >> \/home\/mycal<\/p>\n<p>(2) \u7ed9 my.sh \u589e\u52a0\u6267\u884c\u6743\u9650\uff0cchmod u+x \/home\/my.sh<\/p>\n<p>(3) crontab -e\u589e\u52a0 *\/1 * * * *\/home\/my.sh<\/p>\n<p>\u6848\u4f8b 3:\u6bcf\u5929\u51cc\u6668 2:00 \u5c06 mysql \u6570\u636e\u5e93 testdb \uff0c\u5907\u4efd\u5230\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\u63d0\u793a: \u6307\u4ee4\u4e3amysqldump -u root -p \u5bc6\u7801 \u6570\u636e\u5e93 > \/home\/db.bak<\/p>\n<p>\u6b65\u9aa4(1) crontab -e<\/p>\n<p>\u6b65\u9aa4(2) 0 2 * * * mysqldump -u root -proot testdb > \/home\/db.bak<\/p>\n<p>crond\u76f8\u5173\u6307\u4ee4\uff1a<\/p>\n<\/li>\n<li>\n<p>conrtab \u2013e\uff1a\u7f16\u8f91crontab\u5b9a\u65f6\u4efb\u52a1<\/p>\n<\/li>\n<li>\n<p>conrtab \u2013r\uff1a\u5220\u9664\u5f53\u524d\u7528\u6237\u6240\u6709\u7684crontab\u4efb\u52a1<\/p>\n<\/li>\n<li>\n<p>crontab \u2013l\uff1a\u5217\u51fa\u5f53\u524d\u7528\u6237\u6709\u90a3\u4e9b\u4efb\u52a1\u8c03\u5ea6<\/p>\n<\/li>\n<li>\n<p>\u91cd\u542f\u4efb\u52a1\u8c03\u5ea6\uff1a<\/p>\n<p>&#8220;`shell<br \/>\n [root@alancentos \/]# systemctl restart crond<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\n<p>at \u5b9a\u65f6\u4efb\u52a1<\/p>\n<p>\u57fa\u672c\u4ecb\u7ecd\uff1a<\/p>\n<p>1)at \u547d\u4ee4\u662f\u4e00\u6b21\u6027\u5b9a\u65f6\u8ba1\u5212\u4efb\u52a1\uff0cat \u7684\u5b88\u62a4\u8fdb\u7a0b atd \u4f1a\u4ee5\u540e\u53f0\u6a21\u5f0f\u8fd0\u884c\uff0c\u68c0\u67e5\u4f5c\u4e1a\u961f\u5217\u6765\u8fd0\u884c\u3002<\/p>\n<p>2)\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0catd \u5b88\u62a4\u8fdb\u7a0b\u6bcf 60 \u79d2\u68c0\u67e5\u4f5c\u4e1a\u961f\u5217\uff0c\u6709\u4f5c\u4e1a\u65f6\uff0c\u4f1a\u68c0\u67e5\u4f5c\u4e1a\u8fd0\u884c\u65f6\u95f4\uff0c\u5982\u679c\u65f6\u95f4\u4e0e\u5f53\u524d\u65f6\u95f4\u5339\u914d\uff0c\u5219\u8fd0\u884c\u6b64\u4f5c\u4e1a\u3002<\/p>\n<p>3)at \u547d\u4ee4\u662f\u4e00\u6b21\u6027\u5b9a\u65f6\u8ba1\u5212\u4efb\u52a1\uff0c\u6267\u884c\u5b8c\u4e00\u4e2a\u4efb\u52a1\u540e\u4e0d\u518d\u6267\u884c\u6b64\u4efb\u52a1\u4e86\u3002<\/p>\n<p>4)\u5728\u4f7f\u7528 at \u547d\u4ee4\u7684\u65f6\u5019\uff0c\u4e00\u5b9a\u8981\u4fdd\u8bc1 atd \u8fdb\u7a0b\u7684\u542f\u52a8 , \u53ef\u4ee5\u4f7f\u7528\u76f8\u5173\u6307\u4ee4\u6765\u67e5\u770b\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos \/]# ps -ef| grep atd\nroot       7718      1  0 11:18 ?        00:00:00 \/usr\/sbin\/atd -f\nroot       9278   9093  0 12:01 pts\/0    00:00:00 grep --color=auto atd\n[root@alancentos \/]# \n\n<\/code><\/pre>\n<p>at \u547d\u4ee4\u683c\u5f0f\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>at [\u65f6\u95f4]<\/li>\n<li>Ctrl + D\u7ed3\u675f at \u547d\u4ee4\u7684\u8f93\u5165\uff0c \u8f93\u51fa\u4e24\u6b21\u3002<\/li>\n<li>\n<p>\u5f3a\u5236\u9000\u51fa\uff08\u4e0d\u4fdd\u5b58\uff09\uff1aCtrl + C<\/p>\n<p>at \u65f6\u95f4\u5b9a\u4e49\uff1a<\/p>\n<p>1)\u63a5\u53d7\u5728\u5f53\u5929\u7684 hh:mm\uff08\u5c0f\u65f6:\u5206\u949f\uff09\u5f0f\u7684\u65f6\u95f4\u6307\u5b9a\u3002\u5047\u5982\u8be5\u65f6\u95f4\u5df2\u8fc7\u53bb\uff0c\u90a3\u4e48\u5c31\u653e\u5728\u7b2c\u4e8c\u5929\u6267\u884c\u3002 \u4f8b\u5982\uff1a04:00\u3002<\/p>\n<p>2)\u4f7f\u7528 midnight\uff08\u6df1\u591c\uff09\uff0cnoon\uff08\u4e2d\u5348\uff09\uff0cteatime\uff08\u996e\u8336\u65f6\u95f4\uff0c\u4e00\u822c\u662f\u4e0b\u5348 4 \u70b9\uff09\u7b49\u6bd4\u8f83\u6a21\u7cca\u7684\u8bcd\u8bed\u6765\u6307\u5b9a\u65f6\u95f4\u3002<\/p>\n<p>3)\u91c7\u7528 12 \u5c0f\u65f6\u8ba1\u65f6\u5236\uff0c\u5373\u5728\u65f6\u95f4\u540e\u9762\u52a0\u4e0a AM\uff08\u4e0a\u5348\uff09\u6216 PM\uff08\u4e0b\u5348\uff09\u6765\u8bf4\u660e\u662f\u4e0a\u5348\u8fd8\u662f\u4e0b\u5348\u3002 \u4f8b\u5982\uff1a12pm\u3002<\/p>\n<p>4)\u6307\u5b9a\u547d\u4ee4\u6267\u884c\u7684\u5177\u4f53\u65e5\u671f\uff0c\u6307\u5b9a\u683c\u5f0f\u4e3a month day\uff08\u6708 \u65e5\uff09\u6216 mm\/dd\/yy\uff08\u6708\/\u65e5\/\u5e74\uff09\u6216 dd.mm.yy\uff08\u65e5.\u6708.\u5e74\uff09\uff0c\u6307\u5b9a\u7684\u65e5\u671f\u5fc5\u987b\u8ddf\u5728\u6307\u5b9a\u65f6\u95f4\u7684\u540e\u9762\u3002 \u4f8b\u5982\uff1a04:00 2021-03-1\u3002<\/p>\n<p>5)\u4f7f\u7528\u76f8\u5bf9\u8ba1\u65f6\u6cd5\u3002\u6307\u5b9a\u683c\u5f0f\u4e3a\uff1anow + count time-units \uff0cnow \u5c31\u662f\u5f53\u524d\u65f6\u95f4\uff0ctime-units \u662f\u65f6\u95f4\u5355\u4f4d\uff0c\u8fd9\u91cc\u80fd\u591f\u662f minutes\uff08\u5206\u949f\uff09\u3001hours\uff08\u5c0f\u65f6\uff09\u3001days\uff08\u5929\uff09\u3001weeks\uff08\u661f\u671f\uff09\u3002count \u662f\u65f6\u95f4\u7684\u6570\u91cf\uff0c\u51e0\u5929\uff0c\u51e0\u5c0f\u65f6\u3002 \u4f8b\u5982\uff1anow + 5 minutes\uff085\u5206\u949f\u4ee5\u540e\uff09\u3002<\/p>\n<p>6)\u76f4\u63a5\u4f7f\u7528 today\uff08\u4eca\u5929\uff09\u3001tomorrow\uff08\u660e\u5929\uff09\u6765\u6307\u5b9a\u5b8c\u6210\u547d\u4ee4\u7684\u65f6\u95f4\u3002<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a<\/p>\n<\/li>\n<li>\n<p>\u6848\u4f8b 1\uff1a2 \u5929\u540e\u7684\u4e0b\u5348 5 \u70b9\u6267\u884c \/bin\/ls \/home<\/p>\n<p>&#8220;`shell<br \/>\n [root@alancentos ~]# at 5pm + 2day<br \/>\n at> \/bin\/ls \/home<EOT><br \/>\n job 2 at Mon Apr 19 17:00:00 2021<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u6848\u4f8b 2\uff1aatq \u547d\u4ee4\u6765\u67e5\u770b\u7cfb\u7edf\u4e2d\u6ca1\u6709\u6267\u884c\u7684\u5de5\u4f5c\u4efb\u52a1<\/p>\n<p>&#8220;`shell<br \/>\n [root@alancentos ~]# atq<br \/>\n 2  Mon Apr 19 17:00:00 2021 a root<br \/>\n 1  Mon Apr 19 17:00:00 2021 a root<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u6848\u4f8b 3\uff1a\u660e\u5929 17 \u70b9\u949f\uff0c\u8f93\u51fa\u65f6\u95f4\u5230\u6307\u5b9a\u6587\u4ef6\u5185 \u6bd4\u5982 \/home\/date100.log<\/p>\n<p>&#8220;`shell<br \/>\n [root@alancentos ~]# at 5pm tomorrow<br \/>\n at> date > \/home\/date100.log<EOT><br \/>\n job 7 at Sun Apr 18 17:00:00 2021<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u6848\u4f8b 4\uff1a2 \u5206\u949f\u540e\uff0c\u8f93\u51fa\u65f6\u95f4\u5230\u6307\u5b9a\u6587\u4ef6\u5185 \u6bd4\u5982 \/home\/date200.log<\/p>\n<p>&#8220;`shell<br \/>\n [root@alancentos ~]# at now + 2 minutes<br \/>\n at> date > \/home\/date200.log<EOT><br \/>\n job 5 at Sat Apr 17 16:17:00 2021<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u6848\u4f8b 5\uff1a\u5220\u9664\u5df2\u7ecf\u8bbe\u7f6e\u7684\u4efb\u52a1 , atrm \u7f16\u53f7<\/p>\n<p>&#8220;`shell<br \/>\n [root@alancentos ~]# atrm 2<br \/>\n [root@alancentos ~]# atrm 7<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<\/ul>\n<h3>\u5341\u4e94\u3001Linux \u78c1\u76d8\u5206\u533a\u3001\u6302\u8f7d<\/h3>\n<ol>\n<li>\n<p>Linux \u5206\u533a\uff1a<\/p>\n<p>\u539f\u7406\u4ecb\u7ecd\uff1a<\/p>\n<p>1)Linux \u6765\u8bf4\u65e0\u8bba\u6709\u51e0\u4e2a\u5206\u533a\uff0c\u5206\u7ed9\u54ea\u4e00\u76ee\u5f55\u4f7f\u7528\uff0c\u5b83\u5f52\u6839\u7ed3\u5e95\u5c31\u53ea\u6709\u4e00\u4e2a\u6839\u76ee\u5f55\uff0c\u4e00\u4e2a\u72ec\u7acb\u4e14\u552f\u4e00\u7684\u6587\u4ef6\u7ed3\u6784 , Linux\u4e2d\u6bcf\u4e2a\u5206\u533a\u90fd\u662f\u7528\u6765\u7ec4\u6210\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u7684\u4e00\u90e8\u5206\u3002<\/p>\n<p>2)Linux \u91c7\u7528\u4e86\u4e00\u79cd\u53eb\u201c\u8f7d\u5165\u201d\u7684\u5904\u7406\u65b9\u6cd5\uff0c\u5b83\u7684\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u4e2d\u5305\u542b\u4e86\u4e00\u6574\u5957\u7684\u6587\u4ef6\u548c\u76ee\u5f55\uff0c\u4e14\u5c06\u4e00\u4e2a\u5206\u533a\u548c\u4e00\u4e2a\u76ee\u5f55\u8054\u7cfb\u8d77\u6765\u3002\u8fd9\u65f6\u8981\u8f7d\u5165\u7684\u4e00\u4e2a\u5206\u533a\u5c06\u4f7f\u5b83\u7684\u5b58\u50a8\u7a7a\u95f4\u5728\u4e00\u4e2a\u76ee\u5f55\u4e0b\u83b7\u5f97\u3002<\/p>\n<\/li>\n<li>\n<p>\u786c\u76d8\u8bf4\u660e\uff1a<\/p>\n<p>1)Linux \u786c\u76d8\u5206 IDE \u786c\u76d8\u548c SCSI \u786c\u76d8\uff0c\u76ee\u524d\u57fa\u672c\u4e0a\u662f SCSI \u786c\u76d8<\/p>\n<p>2)\u5bf9\u4e8e IDE \u786c\u76d8\uff0c\u9a71\u52a8\u5668\u6807\u8bc6\u7b26\u4e3a\u201chdx~\u201d,\u5176\u4e2d\u201chd\u201d\u8868\u660e\u5206\u533a\u6240\u5728\u8bbe\u5907\u7684\u7c7b\u578b\uff0c\u8fd9\u91cc\u662f\u6307 IDE \u786c\u76d8\u4e86\u3002\u201cx\u201d\u4e3a\u76d8\u53f7\uff08a \u4e3a\u57fa\u672c\u76d8\uff0cb \u4e3a\u57fa\u672c\u4ece\u5c5e\u76d8\uff0cc \u4e3a\u8f85\u52a9\u4e3b\u76d8\uff0cd \u4e3a\u8f85\u52a9\u4ece\u5c5e\u76d8\uff09,\u201c~\u201d\u4ee3\u8868\u5206\u533a\uff0c\u524d\u56db\u4e2a\u5206\u533a\u7528\u6570\u5b57 1 \u5230 4 \u8868\u793a\uff0c\u5b83\u4eec\u662f\u4e3b\u5206\u533a\u6216\u6269\u5c55\u5206\u533a\uff0c\u4ece 5 \u5f00\u59cb\u5c31\u662f\u903b\u8f91\u5206\u533a\u3002\u4f8b\uff0chda3 \u8868\u793a\u4e3a\u7b2c\u4e00\u4e2a IDE \u786c\u76d8\u4e0a\u7684\u7b2c\u4e09\u4e2a\u4e3b\u5206\u533a\u6216\u6269\u5c55\u5206\u533a,hdb2\u8868\u793a\u4e3a\u7b2c\u4e8c\u4e2a IDE \u786c\u76d8\u4e0a\u7684\u7b2c\u4e8c\u4e2a\u4e3b\u5206\u533a\u6216\u6269\u5c55\u5206\u533a\u3002<\/p>\n<p>3)\u5bf9\u4e8e SCSI \u786c\u76d8\u5219\u6807\u8bc6\u4e3a\u201csdx~\u201d\uff0cSCSI \u786c\u76d8\u662f\u7528\u201csd\u201d\u6765\u8868\u793a\u5206\u533a\u6240\u5728\u8bbe\u5907\u7684\u7c7b\u578b\u7684\uff0c\u5176\u4f59\u5219\u548c IDE \u786c\u76d8\u7684\u8868\u793a\u65b9\u6cd5\u4e00\u6837\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos \/]# lsblk\nNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT\nsda      8:0    0   20G  0 disk \n\u251c\u2500sda1   8:1    0    1G  0 part \/boot\n\u251c\u2500sda2   8:2    0    2G  0 part [SWAP]\n\u2514\u2500sda3   8:3    0   17G  0 part \/\nsr0     11:0    1  4.3G  0 rom\n\n<\/code><\/pre>\n<\/li>\n<li>\u67e5\u770b\u6240\u6709\u8bbe\u5907\u6302\u8f7d\u60c5\u51b5\n<p>\u547d\u4ee4\uff1alsblk \u6216\u8005 lsblk -f<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alancentos \/]# lsblk\nNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT\nsda      8:0    0   20G  0 disk \n\u251c\u2500sda1   8:1    0    1G  0 part \/boot\n\u251c\u2500sda2   8:2    0    2G  0 part [SWAP]\n\u2514\u2500sda3   8:3    0   17G  0 part \/\nsr0     11:0    1  4.3G  0 rom\n[root@alancentos \/]# lsblk -f\nNAME   FSTYPE LABEL UUID                                 MOUNTPOINT\nsda                                                      \n\u251c\u2500sda1 ext4         6a2b7463-ff43-489c-82dd-e6b1626396f1 \/boot\n\u251c\u2500sda2 swap         a29ce550-1829-4db8-b6b5-85742a02a526 [SWAP]\n\u2514\u2500sda3 ext4         7b19ed3e-a667-475e-91f9-bf9cb964b98f \/\n\n<\/code><\/pre>\n<\/li>\n<li>\u6302\u8f7d\u7684\u7ecf\u5178\u6848\u4f8b\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u8bf4\u660e\uff1a\u4e0b\u9762\u6211\u4eec\u4ee5\u589e\u52a0\u4e00\u5757\u786c\u76d8\u589e\u52a0\u4e00\u5757\u786c\u76d8\u4e3a\u4f8b\u6765\u719f\u6089\u4e0b\u78c1\u76d8\u7684\u76f8\u5173\u6307\u4ee4\u548c\u6df1\u5165\u7406\u89e3\u78c1\u76d8\u5206\u533a\u3001\u6302\u8f7d\u3001\u5378\u8f7d\u7684\u6982\u5ff5\u3002<\/p>\n<\/li>\n<li>\n<p>\u5982\u4f55\u589e\u52a0\u4e00\u5757\u786c\u76d8\uff1a<\/p>\n<p>1)\u865a\u62df\u673a\u6dfb\u52a0\u786c\u76d8<\/p>\n<p>2)\u5206\u533a<\/p>\n<p>3)\u683c\u5f0f\u5316<\/p>\n<p>4)\u6302\u8f7d<\/p>\n<p>5)\u8bbe\u7f6e\u53ef\u4ee5\u81ea\u52a8\u6302\u8f7d<\/p>\n<\/li>\n<li>\n<p>\u865a\u62df\u673a\u589e\u52a0\u786c\u76d8\u6b65\u9aa41\uff1a<\/p>\n<p>\u5728\u3010\u865a\u62df\u673a\u3011\u83dc\u5355\u4e2d\uff0c\u9009\u62e9\u3010\u8bbe\u7f6e\u3011\uff0c\u7136\u540e\u8bbe\u5907\u5217\u8868\u91cc\u6dfb\u52a0\u786c\u76d8\uff0c\u7136\u540e\u4e00\u8def\u3010\u4e0b\u4e00\u6b65\u3011\uff0c\u4e2d\u95f4\u53ea\u6709\u9009\u62e9\u78c1\u76d8\u5927\u5c0f\u7684\u5730\u65b9\u9700\u8981\u4fee\u6539\uff0c\u81f3\u5230\u5b8c\u6210\u3002<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u7136\u540e\u91cd\u542f\u7cfb\u7edf\uff08\u624d\u80fd\u8bc6\u522b\uff09<\/span>\u3002<br \/>\n <img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210417171147139.png\" alt=\"image-20210417171147139\" \/><\/p>\n<\/li>\n<li>\n<p>\u865a\u62df\u673a\u589e\u52a0\u786c\u76d8\u6b65\u9aa42\uff1a<\/p>\n<p>\u5206\u533a\u547d\u4ee4\uff1afdisk \/dev\/sdb<\/p>\n<p>\u5f00\u59cb\u5bf9\/sdb \u5206\u533a<\/p>\n<ul>\n<li>m\uff1a\u663e\u793a\u547d\u4ee4\u5217\u8868<\/li>\n<li>p\uff1a\u663e\u793a\u78c1\u76d8\u5206\u533a \u540c fdisk \u2013l<\/li>\n<li>n\uff1a\u65b0\u589e\u5206\u533a<\/li>\n<li>d\uff1a\u5220\u9664\u5206\u533a<\/li>\n<li>w\uff1a\u5199\u5165\u5e76\u9000\u51fa<\/li>\n<li>\u8bf4\u660e\uff1a \u5f00\u59cb\u5206\u533a\u540e\u8f93\u5165 n\uff0c\u65b0\u589e\u5206\u533a\uff0c\u7136\u540e\u9009\u62e9 p \uff0c\u5206\u533a\u7c7b\u578b\u4e3a\u4e3b\u5206\u533a\u3002\u4e24\u6b21\u56de\u8f66\u9ed8\u8ba4\u5269\u4f59\u5168\u90e8\u7a7a\u95f4\u3002\u6700\u540e\u8f93\u5165 w\u5199\u5165\u5206\u533a\u5e76\u9000\u51fa\uff0c\u82e5\u4e0d\u4fdd\u5b58\u9000\u51fa\u8f93\u5165 q\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210417171453396.png\" alt=\"image-20210417171453396\" \/><\/li>\n<\/ul>\n<\/li>\n<li>\u865a\u62df\u673a\u589e\u52a0\u786c\u76d8\u6b65\u9aa43\uff1a\n<p>\u683c\u5f0f\u5316\u78c1\u76d8\uff1a<\/p>\n<p>\u5206\u533a\u547d\u4ee4\uff1amkfs -t ext4 \/dev\/sdb1\uff08\u5176\u4e2d ext4 \u662f\u5206\u533a\u7c7b\u578b\uff09<\/p>\n<\/li>\n<li>\n<p>\u865a\u62df\u673a\u589e\u52a0\u786c\u76d8\u6b65\u9aa44\uff1a<\/p>\n<p>\u6302\u8f7d\uff1a\u5c06\u4e00\u4e2a\u5206\u533a\u4e0e\u4e00\u4e2a\u76ee\u5f55\u8054\u7cfb\u8d77\u6765<\/p>\n<p>\u547d\u4ee4\uff1amount \u8bbe\u5907\u540d\u79f0 \u6302\u8f7d\u76ee\u5f55<\/p>\n<p>\u4f8b\u5982\uff1amount \/dev\/sdb1 \/newdisk<\/p>\n<p>\u53d6\u6d88\u6302\u8f7d\uff1aumount \u8bbe\u5907\u540d\u79f0 \u6216\u8005\u6302\u8f7d\u76ee\u5f55<\/p>\n<p>\u4f8b\u5982\uff1aumount \/dev\/sdb1 \u6216\u8005 umount \/newdisk<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f: \u7528\u547d\u4ee4\u884c\u6302\u8f7d,\u91cd\u542f\u540e\u4f1a\u5931\u91cd\u542f\u540e\u4f1a\u5931\u6548<\/span><\/p>\n<\/li>\n<li>\n<p>\u865a\u62df\u673a\u589e\u52a0\u786c\u76d8\u6b65\u9aa45<br \/>\n \u6c38\u4e45\u6302\u8f7d: \u901a\u8fc7\u4fee\u6539\/etc\/fstab \u5b9e\u73b0\u6302\u8f7d\uff0c\u6dfb\u52a0\u5b8c\u6210\u540e\uff0c\u6267\u884c mount \u2013a \u5373\u523b\u751f\u6548\u3002<br \/>\n <img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210418001537359.png\" alt=\"image-20210418001537359\" \/><\/p>\n<\/li>\n<\/ul>\n<ol start=\"5\">\n<li>\u78c1\u76d8\u60c5\u51b5\u67e5\u8be2<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u67e5\u8be2\u7cfb\u7edf\u6574\u4f53\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1adf -h<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a\u67e5\u8be2\u7cfb\u7edf\u6574\u4f53\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 \/]# df -h<br \/>\n \u6587\u4ef6\u7cfb\u7edf        \u5bb9\u91cf  \u5df2\u7528  \u53ef\u7528 \u5df2\u7528% \u6302\u8f7d\u70b9<br \/>\n \/dev\/sda3        17G  7.8G  8.1G   50% \/<br \/>\n devtmpfs        895M     0  895M    0% \/dev<br \/>\n tmpfs           910M     0  910M    0% \/dev\/shm<br \/>\n tmpfs           910M   11M  900M    2% \/run<br \/>\n tmpfs           910M     0  910M    0% \/sys\/fs\/cgroup<br \/>\n \/dev\/sda1       976M  144M  766M   16% \/boot<br \/>\n .host:\/         601G  517G   84G   87% \/mnt\/hgfs<br \/>\n tmpfs           182M   12K  182M    1% \/run\/user\/42<br \/>\n tmpfs           182M     0  182M    0% \/run\/user\/0<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<li>\n<p>\u67e5\u8be2\u6307\u5b9a\u76ee\u5f55\u7684\u78c1\u76d8\u5360\u7528\u60c5\u51b5<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1adu -h<\/p>\n<p>\u67e5\u8be2\u6307\u5b9a\u76ee\u5f55\u7684\u78c1\u76d8\u5360\u7528\u60c5\u51b5\uff0c\u9ed8\u8ba4\u4e3a\u5f53\u524d\u76ee\u5f55<br \/>\n \u53c2\u6570\uff1a<\/p>\n<p>-s \u6307\u5b9a\u76ee\u5f55\u5360\u7528\u5927\u5c0f\u6c47\u603b<\/p>\n<p>-h \u5e26\u8ba1\u91cf\u5355\u4f4d<\/p>\n<p>-a \u542b\u6587\u4ef6<\/p>\n<p>&#8211;max-depth=1\u5b50\u76ee\u5f55\u6df1\u5ea6<\/p>\n<p>-c \u5217\u51fa\u660e\u7ec6\u7684\u540c\u65f6\uff0c\u589e\u52a0\u6c47\u603b\u503c<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a\u67e5\u8be2 \/opt \u76ee\u5f55\u7684\u78c1\u76d8\u5360\u7528\u60c5\u51b5\uff0c\u6df1\u5ea6\u4e3a 1<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 \/]# du -hac &#8211;max-depth=1 \/opt<br \/>\n 54M    \/opt\/VMwareTools-10.3.10-13959562.tar.gz<br \/>\n 2.3G   \/opt\/idea<br \/>\n 163M   \/opt\/vmware-tools-distrib<br \/>\n 4.0K   \/opt\/rh<br \/>\n 2.6G   \/opt<br \/>\n 2.6G   \u603b\u7528\u91cf<br \/>\n [root@alanCentos01 \/]#<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<li>\n<p>\u78c1\u76d8\u60c5\u51b5-\u5de5\u4f5c\u5b9e\u7528\u6307\u4ee4<\/p>\n<p>1)\u7edf\u8ba1\/opt \u6587\u4ef6\u5939\u4e0b\u6587\u4ef6\u7684\u4e2a\u6570<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 \/]# ls -l \/opt | grep &quot;^-&quot; | wc -l<br \/>\n 1<\/p>\n<p>&#8220;`<\/p>\n<p>2)\u7edf\u8ba1\/opt \u6587\u4ef6\u5939\u4e0b\u76ee\u5f55\u7684\u4e2a\u6570<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 \/]# ls -l \/opt | grep &quot;^d&quot; | wc -l<br \/>\n 3<\/p>\n<p>&#8220;`<\/p>\n<p>3)\u7edf\u8ba1\/opt \u6587\u4ef6\u5939\u4e0b\u6587\u4ef6\u7684\u4e2a\u6570\uff0c\u5305\u62ec\u5b50\u6587\u4ef6\u5939\u91cc\u7684<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 \/]# ls -lR \/opt | grep &quot;^-&quot; | wc -l<br \/>\n 6061<\/p>\n<p>&#8220;`<\/p>\n<p>4)\u7edf\u8ba1\/opt \u6587\u4ef6\u5939\u4e0b\u76ee\u5f55\u7684\u4e2a\u6570\uff0c\u5305\u62ec\u5b50\u6587\u4ef6\u5939\u91cc\u7684<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 \/]# ls -lR \/opt | grep &quot;^d&quot; | wc -l<br \/>\n 1887<\/p>\n<p>&#8220;`<\/p>\n<p>5)\u4ee5\u6811\u72b6\u663e\u793a\u76ee\u5f55\u7ed3\u6784 tree \u76ee\u5f55 \uff0c \u6ce8\u610f\uff0c\u5982\u679c\u6ca1\u6709 tree ,\u5219\u4f7f\u7528 yum install tree \u5b89\u88c5<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 \/]# tree \/home<br \/>\n \/home<br \/>\n \u251c\u2500\u2500 alan<br \/>\n \u251c\u2500\u2500 apple.txt<br \/>\n \u251c\u2500\u2500 cat.txt<br \/>\n \u251c\u2500\u2500 dog.txt<br \/>\n \u251c\u2500\u2500 fox<br \/>\n \u251c\u2500\u2500 hello.txt<br \/>\n \u251c\u2500\u2500 info.txt<br \/>\n \u251c\u2500\u2500 orange.txt<br \/>\n \u251c\u2500\u2500 position.sh<br \/>\n \u2514\u2500\u2500 zwj<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<\/ul>\n<h3>\u5341\u516d\u3001\u7f51\u7edc\u914d\u7f6e<\/h3>\n<ol>\n<li>\n<p>\u67e5\u770b\u865a\u62df\u7f51\u7edc\u7f16\u8f91\u5668\u548c\u4fee\u6539IP\u5730\u5740<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210418133131035.png\" alt=\"image-20210418133131035\" \/><\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u7f51\u5173<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210418133329287.png\" alt=\"image-20210418133329287\" \/><\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b windows \u73af\u5883\u7684\u4e2d VMnet8 \u7f51\u7edc\u914d\u7f6e (ipconfig \u6307\u4ee4)<\/p>\n<pre><code class=\"language-powershell line-numbers\">\u4ee5\u592a\u7f51\u9002\u914d\u5668 VMware Network Adapter VMnet8:\n\n  \u8fde\u63a5\u7279\u5b9a\u7684 DNS \u540e\u7f00 . . . . . . . :\n  \u672c\u5730\u94fe\u63a5 IPv6 \u5730\u5740. . . . . . . . : fe80::c59c:7fd8:7caf:20e%14\n  IPv4 \u5730\u5740 . . . . . . . . . . . . : 192.168.18.1\n  \u5b50\u7f51\u63a9\u7801  . . . . . . . . . . . . : 255.255.255.0\n  \u9ed8\u8ba4\u7f51\u5173. . . . . . . . . . . . . :\n\n<\/code><\/pre>\n<\/li>\n<li>\u67e5\u770b linux \u7684\u7f51\u7edc\u914d\u7f6e(ifconfig\u6307\u4ee4)\n<pre><code class=\"language-shell line-numbers\">ens33: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1500\n       inet 192.168.18.128  netmask 255.255.255.0  broadcast 192.168.18.255\n       inet6 fe80::d886:4d18:f97f:b5c2  prefixlen 64  scopeid 0x20&lt;link&gt;\n       ether 00:0c:29:75:8c:9a  txqueuelen 1000  (Ethernet)\n       RX packets 4248173  bytes 5947975593 (5.5 GiB)\n       RX errors 0  dropped 0  overruns 0  frame 0\n       TX packets 368539  bytes 41417102 (39.4 MiB)\n       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n\n<\/code><\/pre>\n<\/li>\n<li>ping\u6d4b\u8bd5\u4e3b\u673a\u4e4b\u95f4\u7f51\u7edc\u8fde\u901a\u6027\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>ping \u76ee\u7684\u4e3b\u673a\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u6d4b\u8bd5\u5f53\u524d\u670d\u52a1\u5668\u662f\u5426\u53ef\u4ee5\u8fde\u63a5\u76ee\u7684\u4e3b\u673a\uff09<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a<\/p>\n<p>\u6d4b\u8bd5\u5f53\u524d\u670d\u52a1\u5668\u662f\u5426\u53ef\u4ee5\u8fde\u63a5\u767e\u5ea6<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 idea]# ping www.baidu.com\nPING www.a.shifen.com (14.215.177.38) 56(84) bytes of data.\n64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=128 time=18.4 ms\n64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=128 time=19.1 ms\n64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=128 time=19.0 ms\n64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=128 time=19.1 ms\n64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=5 ttl=128 time=19.0 ms\n64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=6 ttl=128 time=18.9 ms\n\n<\/code><\/pre>\n<\/li>\n<li>linux\u7f51\u7edc\u73af\u5883\u914d\u7f6e<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u79cd\u65b9\u6cd5(\u81ea\u52a8\u83b7\u53d6)\uff1a<\/p>\n<p>\u8bf4\u660e\uff1a\u767b\u9646\u540e\uff0c\u901a\u8fc7\u754c\u9762\u7684\u6765\u8bbe\u7f6e\u81ea\u52a8\u83b7\u53d6 ip\uff0c\u7279\u70b9\uff1alinux \u542f\u52a8\u540e\u4f1a\u81ea\u52a8\u83b7\u53d6 IP,\u7f3a\u70b9\u662f\u6bcf\u6b21\u81ea\u52a8\u83b7\u53d6\u7684 ip \u5730\u5740\u53ef\u80fd\u4e0d\u4e00\u6837\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c\u79cd\u65b9\u6cd5(\u6307\u5b9a ip)\uff1a<\/p>\n<p>\u8bf4\u660e\uff1a\u76f4\u63a5\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u6765\u6307\u5b9a IP,\u5e76\u53ef\u4ee5\u8fde\u63a5\u5230\u5916\u7f51(\u7a0b\u5e8f\u5458\u63a8\u8350)\u3002<\/p>\n<p>\u7f16\u8f91\uff1avim \/etc\/sysconfig\/network-scripts\/ifcfg-ens33<\/p>\n<p>\u8981\u6c42\uff1a\u5c06 ip \u5730\u5740\u914d\u7f6e\u7684\u9759\u6001\u7684\uff0c\u6bd4\u5982: ip \u5730\u5740\u4e3a 192.168.200.130<\/p>\n<p>ifcfg-ens33 \u6587\u4ef6\u8bf4\u660e<\/p>\n<p>DEVICE=eth0                                                                   #\u63a5\u53e3\u540d\uff08\u8bbe\u5907,\u7f51\u5361\uff09<\/p>\n<p>HWADDR=00:0C:2x:6x:0x:xx                                       #MAC \u5730\u5740<\/p>\n<p>TYPE=Ethernet                                                          #\u7f51\u7edc\u7c7b\u578b\uff08\u901a\u5e38\u662f Ethemet\uff09<\/p>\n<p>UUID=7a32ed1e-a44b-4679-a535-5c6935e5e6f4   #\u968f\u673a id<\/p>\n<p>#\u7cfb\u7edf\u542f\u52a8\u7684\u65f6\u5019\u7f51\u7edc\u63a5\u53e3\u662f\u5426\u6709\u6548\uff08yes\/no\uff09<\/p>\n<p>ONBOOT=yes<\/p>\n<p>#IP \u7684\u914d\u7f6e\u65b9\u6cd5[none|static|bootp|dhcp]\uff08\u5f15\u5bfc\u65f6\u4e0d\u4f7f\u7528\u534f\u8bae|\u9759\u6001\u5206\u914d IP|BOOTP \u534f\u8bae|DHCP \u534f\u8bae\uff09<\/p>\n<p>BOOTPROTO=static<\/p>\n<p>#IP \u5730\u5740<\/p>\n<p>IPADDR=192.168.18.128<\/p>\n<p>#\u7f51\u5173<\/p>\n<p>GATEWAY=192.168.18.2<\/p>\n<p>#\u57df\u540d\u89e3\u6790\u5668<\/p>\n<p>DNS1=192.168.18.2<\/p>\n<p>\u5b8c\u6574\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`shell<br \/>\n TYPE=Ethernet<br \/>\n PROXY_METHOD=none<br \/>\n BROWSER_ONLY=no<br \/>\n BOOTPROTO=static<br \/>\n DEFROUTE=yes<br \/>\n IPV4_FAILURE_FATAL=no<br \/>\n IPV6INIT=yes<br \/>\n IPV6_AUTOCONF=yes<br \/>\n IPV6_DEFROUTE=yes<br \/>\n IPV6_FAILURE_FATAL=no<br \/>\n IPV6_ADDR_GEN_MODE=stable-privacy<br \/>\n NAME=ens33<br \/>\n UUID=7a32ed1e-a44b-4679-a535-5c6935e5e6f4<br \/>\n DEVICE=ens33<br \/>\n ONBOOT=yes<br \/>\n IPADDR=192.168.18.7<br \/>\n PREFIX=24<br \/>\n GATEWAY=192.168.18.2<br \/>\n DNS1=192.168.18.2<\/p>\n<p>&#8220;`<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u91cd\u542f\u7f51\u7edc\u670d\u52a1\u6216\u8005\u91cd\u542f\u7cfb\u7edf\u751f\u6548<\/span><\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 idea]# systemctl restart network<br \/>\n [root@alanCentos01 idea]# reboot<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<\/ul>\n<ol start=\"7\">\n<li>\n<p>\u8bbe\u7f6e\u4e3b\u673a\u540d<\/p>\n<p>1)\u4e3a\u4e86\u65b9\u4fbf\u8bb0\u5fc6\uff0c\u53ef\u4ee5\u7ed9 linux \u7cfb\u7edf\u8bbe\u7f6e\u4e3b\u673a\u540d, \u4e5f\u53ef\u4ee5\u6839\u636e\u9700\u8981\u4fee\u6539\u4e3b\u673a\u540d\u3002<\/p>\n<p>2)\u6307\u4ee4hostname \uff1a\u67e5\u770b\u4e3b\u673a\u540d<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 opt]# hostname\nalanCentos01\n\n<\/code><\/pre>\n<p>3)\u4fee\u6539\u6587\u4ef6\u5728\/etc\/hostname\uff0c\u6307\u5b9a\u4e3b\u673a\u540d\u3002<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">4)\u4fee\u6539\u540e\uff0c\u91cd\u542f\u91cd\u542f\u751f\u6548\u3002<\/span><\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 opt]# sync\n[root@alanCentos01 opt]# reboot\n\n<\/code><\/pre>\n<\/li>\n<li>\u8bbe\u7f6e hosts \u6620\u5c04\n<p>\u601d\u8003\uff1a\u5982\u4f55\u901a\u8fc7\u4e3b\u673a\u540d\u80fd\u591f\u627e\u5230(\u6bd4\u5982ping) \u67d0\u4e2alinux \u7cfb\u7edf\uff1f<\/p>\n<p>windows\u7684\u65b9\u6cd5\uff1a<\/p>\n<p>\u5728C:\\Windows\\System32\\drivers\\etc\\hosts\u6587\u4ef6\u6307\u5b9a\u5373\u53ef\u3002<\/p>\n<p>\u6848\u4f8b: 192.168.200.130 hspedu100<\/p>\n<p>linux\u7684\u65b9\u6cd5\uff1a<\/p>\n<p>\u5728\/etc\/hosts \u6587\u4ef6\u6307\u5b9a\u3002<\/p>\n<p>\u6848\u4f8b: 192.168.200.1 ThinkPad-PC<\/p>\n<\/li>\n<li>\n<p>\u4e3b\u673a\u540d\u89e3\u6790\u8fc7\u7a0b\u5206\u6790(Hosts\u3001DNS)<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>Hosts\u662f\u4ec0\u4e48\uff1f<\/p>\n<p>\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\uff0c\u7528\u6765\u8bb0\u5f55\u8bb0\u5f55 IP \u548c Hostname(\u4e3b\u673a\u540d\u4e3b\u673a\u540d)\u7684\u6620\u5c04\u5173\u7cfb\u3002<\/p>\n<\/li>\n<li>\n<p>DNS\u662f\u4ec0\u4e48\uff1f<\/p>\n<\/li>\n<li>\n<p>DNS\uff0c\u5c31\u662f Domain Name System \u7684\u7f29\u5199\uff0c\u7ffb\u8bd1\u8fc7\u6765\u5c31\u662f\u57df\u540d\u7cfb\u7edf\uff1b\u662f\u4e92\u8054\u7f51\u4e0a\u4f5c\u4e3a\u57df\u540d\u548c IP \u5730\u5740\u76f8\u4e92\u6620\u5c04\u7684\u4e00\u4e2a\u5206\u5e03\u5f0f\u6570\u636e\u5206\u5e03\u5f0f\u6570\u636e\u5e93\u3002<\/p>\n<\/li>\n<li>\n<p>\u5e94\u7528\u5b9e\u4f8b: \u7528\u6237\u5728\u6d4f\u89c8\u5668\u8f93\u5165\u4e86www.baidu.com\uff0c\u5206\u6790\u5176\u57df\u540d\u89e3\u6790\u8fc7\u7a0b\u3002<\/p>\n<p>1)\u6d4f\u89c8\u5668\u5148\u68c0\u67e5\u6d4f\u89c8\u5668\u7f13\u5b58\u4e2d\u6709\u6ca1\u6709\u8be5\u57df\u540d\u89e3\u6790 IP \u5730\u5740\uff0c\u6709\u5c31\u5148\u8c03\u7528\u8fd9\u4e2a IP \u5b8c\u6210\u89e3\u6790\uff1b\u5982\u679c\u6ca1\u6709\uff0c\u5c31\u68c0\u67e5 DNS \u89e3\u6790\u5668\u7f13\u5b58\uff0c\u5982\u679c\u6709\u76f4\u63a5\u8fd4\u56de IP \u5b8c\u6210\u89e3\u6790\u3002\u8fd9\u4e24\u4e2a\u7f13\u5b58\uff0c\u53ef\u4ee5\u7406\u89e3\u4e3a\u672c\u5730\u89e3\u6790\u5668\u7f13\u5b58\u3002<\/p>\n<p>2)\u4e00\u822c\u6765\u8bf4\uff0c\u5f53\u7535\u8111\u7b2c\u4e00\u6b21\u6210\u529f\u8bbf\u95ee\u67d0\u4e00\u7f51\u7ad9\u540e\uff0c\u5728\u4e00\u5b9a\u65f6\u95f4\u5185\uff0c\u6d4f\u89c8\u5668\u6216\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u7f13\u5b58\u4ed6\u7684 IP \u5730\u5740\uff08DNS \u89e3\u6790\u8bb0\u5f55\uff09\u3002\u5982 \u5728 cmd \u7a97\u53e3\u4e2d\u8f93\u5165<\/p>\n<ul>\n<li>ipconfig \/displaydns \/\/DNS \u57df\u540d\u89e3\u6790\u7f13\u5b58<\/p>\n<\/li>\n<li>\n<p>ipconfig \/flushdns \/\/\u624b\u52a8\u6e05\u7406 dns \u7f13\u5b58<\/p>\n<p>3)\u5982\u679c\u672c\u5730\u89e3\u6790\u5668\u7f13\u5b58\u6ca1\u6709\u627e\u5230\u5bf9\u5e94\u6620\u5c04\uff0c\u68c0\u67e5\u7cfb\u7edf\u4e2dhosts\u6587\u4ef6\u4e2d\u6709\u6ca1\u6709\u914d\u7f6e\u5bf9\u5e94\u7684\u57df\u540d IP \u6620\u5c04\uff0c\u5982\u679c\u6709\uff0c\u5219\u5b8c\u6210\u89e3\u6790\u5e76\u8fd4\u56de\u3002<\/p>\n<p>4)\u5982\u679c\u672c\u5730DNS\u89e3\u6790\u5668\u7f13\u5b58\u548chosts\u6587\u4ef6\u4e2d\u5747\u6ca1\u6709\u627e\u5230\u5bf9\u5e94\u7684IP\uff0c\u5219\u5230\u57df\u540d\u670d\u52a1DNS\u8fdb\u884c\u89e3\u6790\u57df\u3002<\/p>\n<p>5)\u793a\u610f\u56fe<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210418220522246.png\" alt=\"image-20210418220522246\" \/><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u5341\u4e03\u3001\u8fdb\u7a0b\u7ba1\u7406(\u91cd\u70b9)<\/h3>\n<ol>\n<li>\u663e\u793a\u7cfb\u7edf\u6267\u884c\u7684\u8fdb\u7a0b<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u57fa\u672c\u4ecb\u7ecd\uff1a<\/p>\n<p>ps \u547d\u4ee4\u662f\u7528\u6765\u67e5\u770b\u76ee\u524d\u7cfb\u7edf\u4e2d\uff0c\u6709\u54ea\u4e9b\u6b63\u5728\u6267\u884c\uff0c\u4ee5\u53ca\u5b83\u4eec\u6267\u884c\u7684\u72b6\u51b5\u3002\u53ef\u4ee5\u4e0d\u52a0\u4efb\u4f55\u53c2\u6570\u3002<\/p>\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n<ul>\n<li>ps -a\uff1a\u663e\u793a\u5f53\u524d\u7ec8\u7aef\u7684\u6240\u6709\u8fdb\u7a0b\u4fe1\u606f<\/p>\n<\/li>\n<li>\n<p>ps -u\uff1a\u4ee5\u7528\u6237\u7684\u683c\u5f0f\u663e\u793a\u8fdb\u7a0b\u4fe1\u606f<\/p>\n<\/li>\n<li>\n<p>ps -x\uff1a\u663e\u793a\u540e\u53f0\u8fdb\u7a0b\u8fd0\u884c\u7684\u53c2\u6570<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# ps -aux | more\nUSER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nroot          1  2.1  0.3 128268  6888 ?        Ss   23:15   0:02 \/usr\/lib\/systemd\/systemd --switched-root --system --deserialize 22\nroot          2  0.0  0.0      0     0 ?        S    23:15   0:00 [kthreadd]\nroot          3  0.0  0.0      0     0 ?        S    23:15   0:00 [ksoftirqd\/0]\nroot          4  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker\/0:0]\nroot          5  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [kworker\/0:0H]\nroot          6  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker\/u256:0]\nroot          7  0.0  0.0      0     0 ?        S    23:15   0:00 [migration\/0]\nroot          8  0.0  0.0      0     0 ?        S    23:15   0:00 [rcu_bh]\nroot          9  0.3  0.0      0     0 ?        S    23:15   0:00 [rcu_sched]\nroot         10  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [lru-add-drain]\nroot         11  0.0  0.0      0     0 ?        S    23:15   0:00 [watchdog\/0]\nroot         12  0.0  0.0      0     0 ?        S    23:15   0:00 [watchdog\/1]\nroot         13  0.0  0.0      0     0 ?        S    23:15   0:00 [migration\/1]\nroot         14  0.0  0.0      0     0 ?        S    23:15   0:00 [ksoftirqd\/1]\nroot         15  0.1  0.0      0     0 ?        S    23:15   0:00 [kworker\/1:0]\nroot         16  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [kworker\/1:0H]\nroot         18  0.0  0.0      0     0 ?        S    23:15   0:00 [kdevtmpfs]\nroot         19  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [netns]\nroot         20  0.0  0.0      0     0 ?        S    23:15   0:00 [khungtaskd]\nroot         21  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [writeback]\nroot         22  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [kintegrityd]\nroot         23  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [bioset]\nroot         24  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [bioset]\nroot         25  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [bioset]\nroot         26  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [kblockd]\nroot         27  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [md]\nroot         28  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [edac-poller]\nroot         29  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [watchdogd]\nroot         30  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker\/0:1]\nroot         35  0.0  0.0      0     0 ?        S    23:15   0:00 [kswapd0]\nroot         36  0.0  0.0      0     0 ?        SN   23:15   0:00 [ksmd]\nroot         37  0.0  0.0      0     0 ?        SN   23:15   0:00 [khugepaged]\nroot         38  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [crypto]\nroot         46  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [kthrotld]\nroot         47  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker\/u256:1]\nroot         48  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [kmpath_rdacd]\nroot         49  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [kaluad]\nroot         50  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker\/1:1]\nroot         51  0.0  0.0      0     0 ?        S&lt;   23:15   0:00 [kpsmoused]\nroot         52  0.0  0.0      0     0 ?        S    23:15   0:00 [kworker\/0:2]\n\n<\/code><\/pre>\n<p>\u6307\u4ee4\u8bf4\u660e\uff1a<\/p>\n<\/li>\n<li>\n<p>System V \u5c55\u793a\u98ce\u683c<\/p>\n<\/li>\n<li>USER\uff1a\u7528\u6237\u540d\u79f0<\/li>\n<li>PID\uff1a\u8fdb\u7a0b\u53f7<\/li>\n<li>%CPU\uff1a\u8fdb\u7a0b\u5360\u7528 CPU \u7684\u767e\u5206\u6bd4<\/li>\n<li>%MEM\uff1a\u8fdb\u7a0b\u5360\u7528\u7269\u7406\u5185\u5b58\u7684\u767e\u5206\u6bd4<\/li>\n<li>VSZ\uff1a\u8fdb\u7a0b\u5360\u7528\u7684\u865a\u62df\u5185\u5b58\u5927\u5c0f\uff08\u5355\u4f4d\uff1aKB\uff09<\/li>\n<li>RSS\uff1a\u8fdb\u7a0b\u5360\u7528\u7684\u7269\u7406\u5185\u5b58\u5927\u5c0f\uff08\u5355\u4f4d\uff1aKB\uff09<\/li>\n<li>TT\uff1a\u7ec8\u7aef\u540d\u79f0\uff08\u7f29\u5199\uff09\u3002<\/li>\n<li>STAT\uff1a\u8fdb\u7a0b\u72b6\u6001\uff0c\u5176\u4e2d S-\u7761\u7720\uff0cs-\u8868\u793a\u8be5\u8fdb\u7a0b\u662f\u4f1a\u8bdd\u7684\u5148\u5bfc\u8fdb\u7a0b\uff0cN-\u8868\u793a\u8fdb\u7a0b\u62e5\u6709\u6bd4\u666e\u901a\u4f18\u5148\u7ea7\u66f4\u4f4e\u7684\u4f18\u5148\u7ea7\uff0cR-\u6b63\u5728\u8fd0\u884c\uff0cD-\u77ed\u671f\u7b49\u5f85\uff0cZ-\u50f5\u6b7b\u8fdb\u7a0b\uff0cT-\u88ab\u8ddf\u8e2a\u6216\u8005\u88ab\u505c\u6b62\u7b49\u7b49\u3002<\/li>\n<li>STARTED\uff1a\u8fdb\u7a0b\u7684\u542f\u52a8\u65f6\u95f4<\/li>\n<li>TIME\uff1aCPU \u65f6\u95f4\uff0c\u5373\u8fdb\u7a0b\u4f7f\u7528 CPU \u7684\u603b\u65f6\u95f4<\/li>\n<li>COMMAND\uff1a\u542f\u52a8\u8fdb\u7a0b\u6240\u7528\u7684\u547d\u4ee4\u548c\u53c2\u6570\uff0c\u5982\u679c\u8fc7\u957f\u4f1a\u88ab\u622a\u65ad\u663e\u793a<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>ps\u8be6\u89e3\uff1a<\/p>\n<p>1)\u6307\u4ee4\uff1aps -aux|grep xxx \uff0c\u6bd4\u5982\u6211\u770b\u770b\u6709\u6ca1\u6709sshd\u670d\u52a1<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 ~]# ps -aux | grep sshd<br \/>\n root       7713  0.0  0.2 112756  4312 ?        Ss   18:23   0:00 \/usr\/sbin\/sshd -D<br \/>\n root      17427  0.0  0.2 158712  5556 ?        Ss   18:26   0:00 sshd: root@pts\/0<br \/>\n root      20225  0.0  0.0 112728   988 pts\/0    S+   23:05   0:00 grep &#8211;color=auto sshd<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5e94\u7528\u5b9e\u4f8b<\/p>\n<p>\u8981\u6c42\uff1a\u4ee5\u5168\u683c\u5f0f\u663e\u793a\u5f53\u524d\u6240\u6709\u7684\u8fdb\u7a0b\uff0c\u67e5\u770b\u8fdb\u7a0b\u7684\u7236\u8fdb\u7a0b\u3002 \u67e5\u770b sshd \u7684\u7236\u8fdb\u7a0b\u4fe1\u606f\u3002<\/p>\n<p>ps -ef \u662f\u4ee5\u5168\u683c\u5f0f\u663e\u793a\u5f53\u524d\u6240\u6709\u7684\u8fdb\u7a0b<\/p>\n<p>-e \u663e\u793a\u6240\u6709\u8fdb\u7a0b\u3002-f \u5168\u683c\u5f0f<\/p>\n<p>ps -ef|grep sshd<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 ~]# ps -ef<br \/>\n UID         PID   PPID  C STIME TTY          TIME CMD<br \/>\n root          1      0  0 23:15 ?        00:00:02 \/usr\/lib\/systemd\/systemd &#8211;switched-root &#8211;system &#8211;deserialize 22<br \/>\n root          2      0  0 23:15 ?        00:00:00 [kthreadd]<br \/>\n root          3      2  0 23:15 ?        00:00:00 [ksoftirqd\/0]<br \/>\n root          5      2  0 23:15 ?        00:00:00 [kworker\/0:0H]<br \/>\n root          7      2  0 23:15 ?        00:00:02 [migration\/0]<br \/>\n root          8      2  0 23:15 ?        00:00:00 [rcu_bh]<br \/>\n root          9      2  0 23:15 ?        00:00:00 [rcu_sched]<br \/>\n root         10      2  0 23:15 ?        00:00:00 [lru-add-drain]<br \/>\n root         11      2  0 23:15 ?        00:00:00 [watchdog\/0]<br \/>\n root         12      2  0 23:15 ?        00:00:00 [watchdog\/1]<br \/>\n root         13      2  0 23:15 ?        00:00:00 [migration\/1]<br \/>\n root         14      2  0 23:15 ?        00:00:00 [ksoftirqd\/1]<br \/>\n root         15      2  0 23:15 ?        00:00:01 [kworker\/1:0]<br \/>\n root         16      2  0 23:15 ?        00:00:00 [kworker\/1:0H]<\/p>\n<p>&#8220;`<\/p>\n<p>UID\uff1a\u7528\u6237 ID<\/p>\n<p>PID\uff1a\u8fdb\u7a0b ID<\/p>\n<p>PPID\uff1a\u7236\u8fdb\u7a0b ID<\/p>\n<p>C\uff1aCPU \u7528\u4e8e\u8ba1\u7b97\u6267\u884c\u4f18\u5148\u7ea7\u7684\u56e0\u5b50\u3002\u6570\u503c\u8d8a\u5927\uff0c\u8868\u660e\u8fdb\u7a0b\u662f CPU \u5bc6\u96c6\u578b\u8fd0\u7b97\uff0c\u6267\u884c\u4f18\u5148\u7ea7\u4f1a\u964d\u4f4e\uff1b\u6570\u503c\u8d8a\u5c0f\uff0c\u8868\u660e\u8fdb\u7a0b\u662f I\/O \u5bc6\u96c6\u578b\u8fd0\u7b97\uff0c\u6267\u884c\u4f18\u5148\u7ea7\u4f1a\u63d0\u9ad8\u3002<br \/>\n STIME\uff1a\u8fdb\u7a0b\u542f\u52a8\u7684\u65f6\u95f4<\/p>\n<p>TTY\uff1a\u5b8c\u6574\u7684\u7ec8\u7aef\u540d\u79f0<\/p>\n<p>TIME\uff1aCPU \u65f6\u95f4<\/p>\n<p>CMD\uff1a\u542f\u52a8\u8fdb\u7a0b\u6240\u7528\u7684\u547d\u4ee4\u548c\u53c2\u6570<\/p>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\n<p>\u7ec8\u6b62\u8fdb\u7a0b kill \u548c killall<\/p>\n<p>\u4ecb\u7ecd\uff1a\u82e5\u662f\u67d0\u4e2a\u8fdb\u7a0b\u6267\u884c\u4e00\u534a\u9700\u8981\u505c\u6b62\u65f6\uff0c\u6216\u662f\u5df2\u6d88\u4e86\u5f88\u5927\u7684\u7cfb\u7edf\u8d44\u6e90\u65f6\uff0c\u6b64\u65f6\u53ef\u4ee5\u8003\u8651\u505c\u6b62\u8be5\u8fdb\u7a0b\u3002\u4f7f\u7528 kill \u547d\u4ee4\u6765\u5b8c\u6210\u6b64\u9879\u4efb\u52a1\u3002<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>kill [\u9009\u9879] \u8fdb\u7a0b\u53f7\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u901a\u8fc7\u8fdb\u7a0b\u53f7\u6740\u6b7b\/\u7ec8\u6b62\u8fdb\u7a0b\uff09\u3002<\/p>\n<p>killall \u8fdb\u7a0b\u540d\u79f0 \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u901a\u8fc7\u8fdb\u7a0b\u540d\u79f0\u6740\u6b7b\u8fdb\u7a0b\uff0c\u4e5f\u652f\u6301\u901a\u914d\u7b26\uff0c\u8fd9\u5728\u7cfb\u7edf\u56e0\u8d1f\u8f7d\u8fc7\u5927\u800c\u53d8\u5f97\u5f88\u6162\u65f6\u5f88\u6709\u7528\uff09\u3002<\/p>\n<p>\u5e38\u7528\u9009\u9879\uff1a<\/p>\n<p>-9 :\u8868\u793a\u5f3a\u8feb\u8fdb\u7a0b\u7acb\u5373\u505c\u6b62<\/p>\n<p>\u6700\u4f73\u5b9e\u8df5\uff1a<\/p>\n<p>1)\u6848\u4f8b 1\uff1a\u8e22\u6389\u67d0\u4e2a\u975e\u6cd5\u767b\u5f55\u7528\u6237<\/p>\n<p>kill \u8fdb\u7a0b\u53f7 , \u6bd4\u5982 kill 11421<\/p>\n<p>2)\u6848\u4f8b 2\uff1a \u7ec8\u6b62\u8fdc\u7a0b\u767b\u5f55\u670d\u52a1sshd\uff0c\u5728\u9002\u5f53\u65f6\u5019\u518d\u6b21\u91cd\u542f sshd \u670d\u52a1<\/p>\n<p>kill sshd\u5bf9\u5e94\u7684\u8fdb\u7a0b\u53f7\uff1b\/bin\/systemctl start sshd.service<\/p>\n<p>3)\u6848\u4f8b 3\uff1a\u7ec8\u6b62\u591a\u4e2agedit<\/p>\n<p>killall gedit<\/p>\n<p>4)\u6848\u4f8b 4\uff1a\u5f3a\u5236\u6740\u6389\u4e00\u4e2a\u7ec8\u7aef<\/p>\n<p>kill &#8211; 9 bash\u5bf9\u5e94\u7684\u8fdb\u7a0b\u53f7<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\uff08\u6ce8\u610f\uff1abash\u662f\u672c\u673a\u7684\u547d\u4ee4\u884c\uff0c\u9700\u5728\u672c\u673a\u8fd0\u884ckill\u547d\u4ee4\uff09<\/span><\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u8fdb\u7a0b\u6811pstree<\/p>\n<p>pstree [\u9009\u9879] ,\u53ef\u4ee5\u66f4\u52a0\u76f4\u89c2\u7684\u6765\u770b\u8fdb\u7a0b\u4fe1\u606f\u3002<\/p>\n<p>\u5e38\u7528\u9009\u9879\uff1a<\/p>\n<p>-p :\u663e\u793a\u8fdb\u7a0b\u7684 PID<\/p>\n<p>-u :\u663e\u793a\u8fdb\u7a0b\u7684\u6240\u5c5e\u7528\u6237<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a<\/p>\n<p>\u6848\u4f8b 1\uff1a\u8bf7\u4f60\u6811\u72b6\u7684\u5f62\u5f0f\u663e\u793a\u8fdb\u7a0b\u7684 pid<\/p>\n<p>pstree -p<\/p>\n<p>\u6848\u4f8b 2\uff1a\u8bf7\u4f60\u6811\u72b6\u7684\u5f62\u5f0f\u8fdb\u7a0b\u7684\u7528\u6237<\/p>\n<p>pstree -u<\/p>\n<\/li>\n<\/ol>\n<h3>\u5341\u516b\u3001\u670d\u52a1(service)\u7ba1\u7406<\/h3>\n<ol>\n<li>\n<p>\u4ecb\u7ecd\uff1a\u670d\u52a1(service) \u672c\u8d28\u5c31\u662f\u8fdb\u7a0b\uff0c\u4f46\u662f\u662f\u8fd0\u884c\u5728\u540e\u53f0\u7684\uff0c\u901a\u5e38\u90fd\u4f1a\u76d1\u542c\u67d0\u4e2a\u7aef\u53e3\uff0c\u7b49\u5f85\u5176\u5b83\u7a0b\u5e8f\u7684\u8bf7\u6c42\uff0c\u6bd4\u5982(mysqld , sshd\u9632\u706b\u5899\u7b49)\uff0c\u56e0\u6b64\u6211\u4eec\u53c8\u79f0\u4e3a\u5b88\u62a4\u8fdb\u7a0b\uff0c\u662f Linux \u4e2d\u975e\u5e38\u91cd\u8981\u7684\u77e5\u8bc6\u70b9\u3002<\/p>\n<\/li>\n<li>\n<p>service \u7ba1\u7406\u6307\u4ee4\uff1a<\/p>\n<p>1)service \u670d\u52a1\u540d [start | stop | restart | reload | status]<\/p>\n<p>2)\u5728CentOS7.0\u540e\u5f88\u591a\u670d\u52a1\u4e0d\u518d\u4f7f\u7528service ,\u800c\u662f systemctl\uff08\u540e\u9762\u4e13\u95e8\u8bb2\uff09<\/p>\n<p>3)service\u6307\u4ee4\u7ba1\u7406\u7684\u670d\u52a1\u5728\/etc\/init.d\u67e5\u770b\uff08<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u5176\u4ed6\u7684\u670d\u52a1\u90fd\u8981\u7528systemctl\u6307\u4ee4\u6765\u7ba1\u7406\u4e86<\/span>\uff09<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# ls -l \/etc\/init.d\/\n\u603b\u7528\u91cf 88\n-rw-r--r--. 1 root root 18281 8\u6708  24 2018 functions\n-rwxr-xr-x. 1 root root  4569 8\u6708  24 2018 netconsole\n-rwxr-xr-x. 1 root root  7923 8\u6708  24 2018 network\n-rw-r--r--. 1 root root  1160 10\u6708 31 2018 README\n-rwxr-xr-x. 1 root root 45702 4\u6708   3 22:07 vmware-tools\n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<\/li>\n<li>service\u7ba1\u7406\u6307\u4ee4\u6848\u4f8b\uff1a\n<p>\u8bf7\u4f7f\u7528 service \u6307\u4ee4\uff0c\u67e5\u770b\uff0c\u5173\u95ed\uff0c\u542f\u52a8 network [\u6ce8\u610f\uff1a\u5728\u865a\u62df\u7cfb\u7edf\u6f14\u793a\uff0c\u56e0\u4e3a\u7f51\u7edc\u8fde\u63a5\u4f1a\u5173\u95ed]<\/p>\n<p>service network status<\/p>\n<p>service network stop<\/p>\n<p>service network start<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u670d\u52a1\u540d\uff1a<\/p>\n<p>\u4f7f\u7528 setup -> \u7cfb\u7edf\u670d\u52a1 \u5c31\u53ef\u4ee5\u770b\u5230\u5168\u90e8\u3002<\/p>\n<p>\u6267\u884c\u6307\u4ee4\uff1asetup<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210421215514478.png\" alt=\"image-20210421215514478\" \/><\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\uff1a\u56fe\u4e2d\u5e26\u6709\u201c*\u201d\u7684\uff0c\u4f1a\u5728centos\u542f\u52a8\u65f6\u4e00\u5e76\u542f\u52a8\u3002<\/span><\/p>\n<\/li>\n<li>\n<p>\u670d\u52a1\u7684\u8fd0\u884c\u7ea7\u522b(runlevel)\uff1a<\/p>\n<p>Linux \u7cfb\u7edf\u6709 7 \u79cd\u8fd0\u884c\u7ea7\u522b(runlevel)\uff1a\u5e38\u7528\u7684\u662f\u7ea7\u522b\u7ea7\u522b 3 \u548c 5\u3002<\/p>\n<p>\u8fd0\u884c\u7ea7\u522b 0\uff1a\u7cfb\u7edf\u505c\u673a\u72b6\u6001\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u8fd0\u884c\u7ea7\u522b\u4e0d\u80fd\u8bbe\u4e3a 0\uff0c\u5426\u5219\u4e0d\u80fd\u6b63\u5e38\u542f\u52a8\u3002<\/p>\n<p>\u8fd0\u884c\u7ea7\u522b 1\uff1a\u5355\u7528\u6237\u5de5\u4f5c\u72b6\u6001\uff0croot \u6743\u9650\uff0c\u7528\u4e8e\u7cfb\u7edf\u7ef4\u62a4\uff0c\u7981\u6b62\u8fdc\u7a0b\u767b\u9646\u3002<\/p>\n<p>\u8fd0\u884c\u7ea7\u522b 2\uff1a\u591a\u7528\u6237\u72b6\u6001(\u6ca1\u6709 NFS)\uff0c\u4e0d\u652f\u6301\u7f51\u7edc\u3002<\/p>\n<p>\u8fd0\u884c\u7ea7\u522b 3\uff1a\u5b8c\u5168\u7684\u591a\u7528\u6237\u72b6\u6001(\u6709 NFS)\uff0c\u65e0\u754c\u9762\uff0c\u767b\u9646\u540e\u8fdb\u5165\u63a7\u5236\u53f0\u547d\u4ee4\u884c\u6a21\u5f0f\u3002<\/p>\n<p>\u8fd0\u884c\u7ea7\u522b 4\uff1a\u7cfb\u7edf\u672a\u4f7f\u7528\uff0c\u4fdd\u7559\u3002<\/p>\n<p>\u8fd0\u884c\u7ea7\u522b 5\uff1aX11 \u63a7\u5236\u53f0\uff0c\u767b\u9646\u540e\u8fdb\u5165\u56fe\u5f62 GUI \u6a21\u5f0f\u3002<\/p>\n<p>\u8fd0\u884c\u7ea7\u522b 6\uff1a\u7cfb\u7edf\u6b63\u5e38\u5173\u95ed\u5e76\u91cd\u542f\uff0c\u9ed8\u8ba4\u8fd0\u884c\u7ea7\u522b\u4e0d\u80fd\u8bbe\u4e3a 6\uff0c\u5426\u5219\u4e0d\u80fd\u6b63\u5e38\u542f\u52a8\u3002<\/p>\n<p>\u5f00\u673a\u7684\u6d41\u7a0b\u8bf4\u660e\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210421220303444.png\" alt=\"image-20210421220303444\" \/><\/p>\n<\/li>\n<li>\n<p>CentOS7\u8fd0\u884c\u7ea7\u522b\u8bf4\u660e\uff1a<\/p>\n<p>\u5728 \/etc\/initab<\/p>\n<p>\u8fdb\u884c\u4e86\u7b80\u5316 \uff0c\u5982\u4e0b:<\/p>\n<p>multi-user.target: analogous to runlevel 3<\/p>\n<p>graphical.target: analogous to runlevel 5<\/p>\n<p>init 0<\/p>\n<h1>To view current default target, run:<\/h1>\n<p>systemctl get-default<\/p>\n<h1>To set a default target, run:<\/h1>\n<p>systemctl set-default TARGET.target<\/p>\n<\/li>\n<li>\n<p>chkconfig \u6307\u4ee4<\/p>\n<p>\u4ecb\u7ecd\uff1a<\/p>\n<p>\u901a\u8fc7 chkconfig \u547d\u4ee4\u53ef\u4ee5\u7ed9\u670d\u52a1\u7684\u5404\u4e2a\u8fd0\u884c\u7ea7\u522b\u8bbe\u7f6e\u81ea\u542f\u52a8\/\u5173\u95ed<\/p>\n<p>chkconfig \u6307\u4ee4\u7ba1\u7406\u7684\u670d\u52a1\u5728 \/etc\/init.d \u67e5\u770b<\/p>\n<p>\u6ce8\u610f: Centos7.0 \u540e\uff0c\u5f88\u591a\u670d\u52a1\u4f7f\u7528 systemctl \u7ba1\u7406<\/p>\n<p>chkconfig \u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>1)\u67e5\u770b\u670d\u52a1 chkconfig&#8211;list [| grepxxx]<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# chkconfig --list\n\n\u6ce8\uff1a\u8be5\u8f93\u51fa\u7ed3\u679c\u53ea\u663e\u793a SysV \u670d\u52a1\uff0c\u5e76\u4e0d\u5305\u542b\n\u539f\u751f systemd \u670d\u52a1\u3002SysV \u914d\u7f6e\u6570\u636e\n\u53ef\u80fd\u88ab\u539f\u751f systemd \u914d\u7f6e\u8986\u76d6\u3002 \n\n     \u8981\u5217\u51fa systemd \u670d\u52a1\uff0c\u8bf7\u6267\u884c 'systemctl list-unit-files'\u3002\n     \u67e5\u770b\u5728\u5177\u4f53 target \u542f\u7528\u7684\u670d\u52a1\u8bf7\u6267\u884c\n     'systemctl list-dependencies [target]'\u3002\n\nnetconsole       0:\u5173 1:\u5173 2:\u5173 3:\u5173 4:\u5173 5:\u5173 6:\u5173\nnetwork          0:\u5173 1:\u5173 2:\u5f00 3:\u5f00 4:\u5f00 5:\u5f00 6:\u5173\nvmware-tools     0:\u5173 1:\u5173 2:\u5f00 3:\u5f00 4:\u5f00 5:\u5f00 6:\u5173\n[root@alanCentos01 ~]# \n\n\n<\/code><\/pre>\n<p>2)chkconfig \u670d\u52a1\u540d &#8211;list<\/p>\n<p>3)chkconfig &#8211;level 5 \u670d\u52a1\u540d on\/off<\/p>\n<p>\u6848\u4f8b\u6f14\u793a \uff1a\u5bf9 network \u670d\u52a1\u8fdb\u884c\u5404\u79cd\u64cd\u4f5c, \u628a network \u5728 3 \u8fd0\u884c\u7ea7\u522b,\u5173\u95ed\u81ea\u542f\u52a8<\/p>\n<p>chkconfig &#8211;level 3 network off<\/p>\n<p>chkconfig &#8211;level 3 network on<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\uff1achkconfig \u91cd\u65b0\u8bbe\u7f6e\u670d\u52a1\u540e\u81ea\u542f\u52a8\u6216\u5173\u95ed\uff0c\u9700\u8981\u91cd\u542f\u673a\u5668 reboot \u751f\u6548\u3002<\/span><\/p>\n<\/li>\n<li>\n<p>systemctl\u7ba1\u7406\u6307\u4ee4\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a systemctl [start | stop | restart | status] \u670d\u52a1\u540d<\/p>\n<p>systemctl\u6307\u4ee4\u7ba1\u7406\u7684\u670d\u52a1\u5728\/usr\/lib\/systemd\/system\u67e5\u770b<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 ~]# ls -l \/usr\/lib\/systemd\/system\/<br \/>\n \u603b\u7528\u91cf 1568<br \/>\n -rw-r&#8211;r&#8211;. 1 root root  275 11\u6708 14 2018 abrt-ccpp.service<br \/>\n -rw-r&#8211;r&#8211;. 1 root root  380 11\u6708 14 2018 abrtd.service<br \/>\n -rw-r&#8211;r&#8211;. 1 root root  361 11\u6708 14 2018 abrt-oops.service<br \/>\n -rw-r&#8211;r&#8211;. 1 root root  266 11\u6708 14 2018 abrt-pstoreoops.service<br \/>\n -rw-r&#8211;r&#8211;. 1 root root  262 11\u6708 14 2018 abrt-vmcore.service<br \/>\n -rw-r&#8211;r&#8211;. 1 root root  311 11\u6708 14 2018 abrt-xorg.service<br \/>\n -rw-r&#8211;r&#8211;. 1 root root  729 10\u6708 31 2018 accounts-daemon.service<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;systemctl\u8bbe\u7f6e\u670d\u52a1\u7684\u81ea\u542f\u52a8\u72b6\u6001\uff1a<\/p>\n<p>systemctl list-unit-files [ | grep \u670d\u52a1\u540d] (\u67e5\u770b\u670d\u52a1\u5f00\u673a\u542f\u52a8\u72b6\u6001, grep \u53ef\u4ee5\u8fdb\u884c\u8fc7\u6ee4)<\/p>\n<p>systemctl enable \u670d\u52a1\u540d (\u8bbe\u7f6e\u670d\u52a1\u5f00\u673a\u542f\u52a8)<\/p>\n<p>systemctl disable \u670d\u52a1\u540d (\u5173\u95ed\u670d\u52a1\u5f00\u673a\u542f\u52a8)<\/p>\n<p>systemctl is-enabled \u670d\u52a1\u540d (\u67e5\u8be2\u67d0\u4e2a\u670d\u52a1\u662f\u5426\u662f\u81ea\u542f\u52a8\u7684)&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5e94\u7528\u6848\u4f8b\uff1a<\/p>\n<p>\u67e5\u770b\u5f53\u524d\u9632\u706b\u5899\u7684\u72b6\u51b5\uff0c\u5173\u95ed\u9632\u706b\u5899\u548c\u91cd\u542f\u9632\u706b\u5899\u3002=&gt; firewalld.service<\/p>\n<p>systemctl status firewalld<\/p>\n<p>systemctl stop firewalld<\/p>\n<p>systemctl start firewalld&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;&lt;span class=&quot;text-highlighted-inline&quot; style=&quot;background-color: #fffd38;&quot;&gt;\u6ce8\u610f\uff1a&lt;\/span&gt;<\/p>\n<p>\u5173\u95ed\u6216\u8005\u542f\u7528\u9632\u706b\u5899\u540e\uff0c\u7acb\u5373\u751f\u6548\u3002[telnet \u6d4b\u8bd5\u67d0\u4e2a\u7aef\u53e3\u5373\u53ef]<\/p>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u53ea\u662f\u4e34\u65f6\u751f\u6548\uff0c\u5f53\u91cd\u542f\u7cfb\u7edf\u540e\uff0c\u8fd8\u662f\u56de\u5f52\u4ee5\u524d\u5bf9\u670d\u52a1\u7684\u8bbe\u7f6e\u3002<\/p>\n<p>\u5982\u679c\u5e0c\u671b\u8bbe\u7f6e\u67d0\u4e2a\u670d\u52a1\u81ea\u542f\u52a8\u6216\u5173\u95ed\u6c38\u4e45\u751f\u6548\uff0c\u8981\u4f7f\u7528 systemctl [enable|disable] \u670d\u52a1\u540d\u3002&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<\/p>\n<p>&lt;ol start=&quot;9&quot;&gt;<br \/>\n&lt;li&gt;\u6253\u5f00\u6216\u8005\u5173\u95ed\u6307\u5b9a\u7aef\u53e3\uff1a&lt;\/li&gt;<br \/>\n&lt;\/ol&gt;<\/p>\n<p>&lt;ul&gt;<br \/>\n&lt;li&gt;&lt;p&gt;firewall\u6307\u4ee4\uff1a<\/p>\n<p>1)\u6253\u5f00\u7aef\u53e3\uff1afirewall-cmd &#8211;permanent &#8211;add-port=\u7aef\u53e3\u53f7\/\u534f\u8bae<\/p>\n<p>2)\u5173\u95ed\u7aef\u53e3\uff1afirewall-cmd &#8211;permanent &#8211;remove-port=\u7aef\u53e3\u53f7\/\u534f\u8bae<\/p>\n<p>3)\u91cd\u65b0\u8f7d\u5165,\u624d\u80fd\u751f\u6548\uff1afirewall-cmd &#8211;reload<\/p>\n<p>4)\u67e5\u8be2\u7aef\u53e3\u662f\u5426\u5f00\u653e\uff1afirewall-cmd &#8211;query-port=\u7aef\u53e3\/\u534f\u8bae<\/p>\n<p>5)\u67e5\u8be2\u5df2\u7ecf\u5f00\u653e\u7684\u5168\u90e8\u7aef\u53e3\uff1afirewall-cmd &#8211;list-ports\u6216firewall-cmd &#8211;zone=public &#8211;list-ports&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5e94\u7528\u6848\u4f8b\uff1a<\/p>\n<p>1)\u542f\u7528\u9632\u706b\u5899\uff0c \u6d4b\u8bd5111\u7aef\u53e3\u662f\u5426\u80fd telnet(windows\u9700\u901a\u8fc7\u201c\u542f\u7528\u6216\u5173\u95edwindows\u529f\u80fd\u201d\u5b89\u88c5telnet\u5ba2\u6237\u7aef), \u4e0d\u884c<\/p>\n<p>&#8220;`powershell<br \/>\n PS C:\\Users\\Alan> telnet 192.168.18.128 111<br \/>\n \u6b63\u5728\u8fde\u63a5192.168.18.128&#8230;<\/p>\n<p>&#8220;`<\/p>\n<p>&lt;pre&gt;&lt;code class=&quot;line-numbers&quot;&gt;2)\u5f00\u653e111\u7aef\u53e3<\/p>\n<p>\u200b&#8220;`shell<br \/>\n [root@alanCentos01 ~]# firewall-cmd &#8211;permanent &#8211;add-port=111\/tcp<br \/>\nsuccess<br \/>\n [root@alanCentos01 ~]# firewall-cmd &#8211;reload<br \/>\n success<\/p>\n<p><\/code><\/p>\n<p>3)\u518d\u6b21\u5173\u95ed111\u7aef\u53e3<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 ~]# firewall-cmd &#8211;permanent &#8211;remove-port=111\/tcp<br \/>\n success<br \/>\n [root@alanCentos01 ~]# firewall-cmd &#8211;reload<br \/>\n success<br \/>\n [root@alanCentos01 ~]# firewall-cmd &#8211;query-port=111\/tcp<br \/>\n no<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<\/ul>\n<ol start=\"10\">\n<li>\n<p>\u52a8\u6001\u76d1\u63a7\u8fdb\u7a0b\uff1a<\/p>\n<ul>\n<li>\u4ecb\u7ecd\uff1a\n<p>top \u4e0e ps \u547d\u4ee4\u5f88\u76f8\u4f3c\u3002\u5b83\u4eec\u90fd\u7528\u6765\u663e\u793a\u6b63\u5728\u6267\u884c\u7684\u8fdb\u7a0b\u3002Top \u4e0e ps \u6700\u5927\u7684\u4e0d\u540c\u4e4b\u5904\uff0c\u5728\u4e8e top \u5728\u6267\u884c\u4e00\u6bb5\u65f6\u95f4\u53ef\u4ee5\u66f4\u65b0\u6b63\u5728\u8fd0\u884c\u7684\u7684\u8fdb\u7a0b\u3002<\/p>\n<\/li>\n<li>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>top [\u9009\u9879]<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210424173900438.png\" alt=\"image-20210424173900438\" \/><\/p>\n<\/li>\n<li>\n<p>\u9009\u9879\u8bf4\u660e\uff1a<\/p>\n<p>-d \u79d2\u6570\uff1a\u6307\u5b9atop\u547d\u4ee4\u6bcf\u9694\u51e0\u79d2\u66f4\u65b0\uff0c\u9ed8\u8ba4\u662f3\u79d2\u3002<\/p>\n<p>-i\uff1a\u4f7ftop\u4e0d\u663e\u793a\u4efb\u4f55\u95f2\u7f6e\u6216\u8005\u50f5\u6b7b\u8fdb\u7a0b\u3002<\/p>\n<p>-p\uff1a\u901a\u8fc7\u6307\u5b9a\u76d1\u63a7\u8fdb\u7a0bID\u6765\u4ec5\u4ec5\u76d1\u63a7\u67d0\u4e2a\u8fdb\u7a0b\u7684\u72b6\u6001<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\uff08\u6ce8\u610f\u5927\u5c0f\u5199\uff09<\/span>\u3002<\/p>\n<\/li>\n<li>\n<p>\u4ea4\u4e92\u64cd\u4f5c\u8bf4\u660e\uff1a<\/p>\n<p>P\uff1a\u4ee5CPU\u4f7f\u7528\u7387\u6392\u5e8f\uff0c\u9ed8\u8ba4\u5c31\u662f\u6b21\u9879<\/p>\n<p>M\uff1a\u4ee5\u5185\u5b58\u7684\u4f7f\u7528\u7387\u6392\u5e8f<\/p>\n<p>N\uff1a\u4ee5PID\u6392\u5e8f<\/p>\n<p>q\uff1a\u9000\u51fatop<\/p>\n<\/li>\n<li>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a<\/p>\n<p>\u6848\u4f8b 1.\u76d1\u89c6\u7279\u5b9a\u7528\u6237, \u6bd4\u5982\u6211\u4eec\u76d1\u63a7 tom \u7528\u6237<\/p>\n<p>top\uff1a\u8f93\u5165\u6b64\u547d\u4ee4\uff0c\u6309\u56de\u8f66\u952e\uff0c\u67e5\u770b\u6267\u884c\u7684\u8fdb\u7a0b\uff1b<\/p>\n<p>u\uff1a\u7136\u540e\u8f93\u5165\u201cu\u201d\u56de\u8f66\uff0c\u518d\u8f93\u5165\u7528\u6237\u540d\uff0c\u5373\u53ef\u3002<\/p>\n<p>\u6848\u4f8b 2\uff1a\u7ec8\u6b62\u6307\u5b9a\u7684\u8fdb\u7a0b, \u6bd4\u5982\u6211\u4eec\u8981\u7ed3\u675f tom \u767b\u5f55<\/p>\n<p>top\uff1a\u8f93\u5165\u6b64\u547d\u4ee4\uff0c\u6309\u56de\u8f66\u952e\uff0c\u67e5\u770b\u6267\u884c\u7684\u8fdb\u7a0b\uff1b<\/p>\n<p>k\uff1a\u7136\u540e\u8f93\u5165\u201ck\u201d\u56de\u8f66\uff0c\u518d\u8f93\u5165\u8981\u7ed3\u675f\u7684\u8fdb\u7a0b ID \u53f7\uff0c\u7136\u540e\u8f93\u5165\u4fe1\u53f7\u91cf\uff1a9<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\uff08\u5f3a\u5236\u6740\u8fdb\u7a0b\uff09<\/span><\/p>\n<p>\u6848\u4f8b 3:\u6307\u5b9a\u7cfb\u7edf\u72b6\u6001\u66f4\u65b0\u7684\u65f6\u95f4(\u6bcf\u9694 10 \u79d2\u81ea\u52a8\u66f4\u65b0), \u9ed8\u8ba4\u662f 3 \u79d2<\/p>\n<p>top -d 10<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u76d1\u63a7\u7f51\u7edc\u72b6\u6001<\/p>\n<ul>\n<li>\u67e5\u770b\u7cfb\u7edf\u7f51\u7edc\u60c5\u51b5\u6307\u4ee4\uff1anetstat<\/p>\n<\/li>\n<li>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>netstat [\u9009\u9879]<\/p>\n<\/li>\n<li>\n<p>\u9009\u9879\u8bf4\u660e\uff1a<\/p>\n<p>-an\uff1a\u6309\u4e00\u5b9a\u987a\u5e8f\u6392\u5217\u8f93\u51fa<\/p>\n<p>-p\uff1a\u663e\u793a\u54ea\u4e2a\u8fdb\u7a0b\u5728\u8c03\u7528<\/p>\n<\/li>\n<li>\n<p>\u5e94\u7528\u6848\u4f8b\uff1a<\/p>\n<p>\u8bf7\u67e5\u770b\u670d\u52a1\u540d\u4e3a sshd \u7684\u670d\u52a1\u7684\u4fe1\u606f\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# netstat -anp | grep sshd\ntcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      7742\/sshd           \ntcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      17485\/sshd: root@pt \ntcp        0      0 192.168.18.128:22       192.168.18.1:4007       ESTABLISHED 17485\/sshd: root@pt \ntcp6       0      0 :::22                   :::*                    LISTEN      7742\/sshd           \ntcp6       0      0 ::1:6010                :::*                    LISTEN      17485\/sshd: root@pt \nunix  3      [ ]         STREAM     CONNECTED     42978    7742\/sshd            \nunix  2      [ ]         DGRAM                    60100    17485\/sshd: root@pt  \n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u5341\u4e5d\u3001RPM\u4e0eYUM<\/h3>\n<ol>\n<li>rpm \u5305\u7684\u7b80\u5355\u67e5\u8be2\u6307\u4ee4\n<p>\u67e5\u8be2\u5df2\u5b89\u88c5\u7684 rpm \u5217\u8868rpm \u2013qa|grep xx<\/p>\n<p>\u4e3e\u4f8b\uff1a\u770b\u770b\u5f53\u524d\u7cfb\u7edf\uff0c\u662f\u5426\u5b89\u88c5\u4e86 firefox<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# rpm -qa|grep firefox\nfirefox-60.2.2-1.el7.centos.x86_64\n[root@alanCentos01 ~]#\n\n<\/code><\/pre>\n<\/li>\n<li>rpm \u5305\u540d\u57fa\u672c\u683c\u5f0f\n<p>\u4e00\u4e2a rpm \u5305\u540d\uff1afirefox-60.2.2-1.el7.centos.x86_64<\/p>\n<p>\u540d\u79f0\uff1afirefox<\/p>\n<p>\u7248\u672c\u53f7\uff1a60.2.2-1<\/p>\n<p>\u9002\u7528\u64cd\u4f5c\u7cfb\u7edf\uff1ael7.centos.x86_64<\/p>\n<p>\u8868\u793a centos7.x \u7684 64 \u4f4d\u7cfb\u7edf<\/p>\n<p>\u5982\u679c\u662f i686\u3001i386 \u8868\u793a 32 \u4f4d\u7cfb\u7edf\uff0cnoarch \u8868\u793a\u901a\u7528<\/p>\n<\/li>\n<li>\n<p>rpm \u5305\u7684\u5176\u5b83\u67e5\u8be2\u6307\u4ee4\uff1a<\/p>\n<p>rpm -qa\uff1a\u67e5\u8be2\u6240\u5b89\u88c5\u7684\u6240\u6709 rpm \u8f6f\u4ef6\u5305<\/p>\n<p>rpm -qa | more<\/p>\n<p>rpm -qa | grep X [rpm -qa | grep firefox ]<\/p>\n<p>rpm -q \u8f6f\u4ef6\u5305\u540d :\u67e5\u8be2\u8f6f\u4ef6\u5305\u662f\u5426\u5b89\u88c5<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# rpm -q firefox\nfirefox-60.2.2-1.el7.centos.x86_64\n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<p>rpm -qi \u8f6f\u4ef6\u5305\u540d \uff1a\u67e5\u8be2\u8f6f\u4ef6\u5305\u4fe1\u606f<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# rpm -qi firefox\nName        : firefox\nVersion     : 60.2.2\nRelease     : 1.el7.centos\nArchitecture: x86_64\nInstall Date: 2021\u5e7404\u670802\u65e5 \u661f\u671f\u4e94 00\u65f628\u520621\u79d2\nGroup       : Unspecified\nSize        : 216144933\nLicense     : MPLv1.1 or GPLv2+ or LGPLv2+\nSignature   : RSA\/SHA256, 2018\u5e7410\u670809\u65e5 \u661f\u671f\u4e8c 20\u65f651\u520659\u79d2, Key ID 24c6a8a7f4a80eb5\nSource RPM  : firefox-60.2.2-1.el7.centos.src.rpm\nBuild Date  : 2018\u5e7410\u670809\u65e5 \u661f\u671f\u4e8c 08\u65f633\u520646\u79d2\nBuild Host  : x86-01.bsys.centos.org\nRelocations : (not relocatable)\nPackager    : CentOS BuildSystem &lt;http:\/\/bugs.centos.org&gt;\nVendor      : CentOS\nURL         : https:\/\/www.mozilla.org\/firefox\/\nSummary     : Mozilla Firefox Web browser\nDescription :\nMozilla Firefox is an open-source web browser, designed for standards\ncompliance, performance and portability.\n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<p>rpm -ql \u8f6f\u4ef6\u5305\u540d\uff1a\u67e5\u8be2\u8f6f\u4ef6\u5305\u4e2d\u7684\u6587\u4ef6<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# rpm -ql firefox\n\/etc\/firefox\n\/etc\/firefox\/pref\n\/usr\/bin\/firefox\n\/usr\/lib64\/firefox\n\/usr\/lib64\/firefox\/LICENSE\n\/usr\/lib64\/firefox\/application.ini\n\/usr\/lib64\/firefox\/browser\/blocklist.xml\n\/usr\/lib64\/firefox\/browser\/chrome\n\/usr\/lib64\/firefox\/browser\/chrome.manifest\n\/usr\/lib64\/firefox\/browser\/chrome\/icons\n\/usr\/lib64\/firefox\/browser\/chrome\/icons\/default\n\/usr\/lib64\/firefox\/browser\/chrome\/icons\/default\/default128.png\n\/usr\/lib64\/firefox\/browser\/chrome\/icons\/default\/default16.png\n\/usr\/lib64\/firefox\/browser\/chrome\/icons\/default\/default32.png\n\/usr\/lib64\/firefox\/browser\/chrome\/icons\/default\/default48.png\n\/usr\/lib64\/firefox\/browser\/chrome\/icons\/default\/default64.png\n\/usr\/lib64\/firefox\/browser\/defaults\/preferences\n\/usr\/lib64\/firefox\/browser\/extensions\n\/usr\/lib64\/firefox\/browser\/extensions\/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi\n\/usr\/lib64\/firefox\/browser\/features\/activity-stream@mozilla.org.xpi\n\/usr\/lib64\/firefox\/browser\/features\/aushelper@mozilla.org.xpi\n\/usr\/lib64\/firefox\/browser\/features\/firefox@getpocket.com.xpi\n\/usr\/lib64\/firefox\/browser\/features\/followonsearch@mozilla.com.xpi\n\/usr\/lib64\/firefox\/browser\/features\/formautofill@mozilla.org.xpi\n\/usr\/lib64\/firefox\/browser\/features\/jaws-esr@mozilla.org.xpi\n\/usr\/lib64\/firefox\/browser\/features\/onboarding@mozilla.org.xpi\n\/usr\/lib64\/firefox\/browser\/features\/screenshots@mozilla.org.xpi\n\/usr\/lib64\/firefox\/browser\/features\/webcompat@mozilla.org.xpi\n\/usr\/lib64\/firefox\/browser\/omni.ja\n\/usr\/lib64\/firefox\/chrome.manifest\n\/usr\/lib64\/firefox\/defaults\/pref\/channel-prefs.js\n\/usr\/lib64\/firefox\/defaults\/preferences\/all-redhat.js\n\/usr\/lib64\/firefox\/dependentlibs.list\n\/usr\/lib64\/firefox\/dictionaries\n\/usr\/lib64\/firefox\/distribution\/distribution.ini\n\/usr\/lib64\/firefox\/distribution\/extensions\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ach@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-af@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-an@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ar@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-as@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ast@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-az@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-be@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-bg@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-bn-BD@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-bn-IN@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-bn@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-br@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-bs@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ca@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-cak@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-cs@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-cy@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-da@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-de@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-dsb@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-el@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-en-GB@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-en-ZA@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-eo@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-es-AR@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-es-CL@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-es-ES@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-es-MX@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-es@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-et@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-eu@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-fa@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ff@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-fi@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-fr@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-fy-NL@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-fy@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ga-IE@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ga@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-gd@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-gl@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-gn@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-gu-IN@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-gu@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-he@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-hi-IN@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-hi@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-hr@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-hsb@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-hu@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-hy-AM@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-hy@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ia@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-id@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-is@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-it@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ja@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ka@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-kab@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-kk@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-km@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-kn@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ko@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-lij@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-lt@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-lv@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-mai@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-mk@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ml@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-mr@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ms@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-my@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-nb-NO@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-nb@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ne-NP@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-nl@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-nn-NO@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-nn@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-oc@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-or@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-pa-IN@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-pa@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-pl@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-pt-BR@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-pt-PT@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-pt@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-rm@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ro@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ru@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-si@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-sk@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-sl@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-son@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-sq@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-sr@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-sv-SE@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-sv@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ta@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-te@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-th@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-tr@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-uk@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-ur@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-uz@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-vi@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-xh@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-zh-CN@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-zh-TW@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/distribution\/extensions\/langpack-zh@firefox.mozilla.org.xpi\n\/usr\/lib64\/firefox\/firefox\n\/usr\/lib64\/firefox\/firefox-bin\n\/usr\/lib64\/firefox\/fonts\/EmojiOneMozilla.ttf\n\/usr\/lib64\/firefox\/gmp-clearkey\n\/usr\/lib64\/firefox\/gmp-clearkey\/0.1\n\/usr\/lib64\/firefox\/gmp-clearkey\/0.1\/libclearkey.so\n\/usr\/lib64\/firefox\/gmp-clearkey\/0.1\/manifest.json\n\/usr\/lib64\/firefox\/gtk2\/libmozgtk.so\n\/usr\/lib64\/firefox\/liblgpllibs.so\n\/usr\/lib64\/firefox\/libmozavcodec.so\n\/usr\/lib64\/firefox\/libmozavutil.so\n\/usr\/lib64\/firefox\/libmozgtk.so\n\/usr\/lib64\/firefox\/libmozsandbox.so\n\/usr\/lib64\/firefox\/libmozsqlite3.so\n\/usr\/lib64\/firefox\/libxul.so\n\/usr\/lib64\/firefox\/omni.ja\n\/usr\/lib64\/firefox\/pingsender\n\/usr\/lib64\/firefox\/platform.ini\n\/usr\/lib64\/firefox\/plugin-container\n\/usr\/lib64\/firefox\/run-mozilla.sh\n\/usr\/lib64\/mozilla\/extensions\/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}\n\/usr\/share\/appdata\/firefox.appdata.xml\n\/usr\/share\/applications\/firefox.desktop\n\/usr\/share\/icons\/hicolor\/16x16\/apps\/firefox.png\n\/usr\/share\/icons\/hicolor\/22x22\/apps\/firefox.png\n\/usr\/share\/icons\/hicolor\/24x24\/apps\/firefox.png\n\/usr\/share\/icons\/hicolor\/256x256\/apps\/firefox.png\n\/usr\/share\/icons\/hicolor\/32x32\/apps\/firefox.png\n\/usr\/share\/icons\/hicolor\/48x48\/apps\/firefox.png\n\/usr\/share\/icons\/hicolor\/symbolic\/apps\/firefox-symbolic.svg\n\/usr\/share\/man\/man1\/firefox.1.gz\n\/usr\/share\/mozilla\/extensions\/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}\n[root@alanCentos01 ~]#\n\n<\/code><\/pre>\n<p>rpm -qf \u6587\u4ef6\u5168\u8def\u5f84\u540d \u67e5\u8be2\u6587\u4ef6\u6240\u5c5e\u7684\u8f6f\u4ef6\u5305<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 ~]# rpm -qf \/etc\/passwd\nsetup-2.8.71-10.el7.noarch\n\n<\/code><\/pre>\n<\/li>\n<li>\u5378\u8f7d rpm \u5305\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>rpm -e RPM \u5305\u7684\u540d\u79f0<\/p>\n<p>\u5e94\u7528\u6848\u4f8b\uff1a<\/p>\n<p>\u5220\u9664firefox\u8f6f\u4ef6\u5305<\/p>\n<p>rpm -e firefox<\/p>\n<\/li>\n<li>\n<p>\u7ec6\u8282\u8ba8\u8bba<\/p>\n<p>1)\u5982\u679c\u5176\u5b83\u8f6f\u4ef6\u5305\u4f9d\u8d56\u4e8e\u60a8\u8981\u5378\u8f7d\u7684\u8f6f\u4ef6\u5305\uff0c\u5378\u8f7d\u65f6\u5219\u4f1a\u4ea7\u751f\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n<p>\u5982\uff1arpm -e foo<\/p>\n<p>removing these packages would break dependencies:foo is needed by bar-1.0-1<\/p>\n<p>2)\u5982\u679c\u6211\u4eec\u5c31\u662f\u8981\u5220\u9664 foo \u8fd9\u4e2a rpm \u5305\uff0c\u53ef\u4ee5\u589e\u52a0\u53c2\u6570 &#8211;nodeps ,\u5c31\u53ef\u4ee5\u5f3a\u5236\u5220\u9664\uff0c\u4f46\u662f\u4e00\u822c\u4e0d\u63a8\u8350\u8fd9\u6837\u505a\uff0c\u56e0\u4e3a\u4f9d\u8d56\u4e8e\u8be5\u8f6f\u4ef6\u5305\u7684\u7a0b\u5e8f\u53ef\u80fd\u65e0\u6cd5\u8fd0\u884c\uff1b<\/p>\n<p>\u5982\uff1arpm -e &#8211;nodeps foo<\/p>\n<\/li>\n<li>\n<p>\u5b89\u88c5rpm\u5305<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<p>rpm -ivh RPM\u5305\u5168\u8def\u5f84\u540d\u79f0<\/p>\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n<p>i=install \u5b89\u88c5<\/p>\n<p>v=verbose \u63d0\u793a<\/p>\n<p>h=hash \u8fdb\u5ea6\u6761<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a<\/p>\n<p>\u6f14\u793a\u5378\u8f7d\u548c\u5b89\u88c5firefox\u6d4f\u89c8\u5668<\/p>\n<p>rpm -e firefox<\/p>\n<p>rpm -ivh \/opt\/firefox-60.2.2-1.el7.centos.x86_64.rpm<\/p>\n<\/li>\n<li>\n<p>yum\u4ecb\u7ecd\uff1a<br \/>\nyum\u662f\u4e00\u4e2a Shell \u524d\u7aef\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u3002\u57fa\u4e8e RPM \u5305\u7ba1\u7406\uff0c\u80fd\u591f\u4ece\u6307\u5b9a\u7684\u670d\u52a1\u5668\u81ea\u52a8\u4e0b\u8f7d RPM \u5305\u5e76\u4e14\u5b89\u88c5\uff0c<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u53ef\u4ee5\u81ea\u52a8\u5904\u7406\u4f9d\u8d56\u6027\u5173\u7cfb\uff0c\u5e76\u4e14\u4e00\u6b21\u5b89\u88c5\u6240\u6709\u4f9d\u8d56\u7684\u8f6f\u4ef6\u5305<\/span>\u3002<\/p>\n<\/li>\n<li>\n<p>yum \u7684\u57fa\u672c\u6307\u4ee4\uff1a<\/p>\n<p>\u67e5\u8be2 yum \u670d\u52a1\u5668\u662f\u5426\u6709\u9700\u8981\u5b89\u88c5\u7684\u8f6f\u4ef6<\/p>\n<p>yum list|grep xxx<\/p>\n<\/li>\n<li>\n<p>\u5b89\u88c5\u6307\u5b9a\u7684 yum \u5305\uff1a<\/p>\n<p>yum install xxx<\/p>\n<\/li>\n<li>\n<p>yum \u5e94\u7528\u5b9e\u4f8b\uff1a<\/p>\n<p>\u6848\u4f8b\uff1a\u8bf7\u4f7f\u7528 yum \u7684\u65b9\u5f0f\u6765\u5b89\u88c5 firefox<\/p>\n<p>rpm -e firefox<\/p>\n<p>yum list | grep firefox<\/p>\n<p>yum install firefox<\/p>\n<\/li>\n<\/ol>\n<h3>\u4e8c\u5341\u3001\u642d\u5efa JavaEE \u73af\u5883<\/h3>\n<ol>\n<li>\u5b89\u88c5 JDK<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u5b89\u88c5\u6b65\u9aa4\uff1a<\/p>\n<p>1)mkdir \/opt\/jdk<\/p>\n<p>2)\u901a\u8fc7 xftp6 \u4e0a\u4f20\u5230 \/opt\/jdk \u4e0b<\/p>\n<p>3)cd \/opt\/jdk<\/p>\n<p>4)\u89e3\u538b tar-zxvfjdk-8u261-linux-x64.tar.gz<\/p>\n<p>5)mkdir \/usr\/local\/java<\/p>\n<p>6)mv \/opt\/jdk\/jdk1.8.0_261\/usr\/local\/java<\/p>\n<p>7)\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u7684\u914d\u7f6e\u6587\u4ef6 vim \/etc\/profile<\/p>\n<p>8)export JAVA_HOME=\/usr\/local\/java\/jdk1.8.0_261<\/p>\n<p>9)export PATH=\\<span class=\"katex math inline\">JAVA_HOME\/bin:<\/span>PATH<\/p>\n<p>10) source \/etc\/profile[\u8ba9\u65b0\u7684\u73af\u5883\u53d8\u91cf\u751f\u6548]<\/p>\n<\/li>\n<li>\n<p>\u6d4b\u8bd5\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 ~]# java -version<br \/>\n openjdk version &#8220;1.8.0_181&#8221;<br \/>\n OpenJDK Runtime Environment (build 1.8.0_181-b13)<br \/>\n OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)<\/p>\n<p>&#8220;`<\/p>\n<p>\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684 Hello.java \u8f93\u51fa&quot;hello,world!&quot;<\/p>\n<p>&#8220;`java<br \/>\n public class Hello{<\/p>\n<pre><code>     public static void main(String[] args){\n\n             System.out.println(\"hello,java\");\n\n     }\n<\/code><\/pre>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>&#8220;`shell<br \/>\n [root@alanCentos01 home]# javac Hello.java<br \/>\n [root@alanCentos01 home]# java Hello<br \/>\n hello,java<br \/>\n [root@alanCentos01 home]# <\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\n<p>tomcat\u7684\u5b89\u88c5<\/p>\n<p>\u6b65\u9aa4 :<\/p>\n<p>1)\u4e0a\u4f20\u5b89\u88c5\u6587\u4ef6\uff0c\u5e76\u89e3\u538b\u7f29\u5230\/opt\/tomcat<\/p>\n<p>2)\u8fdb\u5165\u89e3\u538b\u76ee\u5f55\/bin , \u542f\u52a8 tomcat.\/startup.sh<\/p>\n<p>3)\u5f00\u653e\u7aef\u53e3 8080 , \u56de\u987e firewall-cmd<\/p>\n<p>16.3.2 \u6d4b\u8bd5\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<p>\u5728 windows\u3001Linux \u4e0b \u8bbf\u95eehttp:\/\/linuxip:8080<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210424230314204.png\" alt=\"image-20210424230314204\" \/><\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 \/]# cd \/opt\/tomcat\/apache-tomcat-8.5.59\/webapps\/ROOT\/\n[root@alanCentos01 bin]# firewall-cmd --permanent --add-port=8080\/tcp\nsuccess\n[root@alanCentos01 bin]# firewall-cmd --reload\nsuccess\n[root@alanCentos01 bin]# firewall-cmd --query-port=8080\/tcp\nyes\n[root@alanCentos01 ROOT]# vim alan.html\n[root@alanCentos01 ROOT]# \n\n<\/code><\/pre>\n<pre data-language=HTML><code class=\"language-markup line-numbers\">&lt;html&gt;\n       &lt;h1&gt;Hello,Alan!&lt;\/h1&gt;\n&lt;\/html&gt;\n\n<\/code><\/pre>\n<\/li>\n<li>idea2020 \u7684\u5b89\u88c5\n<p>\u6b65\u9aa4\uff1a<\/p>\n<p>1)\u4e0b\u8f7d\u5730\u5740: https:\/\/www.jetbrains.com\/idea\/download\/#section=windows<\/p>\n<p>2)\u89e3\u538b\u7f29\u5230\/opt\/idea<\/p>\n<p>3)\u542f\u52a8 idea bin \u76ee\u5f55\u4e0b .\/idea.sh\uff0c\u914d\u7f6e jdk<\/p>\n<p>4)\u7f16\u5199 Hello world \u7a0b\u5e8f\u5e76\u6d4b\u8bd5\u6210\u529f\uff01<\/p>\n<\/li>\n<li>\n<p>mysql5.7 \u7684\u5b89\u88c5<\/p>\n<p>1)\u65b0\u5efa\u6587\u4ef6\u5939\/opt\/mysql\uff0c\u5e76cd\u8fdb\u53bb<\/p>\n<p>2)\u8fd0\u884cwget http:\/\/dev.mysql.com\/get\/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar\uff0c\u4e0b\u8f7dmysql\u5b89\u88c5\u5305<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 mysql]# wget http:\/\/dev.mysql.com\/get\/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar\n--2021-04-25 23:11:50--  http:\/\/dev.mysql.com\/get\/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar\n\u6b63\u5728\u89e3\u6790\u4e3b\u673a dev.mysql.com (dev.mysql.com)... 137.254.60.11\n\u6b63\u5728\u8fde\u63a5 dev.mysql.com (dev.mysql.com)|137.254.60.11|:80... \u5df2\u8fde\u63a5\u3002\n\u5df2\u53d1\u51fa HTTP \u8bf7\u6c42\uff0c\u6b63\u5728\u7b49\u5f85\u56de\u5e94... 301 Moved Permanently\n\u4f4d\u7f6e\uff1ahttps:\/\/dev.mysql.com\/get\/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar [\u8ddf\u968f\u81f3\u65b0\u7684 URL]\n--2021-04-25 23:11:50--  https:\/\/dev.mysql.com\/get\/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar\n\u6b63\u5728\u8fde\u63a5 dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... \u5df2\u8fde\u63a5\u3002\n\u5df2\u53d1\u51fa HTTP \u8bf7\u6c42\uff0c\u6b63\u5728\u7b49\u5f85\u56de\u5e94... 302 Found\n\u4f4d\u7f6e\uff1ahttps:\/\/cdn.mysql.com\/\/archives\/mysql-5.7\/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar [\u8ddf\u968f\u81f3\u65b0\u7684 URL]\n--2021-04-25 23:11:52--  https:\/\/cdn.mysql.com\/\/archives\/mysql-5.7\/mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar\n\u6b63\u5728\u89e3\u6790\u4e3b\u673a cdn.mysql.com (cdn.mysql.com)... 96.16.173.94\n\u6b63\u5728\u8fde\u63a5 cdn.mysql.com (cdn.mysql.com)|96.16.173.94|:443... \u5df2\u8fde\u63a5\u3002\n\u5df2\u53d1\u51fa HTTP \u8bf7\u6c42\uff0c\u6b63\u5728\u7b49\u5f85\u56de\u5e94... 200 OK\n\u957f\u5ea6\uff1a530882560 (506M) [application\/x-tar]\n\u6b63\u5728\u4fdd\u5b58\u81f3: \u201cmysql-5.7.26-1.el7.x86_64.rpm-bundle.tar\u201d\n\n100%[==============================================================================================================================&gt;] 530,882,560 5.95MB\/s \u7528\u65f6 87s    \n\n2021-04-25 23:13:20 (5.82 MB\/s) - \u5df2\u4fdd\u5b58 \u201cmysql-5.7.26-1.el7.x86_64.rpm-bundle.tar\u201d [530882560\/530882560])\n\n[root@alanCentos01 mysql]# \n\n<\/code><\/pre>\n<p>3)\u8fd0\u884c\uff1atar -xvf mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 mysql]# tar -xvf mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar \nmysql-community-embedded-devel-5.7.26-1.el7.x86_64.rpm\nmysql-community-libs-5.7.26-1.el7.x86_64.rpm\nmysql-community-embedded-5.7.26-1.el7.x86_64.rpm\nmysql-community-test-5.7.26-1.el7.x86_64.rpm\nmysql-community-embedded-compat-5.7.26-1.el7.x86_64.rpm\nmysql-community-common-5.7.26-1.el7.x86_64.rpm\nmysql-community-devel-5.7.26-1.el7.x86_64.rpm\nmysql-community-client-5.7.26-1.el7.x86_64.rpm\nmysql-community-server-5.7.26-1.el7.x86_64.rpm\nmysql-community-libs-compat-5.7.26-1.el7.x86_64.rpm\n\n<\/code><\/pre>\n<p>4)\u8fd0\u884crpm -qa|grep mari\uff0c\u67e5\u8be2mariadb\u76f8\u5173\u5b89\u88c5\u5305<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\uff08centos7.6\u81ea\u5e26\u7684\u7c7bmysql\u6570\u636e\u5e93\u662fmariadb\uff0c\u4f1a\u8ddfmysql\u51b2\u7a81\uff0c\u8981\u5148\u5220\u9664\uff09<\/span><\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 mysql]# rpm -qa|grep mari\nmariadb-libs-5.5.60-1.el7_5.x86_64\nmarisa-0.2.4-4.el7.x86_64\n\n<\/code><\/pre>\n<p>5)\u8fd0\u884crpm -e &#8211;nodeps mariadb-libs\uff0c\u5378\u8f7d<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 mysql]# rpm -e --nodeps mariadb-libs\n[root@alanCentos01 mysql]# rpm -e --nodeps marisa\n[root@alanCentos01 mysql]#\n\n<\/code><\/pre>\n<p>6)\u7136\u540e\u5f00\u59cb\u771f\u6b63\u5b89\u88c5mysql\uff0c\u4f9d\u6b21\u8fd0\u884c\u4ee5\u4e0b\u51e0\u6761\uff1a<\/p>\n<p>rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm<\/p>\n<p>rpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpm<\/p>\n<p>rpm -ivh mysql-community-client-5.7.26-1.el7.x86_64.rpm<\/p>\n<p>rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 mysql]# rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm\n\u8b66\u544a\uff1amysql-community-common-5.7.26-1.el7.x86_64.rpm: \u5934V3 DSA\/SHA1 Signature, \u5bc6\u94a5 ID 5072e1f5: NOKEY\n\u51c6\u5907\u4e2d...                          ################################# [100%]\n\u6b63\u5728\u5347\u7ea7\/\u5b89\u88c5...\n  1:mysql-community-common-5.7.26-1.e################################# [100%]\n[root@alanCentos01 mysql]# rpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpm\n\u8b66\u544a\uff1amysql-community-libs-5.7.26-1.el7.x86_64.rpm: \u5934V3 DSA\/SHA1 Signature, \u5bc6\u94a5 ID 5072e1f5: NOKEY\n\u51c6\u5907\u4e2d...                          ################################# [100%]\n\u6b63\u5728\u5347\u7ea7\/\u5b89\u88c5...\n  1:mysql-community-libs-5.7.26-1.el7################################# [100%]\n[root@alanCentos01 mysql]# rpm -ivh mysql-community-client-5.7.26-1.el7.x86_64.rpm\n\u8b66\u544a\uff1amysql-community-client-5.7.26-1.el7.x86_64.rpm: \u5934V3 DSA\/SHA1 Signature, \u5bc6\u94a5 ID 5072e1f5: NOKEY\n\u51c6\u5907\u4e2d...                          ################################# [100%]\n\u6b63\u5728\u5347\u7ea7\/\u5b89\u88c5...\n  1:mysql-community-client-5.7.26-1.e################################# [100%]\n[root@alanCentos01 mysql]# rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm\n\u8b66\u544a\uff1amysql-community-server-5.7.26-1.el7.x86_64.rpm: \u5934V3 DSA\/SHA1 Signature, \u5bc6\u94a5 ID 5072e1f5: NOKEY\n\u51c6\u5907\u4e2d...                          ################################# [100%]\n\u6b63\u5728\u5347\u7ea7\/\u5b89\u88c5...\n  1:mysql-community-server-5.7.26-1.e################################# [100%]\n[root@alanCentos01 mysql]# \n\n<\/code><\/pre>\n<p>7)\u8fd0\u884csystemctl start mysqld.service\uff0c\u542f\u52a8mysql<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 mysql]# systemctl start mysqld.service\n[root@alanCentos01 mysql]#\n\n<\/code><\/pre>\n<p>8)\u7136\u540e\u5f00\u59cb\u8bbe\u7f6eroot\u7528\u6237\u5bc6\u7801\uff0cMysql\u81ea\u52a8\u7ed9root\u7528\u6237\u8bbe\u7f6e\u968f\u673a\u5bc6\u7801\uff0c\u8fd0\u884cgrep &#8220;password&#8221; \/var\/log\/mysqld.log\u53ef\u770b\u5230\u5f53\u524d\u5bc6\u7801<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 mysql]# cat \/var\/log\/mysqld.log | grep password\n2021-04-25T15:27:29.972582Z 1 [Note] A temporary password is generated for root@localhost: sud5=xsCghld\n[root@alanCentos01 mysql]# grep \"password\" \/var\/log\/mysqld.log\n2021-04-25T15:27:29.972582Z 1 [Note] A temporary password is generated for root@localhost: sud5=xsCghld\n[root@alanCentos01 mysql]# \n\n<\/code><\/pre>\n<p>9)\u8fd0\u884cmysql -u root -p\uff0c\u7528root\u7528\u6237\u767b\u5f55\uff0c\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u53ef\u7528\u4e0a\u8ff0\u7684\uff0c\u53ef\u4ee5\u6210\u529f\u767b\u9646\u8fdb\u5165mysql\u547d\u4ee4\u884c<\/p>\n<pre><code class=\"language-shell line-numbers\">[root@alanCentos01 mysql]# mysql -uroot -p\nEnter password: \nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 2\nServer version: 5.7.26\n\nCopyright (c) 2000, 2019, Oracle and\/or its affiliates. All rights reserved.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql&gt;\n\n<\/code><\/pre>\n<p>10)\u8bbe\u7f6eroot\u5bc6\u7801\uff0c\u5bf9\u4e8e\u4e2a\u4eba\u5f00\u53d1\u73af\u5883\uff0c\u5982\u679c\u8981\u8bbe\u6bd4\u8f83\u7b80\u5355\u7684\u5bc6\u7801\uff08<strong>\u751f\u4ea7\u73af\u5883\u670d\u52a1\u5668\u8981\u8bbe\u590d\u6742\u5bc6\u7801<\/strong>\uff09\uff0c\u53ef\u4ee5\u8fd0\u884c\uff1a<\/p>\n<p>set global validate_password_policy=0; \u63d0\u793a\u5bc6\u7801\u8bbe\u7f6e\u7b56\u7565<\/p>\n<p>\uff08validate_password_policy\u9ed8\u8ba4\u503c1\uff0c\uff09<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210425234159833.png\" alt=\"image-20210425234159833\" \/><\/p>\n<pre><code class=\"language-mysql line-numbers\">mysql&gt; set global validate_password_policy=0;\nQuery OK, 0 rows affected (0.00 sec)\n\n<\/code><\/pre>\n<p>11)set password for &#8216;root&#8217;@&#8217;localhost&#8217; =password(&#8216;123456&#8217;);<\/p>\n<pre><code class=\"language-mysql line-numbers\">mysql&gt; set password for 'root'@'localhost' =password('123456');\nERROR 1819 (HY000): Your password does not satisfy the current policy requirements\nmysql&gt; set password for 'root'@'localhost' =password('alan123456');\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\n<\/code><\/pre>\n<p>12)\u8fd0\u884cflush privileges;\u4f7f\u5bc6\u7801\u8bbe\u7f6e\u751f\u6548<\/p>\n<pre><code class=\"language-mysql line-numbers\">mysql&gt; flush privileges;\nQuery OK, 0 rows affected (0.01 sec)\nmysql&gt; show databases;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| mysql              |\n| performance_schema |\n| sys                |\n+--------------------+\n4 rows in set (0.00 sec)\n\nmysql&gt; quit\nBye\n[root@alanCentos01 mysql]#\n\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u4e8c\u5341\u4e00\u3001Shell\u7f16\u7a0b<\/h3>\n<ol>\n<li>\u811a\u672c\u683c\u5f0f\u8981\u6c42\n<p>1)\u811a\u672c\u4ee5#!\/bin\/bash \u5f00\u5934<\/p>\n<p>2)\u811a\u672c\u9700\u8981\u6709\u53ef\u6267\u884c\u6743\u9650<\/p>\n<\/li>\n<li>\n<p>\u7f16\u5199\u7b2c\u4e00\u4e2a Shell \u811a\u672c<\/p>\n<p>\u9700\u6c42\u8bf4\u660e\uff1a\u521b\u5efa\u4e00\u4e2a Shell \u811a\u672c\uff0c\u8f93\u51fa hello world!<\/p>\n<p>vim hello.sh<\/p>\n<h1>!\/bin\/bash<\/h1>\n<p>echo &#8220;hello,world~&#8221;<\/p>\n<\/li>\n<li>\n<p>\u811a\u672c\u7684\u5e38\u7528\u6267\u884c\u65b9\u5f0f<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u65b9\u5f0f1\uff1a(\u8f93\u5165\u811a\u672c\u7684\u7edd\u5bf9\u8def\u5f84\u6216\u76f8\u5bf9\u8def\u5f84)<\/p>\n<p>\u8bf4\u660e\uff1a\u9996\u5148\u8981\u8d4b\u4e88 helloworld.sh \u811a\u672c\u7684+x \u6743\u9650\uff0c \u518d\u6267\u884c\u811a\u672c\uff1b<\/p>\n<p>\u6bd4\u5982\uff1a .\/hello.sh \u6216\u8005\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\/root\/shcode\/hello.sh<\/p>\n<\/li>\n<li>\n<p>\u65b9\u5f0f2\uff1a(sh+\u811a\u672c)<br \/>\n \u8bf4\u660e\uff1a\u4e0d\u7528\u8d4b\u4e88\u811a\u672c+x \u6743\u9650\uff0c\u76f4\u63a5\u6267\u884c\u5373\u53ef\u3002<br \/>\n \u6bd4\u5982\uff1ash hello.sh\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84<\/p>\n<\/li>\n<\/ul>\n<ol start=\"4\">\n<li>Shell \u7684\u53d8\u91cf<\/li>\n<\/ol>\n<ul>\n<li>\n<p>Shell\u53d8\u91cf\u4ecb\u7ecd<\/p>\n<p>1)Linux Shell \u4e2d\u7684\u53d8\u91cf\u5206\u4e3a\uff0c\u7cfb\u7edf\u53d8\u91cf\u548c\u7528\u6237\u81ea\u5b9a\u4e49\u53d8\u91cf\u3002<\/p>\n<p>2)\u7cfb\u7edf\u53d8\u91cf\uff1a\\<span class=\"katex math inline\">HOME\u3001\\$PWD\u3001\u200b\\$SHELL\u3001\u200b\\$USER \u7b49\u7b49\uff0c\u6bd4\u5982\uff1a echo<\/span>HOME\u7b49\u7b49..<\/p>\n<p>3)<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u663e\u793a\u5f53\u524d shell \u4e2d\u6240\u6709\u53d8\u91cf\uff1aset<\/span><\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 ~]# set | grep JAVA_HOME<br \/>\n JAVA_HOME=\/usr\/local\/java\/jdk1.8.0_261<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;shell \u53d8\u91cf\u7684\u5b9a\u4e49<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5<\/p>\n<p>1)\u5b9a\u4e49\u53d8\u91cf\uff1a\u53d8\u91cf\u540d=\u503c<\/p>\n<p>2)\u64a4\u9500\u53d8\u91cf\uff1aunset \u53d8\u91cf<\/p>\n<p>3)\u58f0\u660e\u9759\u6001\u53d8\u91cf\uff1areadonly \u53d8\u91cf\uff0c&lt;span class=&quot;text-highlighted-inline&quot; style=&quot;background-color: #fffd38;&quot;&gt;\u6ce8\u610f\uff1a\u4e0d\u80fd\u88abunset&lt;\/span&gt;<\/p>\n<p>\u5feb\u901f\u5165\u95e8<\/p>\n<p>1)\u6848\u4f8b 1\uff1a\u5b9a\u4e49\u53d8\u91cf A<\/p>\n<p>2)\u6848\u4f8b 2\uff1a\u64a4\u9500\u53d8\u91cf A<\/p>\n<p>3)\u6848\u4f8b 3\uff1a\u58f0\u660e\u9759\u6001\u7684\u53d8\u91cf B=2\uff0c\u4e0d\u80fdunset<\/p>\n<p>\u5b9e\u73b0\u5982\u4e0b\uff08\u591a\u884c\u6ce8\u91ca\u65b9\u5f0f\u4e3a\uff1a&lt;span class=&quot;text-highlighted-inline&quot; style=&quot;background-color: #fffd38;&quot;&gt;:&lt;&lt;!  \u5185\u5bb9  !&lt;\/span&gt;\uff09<\/p>\n<p>&#8220;`shell<br \/>\n #!\/bin\/bash<br \/>\n #\u6848\u4f8b 1\uff1a\u5b9a\u4e49\u53d8\u91cf A<br \/>\n A=100<br \/>\n #\u8f93\u51fa\u53d8\u91cf\u9700\u8981\u52a0\u4e0a<span class=\"katex math inline\">echo A=<\/span>A<br \/>\n echo &#8220;A=<span class=\"katex math inline\">A&#8221;<br \/>\n #\u6848\u4f8b 2\uff1a\u64a4\u9500\u53d8\u91cf A<br \/>\n unset A<br \/>\n echo &#8220;A=<\/span>A&#8221;<br \/>\n #\u6848\u4f8b 3\uff1a\u58f0\u660e\u9759\u6001\u7684\u53d8\u91cf B=2\uff0c\u4e0d\u80fd unset<br \/>\n readonly B=2<br \/>\n echo &#8220;B=$B&#8221;<br \/>\n #unset B<br \/>\n #\u5c06\u6307\u4ee4\u8fd4\u56de\u7684\u7ed3\u679c\u8d4b\u7ed9\u53d8\u91cf<br \/>\n :<<!\n C=`date`\n D=$(date)\n echo \"C=$C\"\n echo \"D=$D\"\n !\n #\u4f7f\u7528\u73af\u5883\u53d8\u91cf TOMCAT_HOME\n echo \"tomcat_home=$TOMCAT_HOME\"\n\n\n\n```\n\n\n\u5b9a\u4e49\u53d8\u91cf\u7684\u89c4\u5219\n\n1)\u53d8\u91cf\u540d\u79f0\u53ef\u4ee5\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4f46\u662f\u4e0d\u80fd\u4ee5\u6570\u5b57\u5f00\u5934\u30025A=200(\u00d7)\n\n2)\u7b49\u53f7\u4e24\u4fa7\u4e0d\u80fd\u6709\u7a7a\u683c\n\n3)\u53d8\u91cf\u540d\u79f0\u4e00\u822c\u4e60\u60ef\u4e3a\u5927\u5199\uff0c \u8fd9\u662f\u4e00\u4e2a\u89c4\u8303\uff0c\u6211\u4eec\u9075\u5b88\u5373\u53ef\n\n\u5c06\u547d\u4ee4\u7684\u8fd4\u56de\u503c\u8d4b\u7ed9\u53d8\u91cf\n\n1)\u53cd\u5f15\u53f7\uff0c\u8fd0\u884c\u91cc\u9762\u7684\u547d\u4ee4\uff0c\u5e76\u628a\u7ed3\u679c\u8fd4\u56de\u7ed9\u53d8\u91cf A\n\n\n```shell\n A=`date` #\u53cd\u5f15\u53f7\uff0c\u8fd0\u884c\u91cc\u9762\u7684\u547d\u4ee4\uff0c\u5e76\u628a\u7ed3\u679c\u8fd4\u56de\u7ed9\u53d8\u91cf A\n\n\n\n```\n\n\n2)A=$(date) \u7b49\u4ef7\u4e8e\u53cd\u5f15\u53f7&lt;\/p&gt;&lt;\/li&gt;\n&lt;\/ul&gt;\n\n&lt;ol start=&quot;5&quot;&gt;\n&lt;li&gt;\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf&lt;\/li&gt;\n&lt;\/ol&gt;\n\n&lt;ul&gt;\n&lt;li&gt;&lt;p&gt;\u57fa\u672c\u8bed\u6cd5\n\n1)export \u53d8\u91cf\u540d=\u53d8\u91cf\u503c \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u5c06 shell \u53d8\u91cf\u8f93\u51fa\u4e3a\u73af\u5883\u53d8\u91cf\/\u5168\u5c40\u53d8\u91cf\uff09\n\n2)source \u914d\u7f6e\u6587\u4ef6\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u8ba9\u4fee\u6539\u540e\u7684\u914d\u7f6e\u4fe1\u606f\u7acb\u5373\u751f\u6548\uff09\n\n3)echo $\u53d8\u91cf\u540d\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u67e5\u8be2\u73af\u5883\u53d8\u91cf\u7684\u503c\uff09&lt;\/p&gt;&lt;\/li&gt;\n&lt;li&gt;&lt;p&gt;\u5feb\u901f\u5165\u95e8\n\n1)\u5728\/etc\/profile \u6587\u4ef6\u4e2d\u5b9a\u4e49 TOMCAT_HOME \u73af\u5883\u53d8\u91cf\n\n2)\u67e5\u770b\u73af\u5883\u53d8\u91cf TOMCAT_HOME \u7684\u503c\n\n3)\u5728\u53e6\u5916\u4e00\u4e2a shell \u7a0b\u5e8f\u4e2d\u4f7f\u7528 TOMCAT_HOME\n\n\u6ce8\u610f\uff1a\u5728\u8f93\u51fa TOMCAT_HOME \u73af\u5883\u53d8\u91cf\u524d\uff0c\u9700\u8981\u8ba9\u5176\u751f\u6548\uff0c\u6267\u884c\u547d\u4ee4\u5982\u4e0b\n\nsource \/etc\/profile\n\n&lt;img src=&quot;https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210426211328173.png&quot; alt=&quot;image-20210426211328173&quot; \/&gt;\n\n&lt;span class=&quot;text-highlighted-inline&quot; style=&quot;background-color: #fffd38;&quot;&gt;shell \u811a\u672c\u7684\u591a\u884c\u6ce8\u91ca\uff0c\u683c\u5f0f\u5982\u4e0b\uff1a&lt;\/span&gt;\n\n:&lt;&lt;!  \u5185\u5bb9  !&lt;\/p&gt;&lt;\/li&gt;\n&lt;\/ul&gt;\n\n&lt;ol start=&quot;6&quot;&gt;\n&lt;li&gt;\u4f4d\u7f6e\u53c2\u6570\u53d8\u91cf&lt;\/li&gt;\n&lt;\/ol&gt;\n\n&lt;ul&gt;\n&lt;li&gt;&lt;p&gt;\u4ecb\u7ecd\n\n\u5f53\u6211\u4eec\u6267\u884c\u4e00\u4e2a shell \u811a\u672c\u65f6\uff0c\u5982\u679c\u5e0c\u671b\u83b7\u53d6\u5230\u547d\u4ee4\u884c\u7684\u53c2\u6570\u4fe1\u606f\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528\u5230\u4f4d\u7f6e\u53c2\u6570\u53d8\u91cf\uff0c\n\n\u6bd4\u5982 \uff1a .\/myshell.sh 100 200 , \u8fd9\u4e2a\u5c31\u662f\u4e00\u4e2a\u6267\u884c shell \u7684\u547d\u4ee4\u884c\uff0c\u53ef\u4ee5\u5728 myshell\u811a\u672c\u4e2d\u83b7\u53d6\u5230\u53c2\u6570\u4fe1\u606f\u3002&lt;\/p&gt;&lt;\/li&gt;\n&lt;li&gt;&lt;p&gt;\u57fa\u672c\u8bed\u6cd5\n \\$n \uff08\u529f\u80fd\u63cf\u8ff0\uff1an \u4e3a\u6570\u5b57\uff0c\\$0 \u4ee3\u8868\u547d\u4ee4\u672c\u8eab\uff0c\\$1-\u200b\\$9 \u4ee3\u8868\u7b2c\u4e00\u5230\u7b2c\u4e5d\u4e2a\u53c2\u6570\uff0c\u5341\u4ee5\u4e0a\u7684\u53c2\u6570\uff0c\u5341\u4ee5\u4e0a\u7684\u53c2\u6570\u9700\u8981\u7528\u5927\u62ec\u53f7\u5305\u542b\uff0c\u5982\u200b\\${10}\uff09\n\n\\$* \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u8fd9\u4e2a\u53d8\u91cf\u4ee3\u8868\u547d\u4ee4\u884c\u4e2d\u6240\u6709\u7684\u53c2\u6570\uff0c\u200b\\$*\u628a\u6240\u6709\u7684\u53c2\u6570\u770b\u6210\u4e00\u4e2a\u6574\u4f53\uff09\n\n\\$@\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u8fd9\u4e2a\u53d8\u91cf\u4e5f\u4ee3\u8868\u547d\u4ee4\u884c\u4e2d\u6240\u6709\u7684\u53c2\u6570\uff0c\u4e0d\u8fc7\u200b\\$@\u628a\u6bcf\u4e2a\u53c2\u6570\u533a\u5206\u5bf9\u5f85\uff09\n\n\\$#\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u8fd9\u4e2a\u53d8\u91cf\u4ee3\u8868\u547d\u4ee4\u884c\u4e2d\u6240\u6709\u53c2\u6570\u7684\u4e2a\u6570\uff09&lt;\/p&gt;&lt;\/li&gt;\n&lt;li&gt;&lt;p&gt;\u4f4d\u7f6e\u53c2\u6570\u53d8\u91cf\n\n\u6848\u4f8b\uff1a\u7f16\u5199\u4e00\u4e2a shell \u811a\u672c position.sh \uff0c \u5728\u811a\u672c\u4e2d\u83b7\u53d6\u5230\u547d\u4ee4\u884c\u7684\u5404\u4e2a\u53c2\u6570\u4fe1\u606f\u3002\n\n\n```shell\n #!\/bin\/bash\n echo \"0=$0 1=$1 2=$2\"\n echo \"\u6240\u6709\u7684\u53c2\u6570=$*\"\n echo \"$@\"\n echo \"\u53c2\u6570\u7684\u4e2a\u6570=$#\"\n\n\n\n```\n&lt;\/p&gt;&lt;\/li&gt;\n&lt;\/ul&gt;\n\n&lt;ol start=&quot;7&quot;&gt;\n&lt;li&gt;\u9884\u5b9a\u4e49\u53d8\u91cf&lt;\/li&gt;\n&lt;\/ol&gt;\n\n&lt;ul&gt;\n&lt;li&gt;&lt;p&gt;\u57fa\u672c\u4ecb\u7ecd\n\n\u5c31\u662f shell \u8bbe\u8ba1\u8005\u4e8b\u5148\u5df2\u7ecf\u5b9a\u4e49\u597d\u7684\u53d8\u91cf\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728 shell \u811a\u672c\u4e2d\u4f7f\u7528\u3002&lt;\/p&gt;&lt;\/li&gt;\n&lt;li&gt;&lt;p&gt;\u57fa\u672c\u8bed\u6cd5\n\n1)$$ \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u5f53\u524d\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u53f7\uff08PID\uff09\uff09\n\n2)\\$! \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u540e\u53f0\u8fd0\u884c\u7684\u6700\u540e\u4e00\u4e2a\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u53f7\uff08PID\uff09\uff09\n\n3)\u200b\\$\uff1f\uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u6700\u540e\u4e00\u6b21\u6267\u884c\u7684\u547d\u4ee4\u7684\u8fd4\u56de\u72b6\u6001\u3002\u5982\u679c\u8fd9\u4e2a\u53d8\u91cf\u7684\u503c\u4e3a 0\uff0c\u8bc1\u660e\u4e0a\u4e00\u4e2a\u547d\u4ee4\u6b63\u786e\u6267\u884c\uff1b\u5982\u679c\u8fd9\u4e2a\u53d8\u91cf\u7684\u503c\u4e3a\u975e 0\uff08\u5177\u4f53\u662f\u54ea\u4e2a\u6570\uff0c\u7531\u547d\u4ee4\u81ea\u5df1\u6765\u51b3\u5b9a\uff09\uff0c\u5219\u8bc1\u660e\u4e0a\u4e00\u4e2a\u547d\u4ee4\u6267\u884c\u4e0d\u6b63\u786e\u4e86\u3002\uff09&lt;\/p&gt;&lt;\/li&gt;\n&lt;li&gt;&lt;p&gt;\u5e94\u7528\u5b9e\u4f8b\n\n\u5728\u4e00\u4e2a shell \u811a\u672c\u4e2d\u7b80\u5355\u4f7f\u7528\u4e00\u4e0b\u9884\u5b9a\u4e49\u53d8\u91cf\n\n\n```shell\n #!\/bin\/bash\n echo \"\u5f53\u524d\u6267\u884c\u7684\u8fdb\u7a0b id=$$\"\n #\u4ee5\u540e\u53f0\u7684\u65b9\u5f0f\u8fd0\u884c\u4e00\u4e2a\u811a\u672c\uff0c\u5e76\u83b7\u53d6\u4ed6\u7684\u8fdb\u7a0b\u53f7\n \/root\/shcode\/myshell.sh &#038;\n echo \"\u6700\u540e\u4e00\u4e2a\u540e\u53f0\u65b9\u5f0f\u8fd0\u884c\u7684\u8fdb\u7a0b id=$!\"\n echo \"\u6267\u884c\u7684\u7ed3\u679c\u662f=$?\"\n\n\n\n```\n<\/p>\n<\/li>\n<\/ul>\n<ol start=\"8\">\n<li>\u8fd0\u7b97\u7b26<\/li>\n<\/ol>\n<ul>\n<li>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f expr \u8fd0\u7b97\u7b26\u95f4\u8981\u6709\u7a7a\u683c, \u5982\u679c\u5e0c\u671b\u5c06 expr \u7684\u7ed3\u679c\u8d4b\u7ed9\u67d0\u4e2a\u53d8\u91cf\uff0c\u4f7f\u7528 &#8220;\uff08\u6ce8\u610f\uff1a\u8fd9\u4e2a\u4e0d\u662f\u5355\u5f15\u53f7\uff0c\u662f\u53cd\u5f15\u53f7\uff09<\/span><\/p>\n<p>3)expr m &#8211; n<\/p>\n<p>4)expr &#92;*, \/, %\uff1a\u4e58\uff0c\u9664\uff0c\u53d6\u4f59<\/p>\n<\/li>\n<li>\n<p>\u5e94\u7528\u5b9e\u4f8b oper.sh<\/p>\n<p>\u6848\u4f8b 1\uff1a\u8ba1\u7b97(2+3)*4 \u7684\u503c<br \/>\n \u6848\u4f8b 2\uff1a\u8bf7\u6c42\u51fa\u547d\u4ee4\u884c\u7684\u4e24\u4e2a\u53c2\u6570[\u6574\u6570]\u7684\u548c\uff1a20\u300150<\/p>\n<p>&#8220;`shell<br \/>\n #!\/bin\/bash<br \/>\n #\u6848\u4f8b 1\uff1a\u8ba1\u7b97\uff082+3\uff09X4 \u7684\u503c<br \/>\n #\u4f7f\u7528\u7b2c\u4e00\u79cd\u65b9\u5f0f<br \/>\n RES1=<span class=\"katex math inline\">(((2+3)*4))<br \/>\n echo &#8220;res1=<\/span>RES1&#8243;<br \/>\n #\u4f7f\u7528\u7b2c\u4e8c\u79cd\u65b9\u5f0f, \u63a8\u8350\u4f7f\u7528<br \/>\n RES2=<span class=\"katex math inline\">[(2+3)*4]<br \/>\n echo &#8220;res2=<\/span>RES2&#8243;<br \/>\n #\u4f7f\u7528\u7b2c\u4e09\u79cd\u65b9\u5f0f expr<br \/>\n TEMP=`expr 2 + 3`<br \/>\n RES4=`expr <span class=\"katex math inline\">TEMP \\* 4`<br \/>\n echo &#8220;temp=<\/span>TEMP&#8221;<br \/>\n echo &#8220;res4=<span class=\"katex math inline\">RES4&#8243;<br \/>\n #\u6848\u4f8b 2\uff1a\u8bf7\u6c42\u51fa\u547d\u4ee4\u884c\u7684\u4e24\u4e2a\u53c2\u6570[\u6574\u6570]\u7684\u548c 20 50<br \/>\n SUM=<\/span>[<span class=\"katex math inline\">1+<\/span>2]<br \/>\n echo &#8220;sum=<span class=\"katex math inline\">SUM&#8221;<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<\/p>\n<p>&lt;ol start=&quot;9&quot;&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u6761\u4ef6\u5224\u65ad<\/p>\n<p>\u5224\u65ad\u8bed\u53e5\uff1a&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;\/ol&gt;<\/p>\n<p>&lt;ul&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u57fa\u672c\u8bed\u6cd5<\/p>\n<p>[ condition ]&lt;span class=&quot;text-highlighted-inline&quot; style=&quot;background-color: #fffd38;&quot;&gt;\uff08\u6ce8\u610f condition \u524d\u540e\u8981\u6709\u7a7a\u683c\uff09&lt;\/span&gt;<\/p>\n<p>#\u975e\u7a7a\u8fd4\u56de true\uff0c\u53ef\u4f7f\u7528<\/span>?\u9a8c\u8bc1\uff080 \u4e3a true\uff0c&gt;1 \u4e3a false\uff09&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5e94\u7528\u5b9e\u4f8b<\/p>\n<p>[ hspEdu ]\uff1a \u8fd4\u56de true<\/p>\n<p><input style=\"margin-right:5px\" type=\"checkbox\" class=\"task-list-item-checkbox\" disabled \/>\uff1a\u8fd4\u56de false&lt;span class=&quot;text-highlighted-inline&quot; style=&quot;background-color: #fffd38;&quot;&gt;\uff08\u6ce8\u610f\uff1a\u201d[ ]\u201c\u91cc\u9762\u662f\u6709\u4e00\u4e2a\u7a7a\u683c\u7684\uff0c\u5426\u5219\u6267\u884c\u4f1a\u62a5\u9519\uff09&lt;\/span&gt;<\/p>\n<p>[ condition ] &amp;&amp; echo OK || echo notok\uff1a\u6761\u4ef6\u6ee1\u8db3\uff0c\u6267\u884c\u540e\u9762\u7684\u8bed\u53e5&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5e38\u7528\u5224\u65ad\u6761\u4ef6<\/p>\n<p>1) \u5b57\u7b26\u4e32\u6bd4\u8f83\uff1a=<\/p>\n<p>2) \u4e24\u4e2a\u6574\u6570\u7684\u6bd4\u8f83\uff1a<\/p>\n<p>&lt;ul&gt;<br \/>\n&lt;li&gt;-lt \u5c0f\u4e8e&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;-le \u5c0f\u4e8e\u7b49\u4e8e little equal&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;-eq \u7b49\u4e8e&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;-gt \u5927\u4e8e&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;-ge \u5927\u4e8e\u7b49\u4e8e&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;-ne \u4e0d\u7b49\u4e8e<\/p>\n<p>3) \u6309\u7167\u6587\u4ef6\u6743\u9650\u8fdb\u884c\u5224\u65ad\uff1a<\/p>\n<p>-r \u6709\u8bfb\u7684\u6743\u9650<\/p>\n<p>-w \u6709\u5199\u7684\u6743\u9650<\/p>\n<p>-x \u6709\u6267\u884c\u7684\u6743\u9650<\/p>\n<p>4) \u6309\u7167\u6587\u4ef6\u7c7b\u578b\u8fdb\u884c\u5224\u65ad\uff1a<\/p>\n<p>-f \u6587\u4ef6\u5b58\u5728\u5e76\u4e14\u662f\u4e00\u4e2a\u5e38\u89c4\u7684\u6587\u4ef6<\/p>\n<p>-e \u6587\u4ef6\u5b58\u5728<\/p>\n<p>-d \u6587\u4ef6\u5b58\u5728\u5e76\u662f\u4e00\u4e2a\u76ee\u5f55&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5e94\u7528\u5b9e\u4f8b ifdemo.sh<\/p>\n<p>\u6848\u4f8b 1\uff1a&quot;ok&quot;\u662f\u5426\u7b49\u4e8e&quot;ok&quot;<\/p>\n<p>\u5224\u65ad\u8bed\u53e5\uff1a\u4f7f\u7528 =<\/p>\n<p>\u6848\u4f8b 2\uff1a23 \u662f\u5426\u5927\u4e8e\u7b49\u4e8e 22<\/p>\n<p>\u5224\u65ad\u8bed\u53e5\uff1a\u4f7f\u7528 -ge<\/p>\n<p>\u6848\u4f8b 3\uff1a\/root\/shcode\/aaa.txt \u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u662f\u5426\u5b58\u5728<\/p>\n<p>\u5224\u65ad\u8bed\u53e5\uff1a \u4f7f\u7528 -f<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 home]# vim ifdemo.sh<\/p>\n<p>&#8220;`<\/p>\n<p>&#8220;`shell<br \/>\n #!\/bin\/bash<br \/>\n #\u6848\u4f8b 1\uff1a&#8221;ok&#8221;\u662f\u5426\u7b49\u4e8e&#8221;ok&#8221;<br \/>\n if [ &#8220;ok&#8221; = &#8220;ok&#8221; ]<br \/>\n then<br \/>\n         echo &#8220;equal&#8221;<br \/>\n fi<br \/>\n #\u6848\u4f8b 2\uff1a23 \u662f\u5426\u5927\u4e8e\u7b49\u4e8e 22<br \/>\n if [ 23 -ge 22 ]<br \/>\n then<br \/>\n         echo &#8220;\u5927\u4e8e\u7b49\u4e8e&#8221;<br \/>\n fi<br \/>\n #\u6848\u4f8b 3\uff1a\/root\/shcode\/aaa.txt \u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u662f\u5426\u5b58\u5728<br \/>\n #\u5224\u65ad\u8bed\u53e5\uff1a \u4f7f\u7528 -f<br \/>\n if [ -f \/root\/shcode\/aaa.txt ]<br \/>\n then<br \/>\n         echo &#8220;\u5b58\u5728&#8221;<br \/>\n fi<br \/>\n #\u770b\u51e0\u4e2a\u6848\u4f8b<br \/>\n if [ alan ]<br \/>\n then<br \/>\n         echo &#8220;hello,alan&#8221;<br \/>\n fi<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<\/ul>\n<ol start=\"10\">\n<li>\n<p>\u6d41\u7a0b\u63a7\u5236<\/p>\n<ul>\n<li>if \u5224\u65ad\n<ul>\n<li>\u57fa\u672c\u8bed\u6cd5\uff1a<\/li>\n<\/ul>\n<p>if [ \u6761\u4ef6\u5224\u65ad\u5f0f ]<\/p>\n<p>then<\/p>\n<p>\u200b   \u4ee3\u7801<\/p>\n<p>fi<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6216\u8005 , \u591a\u5206\u652f<\/span><\/p>\n<p>if [ \u6761\u4ef6\u5224\u65ad\u5f0f ]<\/p>\n<p>then<\/p>\n<p>\u200b   \u4ee3\u7801<\/p>\n<p>elif [\u6761\u4ef6\u5224\u65ad\u5f0f]<\/p>\n<p>then<\/p>\n<p>\u200b   \u4ee3\u7801<\/p>\n<p>fi<\/p>\n<ul>\n<li>\u6ce8\u610f\u4e8b\u9879\uff1a[ \u6761\u4ef6\u5224\u65ad\u5f0f ]\uff0c<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u4e2d\u62ec\u53f7\u548c\u6761\u4ef6\u5224\u65ad\u5f0f\u4e4b\u95f4\u5fc5\u987b\u6709\u7a7a\u683c<\/span><\/p>\n<\/li>\n<li>\n<p>\u5e94\u7528\u5b9e\u4f8b ifCase.sh<\/p>\n<\/li>\n<\/ul>\n<p>\u6848\u4f8b\uff1a\u8bf7\u7f16\u5199\u4e00\u4e2a shell \u7a0b\u5e8f\uff0c\u5982\u679c\u8f93\u5165\u7684\u53c2\u6570\uff0c\u5927\u4e8e\u7b49\u4e8e 60\uff0c\u5219\u8f93\u51fa &#8220;\u53ca\u683c\u4e86&#8221;\uff0c\u5982\u679c\u5c0f\u4e8e 60,\u5219\u8f93\u51fa &#8220;\u4e0d\u53ca\u683c&#8221;<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim ifCase.sh\n\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">#!\/bin\/bash\n#\u6848\u4f8b\uff1a\u8bf7\u7f16\u5199\u4e00\u4e2a shell \u7a0b\u5e8f\uff0c\u5982\u679c\u8f93\u5165\u7684\u53c2\u6570\uff0c\u5927\u4e8e\u7b49\u4e8e 60\uff0c\u5219\u8f93\u51fa \"\u53ca\u683c\u4e86\"&gt;\uff0c\u5982\u679c\u5c0f\u4e8e 60,\u5219\u8f93\u51fa \"\u4e0d\u53ca\u683c\"\nif [ <span class=\"katex math inline\">1 -ge 60 ]\nthen\n        echo \"\u53ca\u683c\u4e86\"\nelif [<\/span>1 -lt 60 ]\nthen\n        echo \"\u4e0d\u53ca\u683c\"\nfi\n\n<\/code><\/pre>\n<\/li>\n<li>case \u8bed\u53e5\n<p>case $\u53d8\u91cf\u540d in<\/p>\n<p>&#8220;\u503c 1&#8243;\uff09<\/p>\n<p>\u200b \u5982\u679c\u53d8\u91cf\u7684\u503c\u7b49\u4e8e\u503c 1\uff0c\u5219\u6267\u884c\u7a0b\u5e8f 1<\/p>\n<p>;;<\/p>\n<p>&#8220;\u503c 2&#8243;\uff09<\/p>\n<p>\u200b \u5982\u679c\u53d8\u91cf\u7684\u503c\u7b49\u4e8e\u503c 2\uff0c\u5219\u6267\u884c\u7a0b\u5e8f 2<\/p>\n<p>;;<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u2026\u7701\u7565\u5176\u4ed6\u5206\u652f\u2026<\/span><\/p>\n<p>*\uff09<\/p>\n<p>\u200b \u5982\u679c\u53d8\u91cf\u7684\u503c\u90fd\u4e0d\u662f\u4ee5\u4e0a\u7684\u503c\uff0c\u5219\u6267\u884c\u6b64\u7a0b\u5e8f<\/p>\n<p>;;<\/p>\n<p>esac<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b testCase.sh<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim testCase.sh\n\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">#!\/bin\/bash\n#\u6848\u4f8b 1 \uff1a\u5f53\u547d\u4ee4\u884c\u53c2\u6570\u662f 1 \u65f6\uff0c\u8f93\u51fa \"\u5468\u4e00\", \u662f 2 \u65f6\uff0c\u5c31\u8f93\u51fa\"\u5468\u4e8c\"\uff0c \u5176\u5b83\u60c5&gt;\u51b5\u8f93\u51fa\"other\"\ncase $1 in\n\"1\")\n      echo \"\u5468\u4e00\"\n;;\n\"2\")\n      echo \"\u5468\u4e8c\"\n;;\n*)\n      echo \"other...\"\n;;\nesac\n\n<\/code><\/pre>\n<\/li>\n<li>for \u5faa\u73af\n<p>\u57fa\u672c\u8bed\u6cd5 1<\/p>\n<p>for \u53d8\u91cf in \u503c 1 \u503c 2 \u503c 3\u2026<\/p>\n<p>do<\/p>\n<p>\u7a0b\u5e8f\/\u4ee3\u7801<\/p>\n<p>done<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b testFor1.sh<\/p>\n<p>\u6848\u4f8b 1 \uff1a\u6253\u5370\u547d\u4ee4\u884c\u8f93\u5165\u7684\u53c2\u6570 [\u8fd9\u91cc\u53ef\u4ee5\u770b\u51fa<span class=\"katex math inline\">* \u548c<\/span>@ \u7684\u533a\u522b]<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim testFor1.sh\n\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">#!\/bin\/bash\n#\u6848\u4f8b 1 \uff1a\u6253\u5370\u547d\u4ee4\u884c\u8f93\u5165\u7684\u53c2\u6570 [\u8fd9\u91cc\u53ef\u4ee5\u770b\u51fa<span class=\"katex math inline\">* \u548c<\/span>@ \u7684\u533a\u522b]\n#\u6ce8\u610f\uff1a<span class=\"katex math inline\">*\u662f\u628a\u8f93\u5165\u7684\u53c2\u6570\uff0c\u5f53\u505a\u4e00\u4e2a\u6574\u4f53\uff0c\u6240\u4ee5\uff0c\u53ea\u4f1a\u8f93\u51fa\u4e00\u53e5\nfor i in \"<\/span>*\"\ndo\n      echo \"num is <span class=\"katex math inline\">i\"\ndone\n#\u4f7f\u7528<\/span>@\u6765\u83b7\u53d6\u8f93\u5165\u7684\u53c2\u6570\uff0c\u6ce8\u610f\uff0c\u8fd9\u65f6\u662f\u5206\u522b\u5bf9\u5f85\uff0c\u6240\u4ee5\u6709\u51e0\u4e2a\u53c2\u6570\uff0c\u5c31\u8f93\u51fa\u51e0\u4e2a\necho \"========================================\"\nfor j in \"<span class=\"katex math inline\">@\"\ndo\n      echo \"num is<\/span>j\"\ndone\n\n<\/code><\/pre>\n<p>\u57fa\u672c\u8bed\u6cd5 2<\/p>\n<p>for (( \u521d\u59cb\u503c;\u5faa\u73af\u63a7\u5236\u6761\u4ef6;\u53d8\u91cf\u53d8\u5316 ))<\/p>\n<p>do<\/p>\n<p>\u200b \u7a0b\u5e8f\/\u4ee3\u7801<\/p>\n<p>done<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b testFor2.sh<\/p>\n<p>\u6848\u4f8b 1 \uff1a\u4ece 1 \u52a0\u5230 100 \u7684\u503c\u8f93\u51fa\u663e\u793a<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim testFor2.sh\n\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">#!\/bin\/bash\n#\u6848\u4f8b 1 \uff1a\u4ece 1 \u52a0\u5230 100 \u7684\u503c\u8f93\u51fa\u663e\u793a\n#\u5b9a\u4e49\u4e00\u4e2a\u53d8\u91cfSUM\nSUM=0\nfor(( i=1; i&lt;=<span class=\"katex math inline\">1; i++ ))\ndo\n      #\u5199\u4e0a\u4f60\u7684\u4e1a\u52a1\u4ee3\u7801\n      SUM=<\/span>[<span class=\"katex math inline\">SUM+<\/span>i]\ndone\necho \"\u603b\u548cSUM=$SUM\"0\n\n<\/code><\/pre>\n<\/li>\n<li>while \u5faa\u73af\n<p>\u57fa\u672c\u8bed\u6cd5 1<\/p>\n<p>while [ \u6761\u4ef6\u5224\u65ad\u5f0f ]<\/p>\n<p>do<\/p>\n<p>\u200b \u7a0b\u5e8f \/\u4ee3\u7801<\/p>\n<p>done<\/p>\n<p>\u6ce8\u610f\uff1awhile \u548c [\u6709\u7a7a\u683c\uff0c\u6761\u4ef6\u5224\u65ad\u5f0f\u548c [\u4e5f\u6709\u7a7a\u683c<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b testWhile.sh<\/p>\n<p>\u6848\u4f8b 1 \uff1a\u4ece\u547d\u4ee4\u884c\u8f93\u5165\u4e00\u4e2a\u6570 n\uff0c\u7edf\u8ba1\u4ece 1+..+ n \u7684\u503c\u662f\u591a\u5c11\uff1f<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim testWhile.sh\n\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">#!\/bin\/bash\n#\u6848\u4f8b 1 \uff1a\u4ece\u547d\u4ee4\u884c\u8f93\u5165\u4e00\u4e2a\u6570 n\uff0c\u7edf\u8ba1\u4ece 1+..+ n \u7684\u503c\u662f\u591a\u5c11\uff1f\nSUM=0\ni=0\nwhile [ <span class=\"katex math inline\">i -le<\/span>1 ]\ndo\n      SUM=<span class=\"katex math inline\">[<\/span>SUM+<span class=\"katex math inline\">i]\n      #i\u81ea\u589e\n      i=<\/span>[<span class=\"katex math inline\">i+1]\ndone\necho \"\u6267\u884c\u7ed3\u679c=<\/span>SUM\"\n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>read \u8bfb\u53d6\u63a7\u5236\u53f0\u8f93\u5165\n<ul>\n<li>\u57fa\u672c\u8bed\u6cd5\n<p>read(\u9009\u9879)(\u53c2\u6570)<\/p>\n<p>\u9009\u9879\uff1a<\/p>\n<p>-p\uff1a\u6307\u5b9a\u8bfb\u53d6\u503c\u65f6\u7684\u63d0\u793a\u7b26\uff1b<\/p>\n<p>-t\uff1a\u6307\u5b9a\u8bfb\u53d6\u503c\u65f6\u7b49\u5f85\u7684\u65f6\u95f4\uff08\u79d2\uff09\uff0c\u5982\u679c\u6ca1\u6709\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u5185\u8f93\u5165\uff0c\u5c31\u4e0d\u518d\u7b49\u5f85\u4e86\u3002\u3002<\/p>\n<p>\u53c2\u6570<\/p>\n<p>\u53d8\u91cf\uff1a\u6307\u5b9a\u8bfb\u53d6\u503c\u7684\u53d8\u91cf\u540d<\/p>\n<\/li>\n<li>\n<p>\u5e94\u7528\u5b9e\u4f8b testRead.sh<\/p>\n<p>\u6848\u4f8b 1\uff1a\u8bfb\u53d6\u63a7\u5236\u53f0\u8f93\u5165\u4e00\u4e2a NUM1 \u503c<\/p>\n<p>\u6848\u4f8b 2\uff1a\u8bfb\u53d6\u63a7\u5236\u53f0\u8f93\u5165\u4e00\u4e2a NUM2 \u503c\uff0c\u5728 10 \u79d2\u5185\u8f93\u5165\u3002<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim testRead.sh\n\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">#!\/bin\/bash\n#\u6848\u4f8b 1\uff1a\u8bfb\u53d6\u63a7\u5236\u53f0\u8f93\u5165\u4e00\u4e2a NUM1 \u503c\nread -p \"\u8bf7\u8f93\u5165\u4e00\u4e2a\u6570NUM1=\" NUM1\necho \"\u4f60\u8f93\u5165\u7684NUM1=<span class=\"katex math inline\">NUM1\"\n#\u6848\u4f8b 2\uff1a\u8bfb\u53d6\u63a7\u5236\u53f0\u8f93\u5165\u4e00\u4e2a NUM2 \u503c\uff0c\u5728 10 \u79d2\u5185\u8f93\u5165\u3002\nread -t 10 -p \"\u8bf7\u8f93\u5165\u4e00\u4e2a\u6570NUM2=\" NUM2\necho \"\u4f60\u8f93\u5165\u7684NUM2=<\/span>NUM2\"\n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u51fd\u6570\n<ul>\n<li>\u51fd\u6570\u4ecb\u7ecd<br \/>\nshell \u7f16\u7a0b\u548c\u5176\u5b83\u7f16\u7a0b\u8bed\u8a00\u4e00\u6837\uff0c\u6709\u7cfb\u7edf\u51fd\u6570\uff0c\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u51fd\u6570\u3002\u7cfb\u7edf\u51fd\u6570\u4e2d\uff0c\u6211\u4eec\u8fd9\u91cc\u5c31\u4ecb\u7ecd\u4e24\u4e2a\u3002<\/p>\n<\/li>\n<li>\n<p>\u7cfb\u7edf\u51fd\u6570<\/p>\n<p>basename \u57fa\u672c\u8bed\u6cd5<\/p>\n<p>\u529f\u80fd\uff1a\u8fd4\u56de\u5b8c\u6574\u8def\u5f84\u6700\u540e \/ \u7684\u90e8\u5206\uff0c\u5e38\u7528\u4e8e\u83b7\u53d6\u6587\u4ef6\u540d<\/p>\n<p>basename [pathname] [suffix]<\/p>\n<p>basename [string] [suffix]\uff08\u529f\u80fd\u63cf\u8ff0\uff1abasename \u547d\u4ee4\u4f1a\u5220\u6389\u6240\u6709\u7684\u524d\u7f00\u5305\u62ec\u6700\u540e\u4e00\u4e2a\uff08\u2018\/\u2019\uff09\u5b57\u7b26\uff0c\u7136\u540e\u5c06\u5b57\u7b26\u4e32\u663e\u793a\u51fa\u6765\u3002<\/p>\n<p>\u9009\u9879\uff1a<\/p>\n<p>suffix \u4e3a\u540e\u7f00\uff0c\u5982\u679c suffix \u88ab\u6307\u5b9a\u4e86\uff0cbasename \u4f1a\u5c06 pathname \u6216 string \u4e2d\u7684 suffix \u53bb\u6389\u3002<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a<\/p>\n<p>\u6848\u4f8b 1\uff1a\u8bf7\u8fd4\u56de \/home\/aaa\/test.txt \u7684 &#8220;test.txt&#8221; \u90e8\u5206<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# basename \/home\/aaa\/test.txt\ntest.txt\n\n<\/code><\/pre>\n<p>dirname \u57fa\u672c\u8bed\u6cd5<\/p>\n<p>\u529f\u80fd\uff1a\u8fd4\u56de\u5b8c\u6574\u8def\u5f84\u6700\u540e \/ \u7684\u524d\u9762\u7684\u90e8\u5206\uff0c\u5e38\u7528\u4e8e\u8fd4\u56de\u8def\u5f84\u90e8\u5206<\/p>\n<p>dirname \u6587\u4ef6\u7edd\u5bf9\u8def\u5f84 \uff08\u529f\u80fd\u63cf\u8ff0\uff1a\u4ece\u7ed9\u5b9a\u7684\u5305\u542b\u7edd\u5bf9\u8def\u5f84\u7684\u6587\u4ef6\u540d\u4e2d\u53bb\u9664\u6587\u4ef6\u540d\uff08\u975e\u76ee\u5f55\u7684\u90e8\u5206\uff09\uff0c\u7136\u540e\u8fd4\u56de\u5269\u4e0b\u7684\u8def\u5f84\uff08\u76ee\u5f55\u7684\u90e8\u5206\uff09\uff09<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b\uff1a<\/p>\n<p>\u6848\u4f8b 1\uff1a\u8bf7\u8fd4\u56de \/home\/aaa\/test.txt \u7684 \/home\/aaa<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# dirname \/home\/aaa\/test.txt\n\/home\/aaa\n\n<\/code><\/pre>\n<\/li>\n<li>\u81ea\u5b9a\u4e49\u51fd\u6570\n<p>\u57fa\u672c\u8bed\u6cd5<\/p>\n<p>[ function ] funname[()]<\/p>\n<p>{<\/p>\n<p>\u200b Action;<\/p>\n<p>\u200b [return int;]<\/p>\n<p>}<\/p>\n<p>\u8c03\u7528\u76f4\u63a5\u5199\u51fd\u6570\u540d\uff1afunname [\u503c]<\/p>\n<p>\u5e94\u7528\u5b9e\u4f8b<\/p>\n<p>\u6848\u4f8b 1\uff1a\u8ba1\u7b97\u8f93\u5165\u4e24\u4e2a\u53c2\u6570\u7684\u548c(\u52a8\u6001\u7684\u83b7\u53d6)\uff0c getSum<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim getSum.sh\n\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">#!\/bin\/bash\n#\u6848\u4f8b 1\uff1a\u8ba1\u7b97\u8f93\u5165\u4e24\u4e2a\u53c2\u6570\u7684\u548c(\u52a8\u6001\u7684\u83b7\u53d6)\uff0c getSum\n#\u5b9a\u4e49\u51fd\u6570 getSum\nfunction getSum(){\n\n      SUM=<span class=\"katex math inline\">[<\/span>n1+<span class=\"katex math inline\">n2]\n      echo \"\u548c\u5e02=<\/span>SUM\"\n}\n\n#\u8f93\u5165\u4e24\u4e2a\u503c\nread -p \"\u8bf7\u8f93\u5165\u4e00\u4e2a\u6570 n1=\" n1\nread -p \"\u8bf7\u8f93\u5165\u4e00\u4e2a\u6570 n2=\" n2\n#\u8c03\u7528\u81ea\u5b9a\u4e49\u51fd\u6570\ngetSum <span class=\"katex math inline\">n1<\/span>n2\n\n<\/code><\/pre>\n<\/li>\n<li>Shell \u7f16\u7a0b\u7efc\u5408\u6848\u4f8b\n<ul>\n<li>\u9700\u6c42\u5206\u6790<\/li>\n<\/ul>\n<p>1)\u6bcf\u5929\u51cc\u6668 2:30 \u5907\u4efd \u6570\u636e\u5e93 hspedu \u5230 \/data\/backup\/db<\/p>\n<p>2)\u5907\u4efd\u5f00\u59cb\u548c\u5907\u4efd\u7ed3\u675f\u80fd\u591f\u7ed9\u51fa\u76f8\u5e94\u7684\u63d0\u793a\u4fe1\u606f<\/p>\n<p>3)\u5907\u4efd\u540e\u7684\u6587\u4ef6\u8981\u6c42\u4ee5\u5907\u4efd\u65f6\u95f4\u4e3a\u6587\u4ef6\u540d\uff0c\u5e76\u6253\u5305\u6210 .tar.gz \u7684\u5f62\u5f0f\uff0c\u6bd4\u5982\uff1a2021-03-12_230201.tar.gz<\/p>\n<p>4)\u5728\u5907\u4efd\u7684\u540c\u65f6\uff0c\u68c0\u67e5\u662f\u5426\u6709 10 \u5929\u524d\u5907\u4efd\u7684\u6570\u636e\u5e93\u6587\u4ef6\uff0c\u5982\u679c\u6709\u5c31\u5c06\u5176\u5220\u9664\u3002<\/p>\n<ul>\n<li>\u4ee3\u7801 \/usr\/sbin\/mysql_db.backup.sh<\/li>\n<\/ul>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim \/usr\/sbin\/mysql_db.backup.sh\n\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">#!\/bin\/bash\n#\u5907\u4efd\u76ee\u5f55\nBACKUP=\/data\/backup\/db\n#\u5f53\u524d\u65f6\u95f4\nDATETIME=<span class=\"katex math inline\">(date +%Y-%m-%d_%H%M%S)\necho<\/span>DATETIME\n#\u6570\u636e\u5e93\u7684\u5730\u5740\nHOST=localhost\n#\u6570\u636e\u5e93\u7528\u6237\u540d\nDB_USER=root\n#\u6570\u636e\u5e93\u5bc6\u7801\nDB_PW=XXXXXX\n#\u5907\u4efd\u7684\u6570\u636e\u5e93\u540d\nDATABASE=my_secretary\n\n#\u521b\u5efa\u5907\u4efd\u76ee\u5f55\uff0c\u5982\u679c\u4e0d\u5b58\u5728\uff0c\u5c31\u521b\u5efa\n[ ! -d \"<span class=\"katex math inline\">{BACKUP}\/<\/span>{DATETIME}\" ] &amp;&amp; mkdir -p \"<span class=\"katex math inline\">{BACKUP}\/<\/span>{DATETIME}\"\n#\u5907\u4efd\u6570\u636e\u5e93\nmysqldump -u<span class=\"katex math inline\">{DB_USER} -p<\/span>{DB_PW} --host=<span class=\"katex math inline\">{HOST} -q -R --databases -B<\/span>{DATABASE} | gzip &gt; <span class=\"katex math inline\">{BACKUP}\/<\/span>{DATETIME}\/<span class=\"katex math inline\">DATETIME.sql.gz\n\n#\u5c06\u6587\u4ef6\u5904\u7406\u6210tar.gz\ncd<\/span>{BACKUP}\ntar -zcvf <span class=\"katex math inline\">DATETIME.tar.gz<\/span>{DATETIME}\n#\u5220\u9664\u5bf9\u5e94\u7684\u5907\u4efd\u76ee\u5f55\nrm -rf <span class=\"katex math inline\">{BACKUP}\/<\/span>{DATETIME}\n\n#\u5220\u966410\u5929\u524d\u7684\u5907\u4efd\u6587\u4ef6\nfind <span class=\"katex math inline\">{BACKUP} -atime +10 -name \"*.tar.gz\" -exec rm -rf {} \\;\necho \"\u5907\u4efd\u6570\u636e<\/span>{DATABASE}\u6210\u529f~\"\n\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u4e8c\u5341\u4e8c\u3001\u65e5\u5fd7\u7ba1\u7406<\/h3>\n<ol>\n<li>\u7cfb\u7edf\u5e38\u7528\u7684\u65e5\u5fd7\n<p>\/var\/log\/ \u76ee\u5f55\u5c31\u662f\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\u7684\u4fdd\u5b58\u4f4d\u7f6e\uff0c\u770b\u5f20\u56fe<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504104716108.png\" alt=\"image-20210504104716108\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504104806084.png\" alt=\"image-20210504104806084\" \/><\/p>\n<p>\u5e94\u7528\u6848\u4f8b\uff1a<\/p>\n<p>\u67e5\u770blastlog\u65e5\u5fd7\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 log]# ll lastlog\n-rw-r--r--. 1 root root 292876 5\u6708   4 10:52 lastlog\n[root@alanCentos01 log]# lastlog\n\u7528\u6237\u540d           \u7aef\u53e3     \u6765\u81ea             \u6700\u540e\u767b\u9646\u65f6\u95f4\nroot             pts\/0    192.168.18.1     \u4e8c 5\u6708  4 10:52:11 +0800 2021\nbin                                        **\u4ece\u672a\u767b\u5f55\u8fc7**\ndaemon                                     **\u4ece\u672a\u767b\u5f55\u8fc7**\nadm                                        **\u4ece\u672a\u767b\u5f55\u8fc7**\nlp                                         **\u4ece\u672a\u767b\u5f55\u8fc7**\nsync                                       **\u4ece\u672a\u767b\u5f55\u8fc7**\nshutdown                                   **\u4ece\u672a\u767b\u5f55\u8fc7**\nhalt                                       **\u4ece\u672a\u767b\u5f55\u8fc7**\nmail                                       **\u4ece\u672a\u767b\u5f55\u8fc7**\noperator                                   **\u4ece\u672a\u767b\u5f55\u8fc7**\ngames                                      **\u4ece\u672a\u767b\u5f55\u8fc7**\nftp                                        **\u4ece\u672a\u767b\u5f55\u8fc7**\nnobody                                     **\u4ece\u672a\u767b\u5f55\u8fc7**\nsystemd-network                            **\u4ece\u672a\u767b\u5f55\u8fc7**\ndbus                                       **\u4ece\u672a\u767b\u5f55\u8fc7**\npolkitd                                    **\u4ece\u672a\u767b\u5f55\u8fc7**\nlibstoragemgmt                             **\u4ece\u672a\u767b\u5f55\u8fc7**\ncolord                                     **\u4ece\u672a\u767b\u5f55\u8fc7**\nrpc                                        **\u4ece\u672a\u767b\u5f55\u8fc7**\ngluster                                    **\u4ece\u672a\u767b\u5f55\u8fc7**\nsaslauth                                   **\u4ece\u672a\u767b\u5f55\u8fc7**\nabrt                                       **\u4ece\u672a\u767b\u5f55\u8fc7**\nrtkit                                      **\u4ece\u672a\u767b\u5f55\u8fc7**\npulse                                      **\u4ece\u672a\u767b\u5f55\u8fc7**\nradvd                                      **\u4ece\u672a\u767b\u5f55\u8fc7**\nunbound                                    **\u4ece\u672a\u767b\u5f55\u8fc7**\nchrony                                     **\u4ece\u672a\u767b\u5f55\u8fc7**\nrpcuser                                    **\u4ece\u672a\u767b\u5f55\u8fc7**\nnfsnobody                                  **\u4ece\u672a\u767b\u5f55\u8fc7**\nqemu                                       **\u4ece\u672a\u767b\u5f55\u8fc7**\ntss                                        **\u4ece\u672a\u767b\u5f55\u8fc7**\nusbmuxd                                    **\u4ece\u672a\u767b\u5f55\u8fc7**\ngeoclue                                    **\u4ece\u672a\u767b\u5f55\u8fc7**\nntp                                        **\u4ece\u672a\u767b\u5f55\u8fc7**\nsssd                                       **\u4ece\u672a\u767b\u5f55\u8fc7**\nsetroubleshoot                             **\u4ece\u672a\u767b\u5f55\u8fc7**\nsaned                                      **\u4ece\u672a\u767b\u5f55\u8fc7**\ngdm              :0                        \u4e8c 5\u6708  4 10:51:31 +0800 2021\ngnome-initial-setup                           **\u4ece\u672a\u767b\u5f55\u8fc7**\nsshd                                       **\u4ece\u672a\u767b\u5f55\u8fc7**\navahi                                      **\u4ece\u672a\u767b\u5f55\u8fc7**\npostfix                                    **\u4ece\u672a\u767b\u5f55\u8fc7**\ntcpdump                                    **\u4ece\u672a\u767b\u5f55\u8fc7**\nalan             pts\/0                     \u4e8c 4\u6708  6 22:27:11 +0800 2021\nfox                                        **\u4ece\u672a\u767b\u5f55\u8fc7**\nzwj                                        **\u4ece\u672a\u767b\u5f55\u8fc7**\nmysql                                      **\u4ece\u672a\u767b\u5f55\u8fc7**\n[root@alanCentos01 log]# who\nroot     pts\/0        2021-05-04 10:52 (192.168.18.1)\n[root@alanCentos01 log]# \n\n<\/code><\/pre>\n<p>\u4f7f\u7528 root \u7528\u6237\u901a\u8fc7 xshell6 \u767b\u9646, \u7b2c\u4e00\u6b21\u4f7f\u7528\u9519\u8bef\u7684\u5bc6\u7801\uff0c\u7b2c\u4e8c\u6b21\u4f7f\u7528\u6b63\u786e\u7684\u5bc6\u7801\u767b\u5f55\u6210\u529f\u770b\u770b\u5728\u65e5\u5fd7\u6587\u4ef6\/var\/log\/secure \u91cc\u6709\u6ca1\u6709\u8bb0\u5f55\u76f8\u5173\u4fe1\u606f\u3002<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 log]# cat secure\nMay  4 00:42:07 alanCentos01 sshd[7983]: error: Received disconnect from 192.168.18.1 port 3448:0:\nMay  4 00:42:07 alanCentos01 sshd[7983]: Disconnected from 192.168.18.1 port 3448\nMay  4 00:42:07 alanCentos01 sshd[7983]: pam_unix(sshd:session): session closed for user root\nMay  4 10:51:21 alanCentos01 polkitd[6861]: Loading rules from directory \/etc\/polkit-1\/rules.d\nMay  4 10:51:21 alanCentos01 polkitd[6861]: Loading rules from directory \/usr\/share\/polkit-1\/rules.d\nMay  4 10:51:22 alanCentos01 polkitd[6861]: Finished loading, compiling and executing 10 rules\nMay  4 10:51:22 alanCentos01 polkitd[6861]: Acquired the name org.freedesktop.PolicyKit1 on the system bus\nMay  4 10:51:28 alanCentos01 sshd[7966]: Server listening on 0.0.0.0 port 22.\nMay  4 10:51:28 alanCentos01 sshd[7966]: Server listening on :: port 22.\nMay  4 10:51:31 alanCentos01 gdm-launch-environment]: pam_unix(gdm-launch-environment:session): session opened for user gdm by (uid=0)\nMay  4 10:51:34 alanCentos01 polkitd[6861]: Registered Authentication Agent for unix-session:c1 (system bus name :1.66 [\/usr\/bin\/gnome-shell], object path \/org\/freedesktop\/PolicyKit1\/AuthenticationAgent, locale zh_CN.UTF-8)\nMay  4 10:52:11 alanCentos01 sshd[8921]: Accepted password for root from 192.168.18.1 port 3020 ssh2\nMay  4 10:52:11 alanCentos01 sshd[8921]: pam_unix(sshd:session): session opened for user root by (uid=0)\n[root@alanCentos01 log]# \n\n<\/code><\/pre>\n<\/li>\n<li>\u65e5\u5fd7\u7ba1\u7406\u670d\u52a1rsyslogd<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u8bf4\u660e\uff1aCentOS7.6 \u65e5\u5fd7\u670d\u52a1\u662f rsyslogd \uff0c CentOS6.x \u65e5\u5fd7\u670d\u52a1\u662f syslogd \u3002rsyslogd \u529f\u80fd\u66f4\u5f3a\u5927\u3002rsyslogd \u7684\u4f7f\u7528\u3001\u65e5\u5fd7\u6587\u4ef6\u7684\u683c\u5f0f\uff0c\u548c syslogd \u670d\u52a1\u517c\u5bb9\u7684\u3002<\/p>\n<p>\u67e5\u8be2 Linux \u4e2d\u7684 rsyslogd \u670d\u52a1\u662f\u5426\u542f\u52a8<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\uff08grep -v\uff1a\u610f\u601d\u662f\u4e0d\u663e\u793a\u5339\u914d\u5230\u7684\u884c\uff09<\/span><\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 log]# ps aux | grep &quot;rsyslog&quot; | grep -v &quot;grep&quot;<br \/>\n root       7970  0.0  0.2 222748  4820 ?        Ssl  10:51   0:00 \/usr\/sbin\/rsyslogd -n<br \/>\n [root@alanCentos01 log]# <\/p>\n<p>&#8220;`<\/p>\n<p>\u67e5\u8be2 rsyslogd \u670d\u52a1\u7684\u81ea\u542f\u52a8\u72b6\u6001<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 log]# systemctl list-unit-files | grep rsyslog<br \/>\n rsyslog.service                               enabled<br \/>\n [root@alanCentos01 log]#<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6e\u6587\u4ef6\uff1a\/etc\/rsyslog.conf<\/p>\n<p>\u7f16\u8f91\u6587\u4ef6\u65f6\u7684\u683c\u5f0f\u4e3a\uff1a<em>.<\/em>\u5b58\u653e\u65e5\u5fd7\u6587\u4ef6<\/p>\n<p>\u5176\u4e2d\u7b2c\u4e00\u4e2a&#42;\u4ee3\u8868\u65e5\u5fd7\u7c7b\u578b\uff0c\u7b2c\u4e8c\u4e2a&#42;\u4ee3\u8868\u65e5\u5fd7\u7ea7\u522b<\/p>\n<p>1)\u65e5\u5fd7\u7c7b\u578b\u5206\u4e3a\uff1a<\/p>\n<p>auth   ##pam \u4ea7\u751f\u7684\u65e5\u5fd7<\/p>\n<p>authpriv   ##ssh\u3001ftp \u7b49\u767b\u5f55\u4fe1\u606f\u7684\u9a8c\u8bc1\u4fe1\u606f<\/p>\n<p>corn   ##\u65f6\u95f4\u4efb\u52a1\u76f8\u5173<\/p>\n<p>kern   ##\u5185\u6838<\/p>\n<p>lpr    ##\u6253\u5370<\/p>\n<p>mail   ##\u90ae\u4ef6<\/p>\n<p>mark(syslog)-rsyslog   ##\u670d\u52a1\u5185\u90e8\u7684\u4fe1\u606f\uff0c\u65f6\u95f4\u6807\u8bc6<\/p>\n<p>news   ##\u65b0\u95fb\u7ec4<\/p>\n<p>user   ##\u7528\u6237\u7a0b\u5e8f\u4ea7\u751f\u7684\u76f8\u5173\u4fe1\u606f<\/p>\n<p>uucp   ##unixtonuixcopy \u4e3b\u673a\u4e4b\u95f4\u76f8\u5173\u7684\u901a\u4fe1<\/p>\n<p>local1-7   ##\u81ea\u5b9a\u4e49\u7684\u65e5\u5fd7\u8bbe\u5907<\/p>\n<p>2)\u65e5\u5fd7\u7ea7\u522b\u5206\u4e3a\uff1a<\/p>\n<p>debug  ##\u6709\u8c03\u8bd5\u4fe1\u606f\u7684\uff0c\u65e5\u5fd7\u901a\u4fe1\u6700\u591a<\/p>\n<p>info   ##\u4e00\u822c\u4fe1\u606f\u65e5\u5fd7\uff0c\u6700\u5e38\u7528<\/p>\n<p>notice ##\u6700\u5177\u6709\u91cd\u8981\u6027\u7684\u666e\u901a\u6761\u4ef6\u7684\u4fe1\u606f<\/p>\n<p>warning    ##\u8b66\u544a\u7ea7\u522b<\/p>\n<p>err    ##\u9519\u8bef\u7ea7\u522b\uff0c\u963b\u6b62\u67d0\u4e2a\u529f\u80fd\u6216\u8005\u6a21\u5757\u4e0d\u80fd\u6b63\u5e38\u5de5\u4f5c\u7684\u4fe1\u606f<\/p>\n<p>crit   ##\u4e25\u91cd\u7ea7\u522b\uff0c\u963b\u6b62\u6574\u4e2a\u7cfb\u7edf\u6216\u8005\u6574\u4e2a\u8f6f\u4ef6\u4e0d\u80fd\u6b63\u5e38\u5de5\u4f5c\u7684\u4fe1\u606f<\/p>\n<p>alert  ##\u9700\u8981\u7acb\u523b\u4fee\u6539\u7684\u4fe1\u606f<\/p>\n<p>emerg  ##\u5185\u6838\u5d29\u6e83\u7b49\u91cd\u8981\u4fe1\u606f<\/p>\n<p>none   ##\u4ec0\u4e48\u90fd\u4e0d\u8bb0\u5f55<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f\uff1a\u4ece\u4e0a\u5230\u4e0b\uff0c\u7ea7\u522b\u4ece\u4f4e\u5230\u9ad8\uff0c\u8bb0\u5f55\u4fe1\u606f\u8d8a\u6765\u8d8a\u5c11<\/span><\/p>\n<\/li>\n<li>\n<p>\u7531\u65e5\u5fd7\u670d\u52a1 rsyslogd \u8bb0\u5f55\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u65e5\u5fd7\u6587\u4ef6\u7684\u683c\u5f0f\u5305\u542b\u4ee5\u4e0b 4 \u5217\uff1a<\/p>\n<p>1)\u4e8b\u4ef6\u4ea7\u751f\u7684\u65f6\u95f4<\/p>\n<p>2)\u4ea7\u751f\u4e8b\u4ef6\u7684\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d<\/p>\n<p>3)\u4ea7\u751f\u4e8b\u4ef6\u7684\u670d\u52a1\u540d\u6216\u7a0b\u5e8f\u540d<\/p>\n<p>4)\u4e8b\u4ef6\u7684\u5177\u4f53\u4fe1\u606f<\/p>\n<p>\u65e5\u5fd7\u5982\u4f55\u67e5\u770b\u5b9e\u4f8b<\/p>\n<p>\u67e5\u770b\u4e00\u4e0b \/var\/log\/secure \u65e5\u5fd7\uff0c\u8fd9\u4e2a\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u7684\u662f\u7528\u6237\u9a8c\u8bc1\u548c\u6388\u6743\u65b9\u9762\u7684\u4fe1\u606f \u6765\u5206\u6790\u5982\u4f55\u67e5\u770b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504115229775.png\" alt=\"image-20210504115229775\" \/><\/p>\n<p>\u65e5\u5fd7\u7ba1\u7406\u670d\u52a1\u5e94\u7528\u5b9e\u4f8b<\/p>\n<p>\u5728\/etc\/rsyslog.conf \u4e2d\u6dfb\u52a0\u4e00\u4e2a\u65e5\u5fd7\u6587\u4ef6\/var\/log\/hsp.log,\u5f53\u6709\u4e8b\u4ef6\u53d1\u9001\u65f6(\u6bd4\u5982 sshd \u670d\u52a1\u76f8\u5173\u4e8b\u4ef6)\uff0c\u8be5\u6587\u4ef6\u4f1a\u63a5\u6536\u5230\u4fe1\u606f\u5e76\u4fdd\u5b58\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504115848707.png\" alt=\"image-20210504115848707\" \/><\/p>\n<\/li>\n<\/ul>\n<ol start=\"3\">\n<li>\u65e5\u5fd7\u8f6e\u66ff<\/li>\n<\/ol>\n<ul>\n<li>\n<p>logrotate \u914d\u7f6e\u6587\u4ef6<\/p>\n<p>\/etc\/logrotate.conf \u4e3a logrotate \u7684\u5168\u5c40\u914d\u7f6e\u6587\u4ef6<\/p>\n<p># rotate log files weekly, \u6bcf\u5468\u5bf9\u65e5\u5fd7\u6587\u4ef6\u8fdb\u884c\u4e00\u6b21\u8f6e\u66ff<\/p>\n<p>weekly<\/p>\n<p># keep 4 weeks worth of backlogs, \u5171\u4fdd\u5b58 4 \u4efd\u65e5\u5fd7\u6587\u4ef6\uff0c\u5f53\u5efa\u7acb\u65b0\u7684\u65e5\u5fd7\u6587\u4ef6\u65f6\uff0c\u65e7\u7684\u5c06\u4f1a\u88ab\u5220\u9664<\/p>\n<p>rotate 4<\/p>\n<p># create new (empty) log files after rotating old ones, \u521b\u5efa\u65b0\u7684\u7a7a\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u5728\u65e5\u5fd7\u8f6e\u66ff\u540e<\/p>\n<p>create<\/p>\n<p># use date as a suffix of the rotated file, \u4f7f\u7528\u65e5\u671f\u4f5c\u4e3a\u65e5\u5fd7\u8f6e\u66ff\u6587\u4ef6\u7684\u540e\u7f00<\/p>\n<p>dateext<\/p>\n<p># uncomment this if you want your log files compressed, \u65e5\u5fd7\u6587\u4ef6\u662f\u5426\u538b\u7f29\u3002\u5982\u679c\u53d6\u6d88\u6ce8\u91ca\uff0c\u5219\u65e5\u5fd7\u4f1a\u5728\u8f6c\u50a8\u7684\u540c\u65f6\u8fdb\u884c\u538b\u7f29<\/p>\n<p>#compress<\/p>\n<p>#RPM packages drop log rotation information into this directory<\/p>\n<p>include \/etc\/logrotate.d<\/p>\n<p># \u5305\u542b \/etc\/logrotate.d\/ \u76ee\u5f55\u4e2d\u6240\u6709\u7684\u5b50\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u5c31 \u662f\u8bf4\u4f1a\u628a\u8fd9\u4e2a\u76ee\u5f55\u4e2d\u6240\u6709\u5b50\u914d\u7f6e\u6587\u4ef6\u8bfb\u53d6\u8fdb\u6765<\/p>\n<p>#\u4e0b\u9762\u662f\u5355\u72ec\u8bbe\u7f6e\uff0c\u4f18\u5148\u7ea7\u66f4\u9ad8\u3002<\/p>\n<p># no packages own wtmp and btmp &#8212; we&#8217;ll rotate them here<\/p>\n<p>\/var\/log\/wtmp {<\/p>\n<p>\u200b  monthly # \u6bcf\u6708\u5bf9\u65e5\u5fd7\u6587\u4ef6\u8fdb\u884c\u4e00\u6b21\u8f6e\u66ff<\/p>\n<p>\u200b  create 0664 root utmp # \u5efa\u7acb\u7684\u65b0\u65e5\u5fd7\u6587\u4ef6\uff0c\u6743\u9650\u662f 0664 \uff0c\u6240\u6709\u8005\u662f root \uff0c\u6240\u5c5e\u7ec4\u662f utmp \u7ec4<\/p>\n<p>\u200b  minsize 1M# \u65e5\u5fd7\u6587\u4ef6\u6700\u5c0f\u8f6e\u66ff\u5927\u5c0f\u662f 1MB \u3002\u4e5f\u5c31\u662f\u65e5\u5fd7\u4e00\u5b9a\u8981\u8d85\u8fc7 1MB \u624d\u4f1a\u8f6e\u66ff\uff0c\u5426\u5219\u5c31\u7b97\u65f6\u95f4\u8fbe\u5230\u4e00\u4e2a\u6708\uff0c\u4e5f\u4e0d\u8fdb\u884c\u65e5\u5fd7\u8f6c\u50a8<\/p>\n<p>\u200b  rotate 1 # \u4ec5\u4fdd\u7559\u4e00\u4e2a\u65e5\u5fd7\u5907\u4efd\u3002\u4e5f\u5c31\u662f\u53ea\u6709 wtmp \u548c wtmp.1 \u65e5\u5fd7\u4fdd\u7559\u800c\u5df2<br \/>\n }<br \/>\n \/var\/log\/btmp {<\/p>\n<p>\u200b  missingok # \u5982\u679c\u65e5\u5fd7\u4e0d\u5b58\u5728\uff0c\u5219\u5ffd\u7565\u8be5\u65e5\u5fd7\u7684\u8b66\u544a\u4fe1\u606f<\/p>\n<p>\u200b  monthly<\/p>\n<p>\u200b  create 0600 root utmp<\/p>\n<p>\u200b  rotate 1<br \/>\n }<\/p>\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<br \/>\n daily  \u65e5\u5fd7\u7684\u8f6e\u66ff\u5468\u671f\u662f\u6bcf\u5929<\/p>\n<p>weekly \u65e5\u5fd7\u7684\u8f6e\u66ff\u5468\u671f\u662f\u6bcf\u5468<\/p>\n<p>monthly    \u65e5\u5fd7\u7684\u8f6e\u66ff\u5468\u671f\u662f\u6bcf\u6708<\/p>\n<p>rotate \u6570\u5b57\u4fdd\u7559\u7684\u65e5\u5fd7\u6587\u4ef6\u7684\u4e2a\u6570\u30020 \u6307\u6ca1\u6709\u5907\u4efd<\/p>\n<p>compress   \u65e5\u5fd7\u8f6e\u66ff\u65f6\uff0c\u65e7\u7684\u65e5\u5fd7\u8fdb\u884c\u538b\u7f29<\/p>\n<p>create mode owner group    \u5efa\u7acb\u65b0\u65e5\u5fd7\uff0c\u540c\u65f6\u6307\u5b9a\u65b0\u65e5\u5fd7\u7684\u6743\u9650\u4e0e\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4\u3002<\/p>\n<p>mail address   \u5f53\u65e5\u5fd7\u8f6e\u66ff\u65f6\uff0c\u8f93\u51fa\u5185\u5bb9\u901a\u8fc7\u90ae\u4ef6\u53d1\u9001\u5230\u6307\u5b9a\u7684\u90ae\u4ef6\u5730\u5740\u3002<\/p>\n<p>missingok  \u5982\u679c\u65e5\u5fd7\u4e0d\u5b58\u5728\uff0c\u5219\u5ffd\u7565\u8be5\u65e5\u5fd7\u7684\u8b66\u544a\u4fe1\u606f<\/p>\n<p>notifempty \u5982\u679c\u65e5\u5fd7\u4e3a\u7a7a\u6587\u4ef6\uff0c\u5219\u4e0d\u8fdb\u884c\u65e5\u5fd7\u8f6e\u66ff<\/p>\n<p>minsize    \u5927\u5c0f\u65e5\u5fd7\u8f6e\u66ff\u7684\u6700\u5c0f\u503c\u3002\u4e5f\u5c31\u662f\u65e5\u5fd7\u4e00\u5b9a\u8981\u8fbe\u5230\u8fd9\u4e2a\u6700\u5c0f\u503c\u624d\u4f1a\u8f6e\u66ff\uff0c\u5426\u5219\u5c31\u7b97\u65f6\u95f4\u8fbe\u5230\u4e5f\u4e0d\u8f6e\u66ff<\/p>\n<p>size   \u5927\u5c0f\u65e5\u5fd7\u53ea\u6709\u5927\u4e8e\u6307\u5b9a\u5927\u5c0f\u624d\u8fdb\u884c\u65e5\u5fd7\u8f6e\u66ff\uff0c\u800c\u4e0d\u662f\u6309\u7167\u65f6\u95f4\u8f6e\u66ff\u3002<\/p>\n<p>dateext    \u4f7f\u7528\u65e5\u671f\u4f5c\u4e3a\u65e5\u5fd7\u8f6e\u66ff\u6587\u4ef6\u7684\u540e\u7f00\u3002<\/p>\n<p>sharedscripts  \u5728\u6b64\u5173\u952e\u5b57\u4e4b\u540e\u7684\u811a\u672c\u53ea\u6267\u884c\u4e00\u6b21\u3002<\/p>\n<p>prerotate\/endscript    \u5728\u65e5\u5fd7\u8f6e\u66ff\u4e4b\u524d\u6267\u884c\u811a\u672c\u547d\u4ee4\u3002<\/p>\n<p>postrotate\/endscript   \u5728\u65e5\u5fd7\u8f6e\u66ff\u4e4b\u540e\u6267\u884c\u811a\u672c\u547d\u4ee4\u3002<\/p>\n<\/li>\n<li>\n<p>\u628a\u81ea\u5df1\u7684\u65e5\u5fd7\u52a0\u5165\u65e5\u5fd7\u8f6e\u66ff<\/p>\n<p>1)\u7b2c\u4e00\u79cd\u65b9\u6cd5\u662f\u76f4\u63a5\u5728\/etc\/logrotate.conf \u914d\u7f6e\u6587\u4ef6\u4e2d\u5199\u5165\u8be5\u65e5\u5fd7\u7684\u8f6e\u66ff\u7b56\u7565<\/p>\n<p>2)\u7b2c\u4e8c\u79cd\u65b9\u6cd5\u662f\u5728\/etc\/logrotate.d\/\u76ee\u5f55\u4e2d\u65b0\u5efa\u7acb\u8be5\u65e5\u5fd7\u7684\u8f6e\u66ff\u6587\u4ef6\uff0c\u5728\u8be5\u8f6e\u66ff\u6587\u4ef6\u4e2d\u5199\u5165\u6b63\u786e\u7684\u8f6e\u66ff\u7b56\u7565\uff0c\u56e0\u4e3a\u8be5\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u90fd\u4f1a\u88ab\u201cinclude\u201d\u5230\u4e3b\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u6240\u4ee5\u4e5f\u53ef\u4ee5\u628a\u65e5\u5fd7\u52a0\u5165\u8f6e\u66ff\u3002<\/p>\n<p>3)\u63a8\u8350\u4f7f\u7528\u7b2c\u4e8c\u79cd\u65b9\u6cd5\u63a8\u8350\u4f7f\u7528\u7b2c\u4e8c\u79cd\u65b9\u6cd5\uff0c\u56e0\u4e3a\u7cfb\u7edf\u4e2d\u9700\u8981\u8f6e\u66ff\u7684\u65e5\u5fd7\u975e\u5e38\u591a\uff0c\u5982\u679c\u5168\u90fd\u76f4\u63a5\u5199 \u5165\/etc\/logrotate.conf \u914d\u7f6e\u6587\u4ef6\uff0c\u90a3\u4e48\u8fd9\u4e2a\u6587\u4ef6\u7684\u53ef\u7ba1\u7406\u6027\u5c31\u4f1a\u975e\u5e38\u5dee\uff0c\u4e0d\u5229\u4e8e\u6b64\u6587\u4ef6\u7684\u7ef4\u62a4\u3002<\/p>\n<p>4)\u5728\/etc\/logrotate.d\/ \u914d\u7f6e\u8f6e\u66ff\u6587\u4ef6\u4e00\u89c8<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504170724353.png\" alt=\"image-20210504170724353\" \/><\/p>\n<\/li>\n<li>\n<p>\u5e94\u7528\u5b9e\u4f8b<\/p>\n<p>\u770b\u4e00\u4e2a\u6848\u4f8b, \u5728\/etc\/logrotate.conf \u8fdb\u884c\u914d\u7f6e, \u6216\u8005\u76f4\u63a5\u5728 \/etc\/logrotate.d\/ \u4e0b\u521b\u5efa\u6587\u4ef6 hsplog \u7f16\u5199\u5982\u4e0b\u5185\u5bb9,\u5177\u4f53\u8f6e\u66ff\u7684\u6548\u679c \u53ef\u4ee5\u53c2\u8003 \/var\/log \u4e0b\u7684 boot.log \u60c5\u51b5\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504171000502-1620119425194.png\" alt=\"image-20210504171000502\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504170817788.png\" alt=\"image-20210504170817788\" \/><\/p>\n<\/li>\n<\/ul>\n<ol start=\"4\">\n<li>\n<p>\u65e5\u5fd7\u8f6e\u66ff\u673a\u5236\u539f\u7406<\/p>\n<p>\u65e5\u5fd7\u8f6e\u66ff\u4e4b\u6240\u4ee5\u53ef\u4ee5\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u5907\u4efd\u65e5\u5fd7\uff0c\u662f\u4f9d\u8d56\u7cfb\u7edf\u5b9a\u65f6\u4efb\u52a1\u3002\u5728 \/etc\/cron.daily\/\u76ee\u5f55\uff0c\u5c31\u4f1a\u53d1\u73b0\u8fd9\u4e2a\u76ee\u5f55\u4e2d\u662f\u6709 logrotate \u6587\u4ef6(\u53ef\u6267\u884c)\uff0clogrotate \u901a\u8fc7\u8fd9\u4e2a\u6587\u4ef6\u4f9d\u8d56\u5b9a\u65f6\u4efb\u52a1\u6267\u884c\u7684\u3002<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u5185\u5b58\u65e5\u5fd7<\/p>\n<p>journalctl   \u53ef\u4ee5\u67e5\u770b\u5185\u5b58\u65e5\u5fd7, \u8fd9\u91cc\u6211\u4eec\u770b\u770b\u5e38\u7528\u7684\u6307\u4ee4<\/p>\n<p>journalctl   ##\u67e5\u770b\u5168\u90e8<\/p>\n<p>journalctl-n 3   ##\u67e5\u770b\u6700\u65b0 3 \u6761<\/p>\n<p>journalctl&#8211;since 19:00&#8211;until 19:10:10  #\u67e5\u770b\u8d77\u59cb\u65f6\u95f4\u5230\u7ed3\u675f\u65f6\u95f4\u7684\u65e5\u5fd7\u53ef\u52a0\u65e5\u671f<\/p>\n<p>journalctl-p err ##\u62a5\u9519\u65e5\u5fd7<\/p>\n<p>journalctl-o verbose ##\u65e5\u5fd7\u8be6\u7ec6\u5185\u5bb9<\/p>\n<p>journalctl _PID=1245_COMM=sshd   ##\u67e5\u770b\u5305\u542b\u8fd9\u4e9b\u53c2\u6570\u7684\u65e5\u5fd7\uff08\u5728\u8be6\u7ec6\u65e5\u5fd7\u67e5\u770b\uff09<\/p>\n<p>\u6216\u8005 journalctl|grep sshd<\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u6ce8\u610f: journalctl\u67e5\u770b\u7684\u662f\u5185\u5b58\u65e5\u5fd7, \u91cd\u542f\u6e05\u7a7a<\/span><\/p>\n<p>\u6f14\u793a\u6848\u4f8b:<\/p>\n<p>\u4f7f\u7528journalctl|grep sshd\u6765\u770b\u770b\u7528\u6237\u767b\u5f55\u60c5\u51b5, \u91cd\u542f\u7cfb\u7edf\uff0c\u518d\u6b21\u67e5\u8be2\uff0c\u770b\u770b\u65e5\u5fd7\u6709\u4ec0\u4e48\u53d8\u5316\u6ca1\u6709<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# journalctl|grep sshd\n5\u6708 04 10:51:28 alanCentos01 sshd[7966]: Server listening on 0.0.0.0 port 22.\n5\u6708 04 10:51:28 alanCentos01 sshd[7966]: Server listening on :: port 22.\n5\u6708 04 10:52:11 alanCentos01 sshd[8921]: Accepted password for root from 192.168.18.1 port 3020 ssh2\n5\u6708 04 10:52:11 alanCentos01 sshd[8921]: pam_unix(sshd:session): session opened for user root by (uid=0)\n\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u4e8c\u5341\u4e09\u3001\u5b9a\u5236\u81ea\u5df1\u7684Linux\u7cfb\u7edf<\/h3>\n<ol>\n<li>\u57fa\u672c\u539f\u7406\n<p>\u542f\u52a8\u6d41\u7a0b\u4ecb\u7ecd\uff1a<\/p>\n<p>\u5236\u4f5c Linux \u5c0f\u7cfb\u7edf\u4e4b\u524d\uff0c\u518d\u4e86\u89e3\u4e00\u4e0b Linux \u7684\u542f\u52a8\u6d41\u7a0b\uff1a<\/p>\n<p>1\u3001\u9996\u5148 Linux \u8981\u901a\u8fc7\u81ea\u68c0\uff0c\u68c0\u67e5\u786c\u4ef6\u8bbe\u5907\u6709\u6ca1\u6709\u6545\u969c<\/p>\n<p>2\u3001\u5982\u679c\u6709\u591a\u5757\u542f\u52a8\u76d8\u7684\u8bdd\uff0c\u9700\u8981\u5728 BIOS \u4e2d\u9009\u62e9\u542f\u52a8\u78c1\u76d8<\/p>\n<p>3\u3001\u542f\u52a8 MBR \u4e2d\u7684 bootloader \u5f15\u5bfc\u7a0b\u5e8f<\/p>\n<p>4\u3001\u52a0\u8f7d\u5185\u6838\u6587\u4ef6<\/p>\n<p>5\u3001\u6267\u884c\u6240\u6709\u8fdb\u7a0b\u7684\u7236\u8fdb\u7a0b\u3001\u8001\u7956\u5b97 systemd<\/p>\n<p>6\u3001\u6b22\u8fce\u754c\u9762<\/p>\n<p>\u5728 Linux \u7684\u542f\u52a8\u6d41\u7a0b\u4e2d\uff0c\u52a0\u8f7d\u5185\u6838\u6587\u4ef6\u65f6\u5173\u952e\u6587\u4ef6\uff1a<\/p>\n<p>1\uff09kernel \u6587\u4ef6:vmlinuz-3.10.0-957.el7.x86_64<\/p>\n<p>2\uff09initrd \u6587\u4ef6: initramfs-3.10.0-957.el7.x86_64.img<\/p>\n<\/li>\n<li>\n<p>\u5236\u4f5c min linux \u601d\u8def\u5206\u6790<\/p>\n<p>1)\u5728\u73b0\u6709\u7684 Linux \u7cfb\u7edf(centos7.6)\u4e0a\u52a0\u4e00\u5757\u786c\u76d8\/dev\/sdb\uff0c\u5728\u786c\u76d8\u4e0a\u5206\u4e24\u4e2a\u5206\u533a\uff0c\u4e00\u4e2a\u662f\/boot\uff0c\u4e00\u4e2a\u662f\/\uff0c\u5e76\u5c06\u5176\u683c\u5f0f\u5316\u3002\u9700\u8981\u660e\u786e\u7684\u662f\uff0c\u73b0\u5728\u52a0\u7684\u8fd9\u4e2a\u786c\u76d8\u5728\u73b0\u6709\u7684 Linux \u7cfb\u7edf\u4e2d\u662f\/dev\/sdb\uff0c\u4f46\u662f\uff0c\u5f53\u6211\u4eec\u628a\u4e1c\u897f\u5168\u90e8\u8bbe\u7f6e\u597d\u65f6\uff0c\u8981\u628a\u8fd9\u4e2a\u786c\u76d8\u62d4\u9664\uff0c\u653e\u5728\u65b0\u7cfb\u7edf\u4e0a\uff0c\u6b64\u65f6\uff0c\u5c31\u662f\/dev\/sda<\/p>\n<p>2)\u5728\/dev\/sdb \u786c\u76d8\u4e0a\uff0c\u5c06\u5176\u6253\u9020\u6210\u72ec\u7acb\u7684 Linux \u7cfb\u7edf\uff0c\u91cc\u9762\u7684\u6240\u6709\u6587\u4ef6\u662f\u9700\u8981\u62f7\u8d1d\u8fdb\u53bb\u7684<\/p>\n<p>3)\u4f5c\u4e3a\u80fd\u72ec\u7acb\u8fd0\u884c\u7684 Linux \u7cfb\u7edf\uff0c\u5185\u6838\u662f\u4e00\u5b9a\u4e0d\u80fd\u5c11\uff0c\u8981\u628a\u5185\u6838\u6587\u4ef6\u548c initramfs \u6587\u4ef6\u4e5f\u4e00\u8d77\u62f7\u5230\/dev\/sdb \u4e0a<\/p>\n<p>4)\u4ee5\u4e0a\u6b65\u9aa4\u5b8c\u6210\uff0c\u6211\u4eec\u7684\u81ea\u5236 Linux \u5c31\u5b8c\u6210, \u521b\u5efa\u4e00\u4e2a\u65b0\u7684 linux \u865a\u62df\u673a\uff0c\u5c06\u5176\u786c\u76d8\u6307\u5411\u6211\u4eec\u521b\u5efa\u7684\u786c\u76d8\uff0c\u542f\u52a8\u5373\u53ef<\/p>\n<\/li>\n<li>\n<p>\u64cd\u4f5c\u6b65\u9aa4<\/p>\n<p>1)\u9996\u5148\uff0c\u6211\u4eec\u5728\u73b0\u6709\u7684linux\u6dfb\u52a0\u4e00\u5757\u5927\u5c0f\u4e3a20G\u7684\u786c\u76d8<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504181424926.png\" alt=\"image-20210504181424926\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504182327684.png\" alt=\"image-20210504182327684\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504182351909.png\" alt=\"image-20210504182351909\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504182415423.png\" alt=\"image-20210504182415423\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504182446836.png\" alt=\"image-20210504182446836\" \/><\/p>\n<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504182801762.png\" alt=\"image-20210504182801762\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504182855427.png\" alt=\"image-20210504182855427\" \/><\/p>\n<p>\u70b9\u51fb\u5b8c\u6210\uff0c\u5c31OK\u4e86\uff0c \u53ef\u4ee5\u4f7f\u7528 lsblk \u67e5\u770b<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\uff08\u9700\u8981\u91cd\u542f\uff09\u3002<\/span><\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# lsblk\nNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT\nsda      8:0    0   20G  0 disk \n\u251c\u2500sda1   8:1    0    1G  0 part \/boot\n\u251c\u2500sda2   8:2    0    2G  0 part [SWAP]\n\u2514\u2500sda3   8:3    0   17G  0 part \/\nsdb      8:16   0   20G  0 disk \nsr0     11:0    1  4.3G  0 rom  \/run\/media\/root\/CentOS 7 x86_64\n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<p>2)\u901a\u8fc7fdisk\u6765\u7ed9\u6211\u4eec\u7684\/dev\/sdb\u8fdb\u884c\u5206\u533a<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# fdisk \/dev\/sdb\n\u6b22\u8fce\u4f7f\u7528 fdisk (util-linux 2.23.2)\u3002\n\n\u66f4\u6539\u5c06\u505c\u7559\u5728\u5185\u5b58\u4e2d\uff0c\u76f4\u5230\u60a8\u51b3\u5b9a\u5c06\u66f4\u6539\u5199\u5165\u78c1\u76d8\u3002\n\u4f7f\u7528\u5199\u5165\u547d\u4ee4\u524d\u8bf7\u4e09\u601d\u3002\n\nDevice does not contain a recognized partition table\n\u4f7f\u7528\u78c1\u76d8\u6807\u8bc6\u7b26 0x25f4a8e6 \u521b\u5efa\u65b0\u7684 DOS \u78c1\u76d8\u6807\u7b7e\u3002\n\n\u547d\u4ee4(\u8f93\u5165 m \u83b7\u53d6\u5e2e\u52a9)\uff1an\nPartition type:\n   p   primary (0 primary, 0 extended, 4 free)\n   e   extended\nSelect (default p): p\n\u5206\u533a\u53f7 (1-4\uff0c\u9ed8\u8ba4 1)\uff1a\n\u8d77\u59cb \u6247\u533a (2048-41943039\uff0c\u9ed8\u8ba4\u4e3a 2048)\uff1a\n\u5c06\u4f7f\u7528\u9ed8\u8ba4\u503c 2048\nLast \u6247\u533a, +\u6247\u533a or +size{K,M,G} (2048-41943039\uff0c\u9ed8\u8ba4\u4e3a 41943039)\uff1a+500M\n\u5206\u533a 1 \u5df2\u8bbe\u7f6e\u4e3a Linux \u7c7b\u578b\uff0c\u5927\u5c0f\u8bbe\u4e3a 500 MiB\n\n\u547d\u4ee4(\u8f93\u5165 m \u83b7\u53d6\u5e2e\u52a9)\uff1an\nPartition type:\n   p   primary (1 primary, 0 extended, 3 free)\n   e   extended\nSelect (default p): \nUsing default response p\n\u5206\u533a\u53f7 (2-4\uff0c\u9ed8\u8ba4 2)\uff1a\n\u8d77\u59cb \u6247\u533a (1026048-41943039\uff0c\u9ed8\u8ba4\u4e3a 1026048)\uff1a\n\u5c06\u4f7f\u7528\u9ed8\u8ba4\u503c 1026048\nLast \u6247\u533a, +\u6247\u533a or +size{K,M,G} (1026048-41943039\uff0c\u9ed8\u8ba4\u4e3a 41943039)\uff1a\n\u5c06\u4f7f\u7528\u9ed8\u8ba4\u503c 41943039\n\u5206\u533a 2 \u5df2\u8bbe\u7f6e\u4e3a Linux \u7c7b\u578b\uff0c\u5927\u5c0f\u8bbe\u4e3a 19.5 GiB\n\n\u547d\u4ee4(\u8f93\u5165 m \u83b7\u53d6\u5e2e\u52a9)\uff1aw\nThe partition table has been altered!\n\nCalling ioctl() to re-read partition table.\n\u6b63\u5728\u540c\u6b65\u78c1\u76d8\u3002\n\n<\/code><\/pre>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# lsblk\nNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT\nsda      8:0    0   20G  0 disk \n\u251c\u2500sda1   8:1    0    1G  0 part \/boot\n\u251c\u2500sda2   8:2    0    2G  0 part [SWAP]\n\u2514\u2500sda3   8:3    0   17G  0 part \/\nsdb      8:16   0   20G  0 disk \n\u251c\u2500sdb1   8:17   0  500M  0 part \n\u2514\u2500sdb2   8:18   0 19.5G  0 part \nsr0     11:0    1  4.3G  0 rom  \/run\/media\/root\/CentOS 7 x86_64\n\n<\/code><\/pre>\n<p>3)\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5bf9\/dev\/sdb\u7684\u5206\u533a\u8fdb\u884c\u683c\u5f0f\u5316<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# mkfs.ext4 \/dev\/sdb1\nmke2fs 1.42.9 (28-Dec-2013)\n\u6587\u4ef6\u7cfb\u7edf\u6807\u7b7e=\nOS type: Linux\n\u5757\u5927\u5c0f=1024 (log=0)\n\u5206\u5757\u5927\u5c0f=1024 (log=0)\nStride=0 blocks, Stripe width=0 blocks\n128016 inodes, 512000 blocks\n25600 blocks (5.00%) reserved for the super user\n\u7b2c\u4e00\u4e2a\u6570\u636e\u5757=1\nMaximum filesystem blocks=34078720\n63 block groups\n8192 blocks per group, 8192 fragments per group\n2032 inodes per group\nSuperblock backups stored on blocks: \n    8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409\n\nAllocating group tables: \u5b8c\u6210                            \n\u6b63\u5728\u5199\u5165inode\u8868: \u5b8c\u6210                            \nCreating journal (8192 blocks): \u5b8c\u6210\nWriting superblocks and filesystem accounting information: \u5b8c\u6210\n\n[root@alanCentos01 ~]# mkfs.ext4 \/dev\/sdb2\nmke2fs 1.42.9 (28-Dec-2013)\n\u6587\u4ef6\u7cfb\u7edf\u6807\u7b7e=\nOS type: Linux\n\u5757\u5927\u5c0f=4096 (log=2)\n\u5206\u5757\u5927\u5c0f=4096 (log=2)\nStride=0 blocks, Stripe width=0 blocks\n1281120 inodes, 5114624 blocks\n255731 blocks (5.00%) reserved for the super user\n\u7b2c\u4e00\u4e2a\u6570\u636e\u5757=0\nMaximum filesystem blocks=2153775104\n157 block groups\n32768 blocks per group, 32768 fragments per group\n8160 inodes per group\nSuperblock backups stored on blocks: \n    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, \n    4096000\n\nAllocating group tables: \u5b8c\u6210                            \n\u6b63\u5728\u5199\u5165inode\u8868: \u5b8c\u6210                            \nCreating journal (32768 blocks): \u5b8c\u6210\nWriting superblocks and filesystem accounting information: \u5b8c\u6210   \n\n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<p>4)\u521b\u5efa\u76ee\u5f55\uff0c\u5e76\u6302\u8f7d\u65b0\u7684\u78c1\u76d8<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# mkdir -p \/mnt\/boot \/mnt\/sysroot\n[root@alanCentos01 ~]# mount \/dev\/sdb1 \/mnt\/boot\n[root@alanCentos01 ~]# mount \/dev\/sdb2 \/mnt\/sysroot\/\n[root@alanCentos01 ~]#\n\n<\/code><\/pre>\n<p>5)\u5b89\u88c5grub, \u5185\u6838\u6587\u4ef6\u62f7\u8d1d\u81f3\u76ee\u6807\u78c1\u76d8<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# grub2-install --root-directory=\/mnt \/dev\/sdb\nInstalling for i386-pc platform.\nInstallation finished. No error reported.\n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<p>\u6211\u4eec\u53ef\u4ee5\u6765\u770b\u4e00\u4e0b\u4e8c\u8fdb\u5236\u786e\u8ba4\u6211\u4eec\u662f\u5426\u5b89\u88c5\u6210\u529f<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# hexdump -C -n 512 \/dev\/sdb\n00000000  eb 63 90 00 00 00 00 00  00 00 00 00 00 00 00 00  |.c..............|\n00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n*\n00000050  00 00 00 00 00 00 00 00  00 00 00 80 01 00 00 00  |................|\n00000060  00 00 00 00 ff fa 90 90  f6 c2 80 74 05 f6 c2 70  |...........t...p|\n00000070  74 02 b2 80 ea 79 7c 00  00 31 c0 8e d8 8e d0 bc  |t....y|..1......|\n00000080  00 20 fb a0 64 7c 3c ff  74 02 88 c2 52 be 05 7c  |. ..d|&lt;.t...R..||\n00000090  b4 41 bb aa 55 cd 13 5a  52 72 3d 81 fb 55 aa 75  |.A..U..ZRr=..U.u|\n000000a0  37 83 e1 01 74 32 31 c0  89 44 04 40 88 44 ff 89  |7...t21..D.@.D..|\n000000b0  44 02 c7 04 10 00 66 8b  1e 5c 7c 66 89 5c 08 66  |D.....f..\\|f.\\.f|\n000000c0  8b 1e 60 7c 66 89 5c 0c  c7 44 06 00 70 b4 42 cd  |..`|f.\\..D..p.B.|\n000000d0  13 72 05 bb 00 70 eb 76  b4 08 cd 13 73 0d 5a 84  |.r...p.v....s.Z.|\n000000e0  d2 0f 83 de 00 be 85 7d  e9 82 00 66 0f b6 c6 88  |.......}...f....|\n000000f0  64 ff 40 66 89 44 04 0f  b6 d1 c1 e2 02 88 e8 88  |d.@f.D..........|\n00000100  f4 40 89 44 08 0f b6 c2  c0 e8 02 66 89 04 66 a1  |.@.D.......f..f.|\n00000110  60 7c 66 09 c0 75 4e 66  a1 5c 7c 66 31 d2 66 f7  |`|f..uNf.\\|f1.f.|\n00000120  34 88 d1 31 d2 66 f7 74  04 3b 44 08 7d 37 fe c1  |4..1.f.t.;D.}7..|\n00000130  88 c5 30 c0 c1 e8 02 08  c1 88 d0 5a 88 c6 bb 00  |..0........Z....|\n00000140  70 8e c3 31 db b8 01 02  cd 13 72 1e 8c c3 60 1e  |p..1......r...`.|\n00000150  b9 00 01 8e db 31 f6 bf  00 80 8e c6 fc f3 a5 1f  |.....1..........|\n00000160  61 ff 26 5a 7c be 80 7d  eb 03 be 8f 7d e8 34 00  |a.&amp;Z|..}....}.4.|\n00000170  be 94 7d e8 2e 00 cd 18  eb fe 47 52 55 42 20 00  |..}.......GRUB .|\n00000180  47 65 6f 6d 00 48 61 72  64 20 44 69 73 6b 00 52  |Geom.Hard Disk.R|\n00000190  65 61 64 00 20 45 72 72  6f 72 0d 0a 00 bb 01 00  |ead. Error......|\n000001a0  b4 0e cd 10 ac 3c 00 75  f4 c3 00 00 00 00 00 00  |.....&lt;.u........|\n000001b0  00 00 00 00 00 00 00 00  a1 3c d3 39 00 00 00 20  |.........&lt;.9... |\n000001c0  21 00 83 dd 1e 3f 00 08  00 00 00 a0 0f 00 00 dd  |!....?..........|\n000001d0  1f 3f 83 d4 a2 32 00 a8  0f 00 00 58 70 02 00 00  |.?...2.....Xp...|\n000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|\n00000200\n[root@alanCentos01 ~]#\n\n<\/code><\/pre>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# rm -rf \/mnt\/boot\/*\n[root@alanCentos01 ~]# cp -rf \/boot\/*  \/mnt\/boot\/\n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<p>6)\u4fee\u6539 \/mnt\/boot\/grub2\/grub.cfg \u6587\u4ef6, \u6807\u7ea2\u7684\u90e8\u5206 \u662f\u9700\u8981\u4f7f\u7528 \u6307\u4ee4\u6765\u67e5\u770b\u7684<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504213359791.png\" alt=\"image-20210504213359791\" \/><\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 grub2]# vim \/mnt\/boot\/grub2\/grub.cfg\n\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">### BEGIN \/etc\/grub.d\/10_linux ###\nmenuentry 'CentOS Linux (3.10.0-957.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted <span class=\"katex math inline\">menuentry_id_option 'gnulinux-3.10.0-957.el7.x86_64-advanced-2eef594e-68fc-49a0-8b23-07cf87dda424' {\n    load_video\n    set gfxpayload=keep\n    insmod gzio\n    insmod part_msdos\n    insmod ext2\n    set root='hd0,msdos1'\n    if [ x<\/span>feature_platform_search_hint = xy ]; then\n      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1\n--hint='hd0,msdos1'  6ba72e9a-19ec-4552-ae54-e35e735142d4\n    else\n      search --no-floppy --fs-uuid --set=root 6ba72e9a-19ec-4552-ae54-e35e735142d4\n    fi\n    linux16 \/vmlinuz-3.10.0-957.el7.x86_64 root=UUID=d2e0ce0f-e209-472a-a4f1-4085f777d9bb ro crashkernel=auto rhgb quiet LANG=zh_CN.UTF-8  selinux=0 init=\/bin\/bash\n    initrd16 \/initramfs-3.10.0-957.el7.x86_64.img\n}\nmenuentry 'CentOS Linux (0-rescue-5bd4fb8d8e9d4198983fc1344f652b5d) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted <span class=\"katex math inline\">menuentry_id_option 'gnulinux-0-rescue-5bd4fb8d8e9d4198983fc1344f652b5d-advanced-2eef594e-68fc-49a0-8b23-07cf87dda424' {\n    load_video\n    insmod gzio\n    insmod part_msdos\n    insmod ext2\n    set root='hd0,msdos1'\n    if [ x<\/span>feature_platform_search_hint = xy ]; then\n      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  6ba72e9a-19ec-4552-ae54-e35e735142d4\n    else\n      search --no-floppy --fs-uuid --set=root 6ba72e9a-19ec-4552-ae54-e35e735142d4\n    fi\n    linux16 \/vmlinuz-0-rescue-5bd4fb8d8e9d4198983fc1344f652b5d root=UUID=d2e0ce0f-e209-472a-a4f1-4085f777d9bb ro crashkernel=auto rhgb quiet selinux=0 init=\/bin\/bash\n    initrd16 \/initramfs-0-rescue-5bd4fb8d8e9d4198983fc1344f652b5d.img\n}\n\n### END \/etc\/grub.d\/10_linux ###      \n\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504214347206.png\" alt=\"image-20210504214347206\" \/><\/p>\n<p><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u5728grub.cfg\u6587\u4ef6\u4e2d , \u7ea2\u8272\u90e8\u5206\u7528 \u4e0a\u9762 sdb1 \u7684 UUID\u66ff\u6362\uff0c\u84dd\u8272\u90e8\u5206\u7528 sdb2\u7684UUID\u6765\u66ff\u6362, \u7d2b\u8272\u90e8\u5206\u662f\u6dfb\u52a0\u7684\uff0c\u8868\u793aselinux\u7ed9\u5173\u6389\uff0c\u540c\u65f6\u8bbe\u5b9a\u4e00\u4e0binit\uff0c\u544a\u8bc9\u5185\u6838\u4e0d\u8981\u518d\u53bb\u627e\u8fd9\u4e2a\u7a0b\u5e8f\u4e86\uff0c\u4e0d\u7136\u5f00\u673a\u7684\u65f6\u5019\u4f1a\u51fa\u73b0\u9519\u8bef\u7684<\/span><\/p>\n<p>7)\u521b\u5efa\u76ee\u6807\u4e3b\u673a\u6839\u6587\u4ef6\u7cfb\u7edf<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 grub2]# mkdir -pv \/mnt\/sysroot\/{etc\/rc.d,usr,var,proc,sys,dev,lib,lib64,bin,sbin,boot,srv,mnt,media,home,root} \nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/etc\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/etc\/rc.d\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/usr\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/var\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/proc\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/sys\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/dev\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/lib\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/lib64\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/bin\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/sbin\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/boot\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/srv\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/mnt\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/media\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/home\"\nmkdir: \u5df2\u521b\u5efa\u76ee\u5f55 \"\/mnt\/sysroot\/root\"\n[root@alanCentos01 grub2]#\n\n<\/code><\/pre>\n<p>8)\u62f7\u8d1d\u9700\u8981\u7684bash(\u4e5f\u53ef\u4ee5\u62f7\u8d1d\u4f60\u9700\u8981\u7684\u6307\u4ee4)\u548c\u5e93\u6587\u4ef6\u7ed9\u65b0\u7684\u7cfb\u7edf\u4f7f\u7528<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 \/]# cp \/lib64\/*.* \/mnt\/sysroot\/lib64\/\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/db4.7.25\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/dleyna-1.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/farstream-0.1\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/farstream-0.2\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/gdk-pixbuf-2.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/girepository-1.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/gnome-settings-daemon-3.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/goa-1.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/grilo-0.3\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/gstreamer-0.10\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/gstreamer-1.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/gtk-2.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/gtk-3.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/libcanberra-0.30\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/libpeas-1.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/mission-control-plugins.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/pulse-10.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/python2.7\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/tracker-1.0\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/vte-2.91\"\ncp: \u7565\u8fc7\u76ee\u5f55\"\/lib64\/webkit2gtk-4.0\"\n[root@alanCentos01 \/]# cp \/bin\/bash \/mnt\/sysroot\/bin\/\n[root@alanCentos01 \/]# \n\n9)\u73b0\u5728\u6211\u4eec\u5c31\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u673a\uff0c\u7136\u540e\u5c06\u9ed8\u8ba4\u5206\u914d\u7684\u786c\u76d8\u79fb\u9664\u6389\uff0c\u6307\u5411\u6211\u4eec\u521a\u521a\u521b\u5efa\u7684\u78c1\u76d8\u5373\u53ef\u3002\n\n![image-20210504222142208](https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504222142208.png)\n\n![image-20210504222200353](https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504222200353.png)\n\n![image-20210504222218487](https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504222218487.png)\n\n![image-20210504222231436](https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504222231436.png)\n\n![image-20210504222246288](https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504222246288.png)\n\n![image-20210504222254540](https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504222254540.png)\n\n![image-20210504222304854](https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504222304854.png)\n\n![image-20210504222511888](https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504222511888.png)\n\n![image-20210504222709074](https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504222709074.png)\n\n10)\u8fd9\u65f6\uff0c\u5f88\u591a\u6307\u4ee4\u90fd\u4e0d\u80fd\u4f7f\u7528\uff0c\u6bd4\u5982 ls , reboot \u7b49\uff0c\u53ef\u4ee5\u5c06\u9700\u8981\u7684\u6307\u4ee4\u62f7\u8d1d\u5230\u5bf9\u5e94\u7684\u76ee\u5f55\u5373\u53ef\n\n11)\u5982\u679c\u8981\u62f7\u8d1d\u6307\u4ee4\uff0c\u91cd\u65b0\u8fdb\u5165\u5230\u539f\u6765\u7684 linux\u7cfb\u7edf\u62f7\u8d1d\u76f8\u5e94\u7684\u6307\u4ee4\u5373\u53ef\uff0c\u6bd4\u8f83\u5c06 \/bin\/ls \u62f7\u8d1d\u5230 \/mnt\/sysroot\/bin  \u5c06\/sbin\/reboot \u62f7\u8d1d\u5230 \/mnt\/sysroot\/sbin\n\n\u200b```bash\n[root@alanCentos01 ~]# mount \/dev\/sdb2 \/mnt\/sysroot\/\n[root@alanCentos01 \/]# cp \/bin\/ls \/mnt\/sysroot\/bin\/\n[root@alanCentos01 \/]# cp \/bin\/systemctl  \/mnt\/sysroot\/bin\/\n[root@alanCentos01 \/]# cp \/sbin\/reboot \/mnt\/sysroot\/sbin\/\n[root@alanCentos01 \/]#\n\n<\/code><\/pre>\n<p>12)\u518d\u91cd\u65b0\u542f\u52a8\u65b0\u7684min linux\u7cfb\u7edf\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528 ls , reboot \u6307\u4ee4\u4e86<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210504224204801.png\" alt=\"image-20210504224204801\" \/><\/p>\n<h3>\u4e8c\u5341\u56db\u3001linux\u5185\u6838\u5347\u7ea7<\/h3>\n<p>uname -a \/\/\u67e5\u770b\u5f53\u524d\u7684\u5185\u6838\u7248\u672c<\/p>\n<p>yum info kernel -q \/\/\u68c0\u6d4b\u5185\u6838\u7248\u672c\uff0c\u663e\u793a\u53ef\u4ee5\u5347\u7ea7\u7684\u5185\u6838<\/p>\n<p>yum update kernel \/\/\u5347\u7ea7\u5185\u6838<\/p>\n<p>yum list kernel -q \/\/\u67e5\u770b\u5df2\u7ecf\u5b89\u88c5\u7684\u5185\u6838<\/p>\n<h3>\u4e8c\u5341\u4e94\u3001linux\u7cfb\u7edf-\u5907\u4efd\u4e0e\u6062\u590d<\/h3>\n<ol>\n<li>\u57fa\u672c\u4ecb\u7ecd\n<p>\u5b9e\u4f53\u673a\u65e0\u6cd5\u505a\u5feb\u7167\uff0c\u5982\u679c\u7cfb\u7edf\u51fa\u73b0\u5f02\u5e38\u6216\u8005\u6570\u636e\u635f\u574f\uff0c\u540e\u679c\u4e25\u91cd\uff0c \u8981\u91cd\u505a\u7cfb\u7edf\uff0c\u8fd8\u4f1a\u9020\u6210\u6570\u636e\u4e22\u5931\u3002\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5907\u4efd\u548c\u6062\u590d\u6280\u672f\u3002<\/p>\n<p>linux \u7684\u5907\u4efd\u548c\u6062\u590d\u5f88\u7b80\u5355 \uff0c\u6709\u4e24\u79cd\u65b9\u5f0f\uff1a<\/p>\n<p>1)\u628a\u9700\u8981\u7684\u6587\u4ef6(\u6216\u8005\u5206\u533a)\u7528 TAR \u6253\u5305\u5c31\u884c\uff0c\u4e0b\u6b21\u9700\u8981\u6062\u590d\u7684\u65f6\u5019\uff0c\u518d\u89e3\u538b\u5f00\u8986\u76d6\u5373\u53ef<\/p>\n<p>2)\u4f7f\u7528 dump \u548c restore \u547d\u4ee4<\/p>\n<\/li>\n<li>\n<p>\u5b89\u88c5 dump \u548c restore<\/p>\n<p>\u5982\u679c linux \u4e0a\u6ca1\u6709 dump \u548c restore \u6307\u4ee4\uff0c\u9700\u8981\u5148\u6309\u7167<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\uff08\u5b89\u88c5\u597d\u4e86dump\uff0c\u4e00\u822crestore\u4e5f\u4f1a\u81ea\u52a8\u5b89\u88c5\u597d\uff09<\/span><\/p>\n<p>yum -y install dump<\/p>\n<p>yum -y install restore<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528 dump \u5b8c\u6210\u5907\u4efd<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u57fa\u672c\u4ecb\u7ecd<\/p>\n<p>dump \u652f\u6301\u5206\u5377\u548c\u589e\u91cf\u5907\u4efd\uff08\u6240\u8c13\u589e\u91cf\u5907\u4efd\u662f\u6307\u5907\u4efd\u4e0a\u6b21\u5907\u4efd\u540e \u4fee\u6539\/\u589e\u52a0\u8fc7\u7684\u6587\u4ef6\uff0c\u4e5f\u79f0\u5dee\u5f02\u5907\u4efd\uff09\u3002<\/p>\n<\/li>\n<li>\n<p>dump \u8bed\u6cd5\u8bf4\u660e<\/p>\n<p>dump &#91; -cu] &#91;-123456789] &#91; -f &lt;\u5907\u4efd\u540e\u6587\u4ef6\u540d>] &#91;-T &lt;\u65e5\u671f>] &#91; \u76ee\u5f55\u6216\u6587\u4ef6\u7cfb\u7edf]<\/p>\n<p>dump [] -wW<\/p>\n<p>-c \uff1a\u521b\u5efa\u65b0\u7684\u5f52\u6863\u6587\u4ef6\uff0c\u5e76\u5c06\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u6587\u4ef6\u53c2\u6570\u6240\u6307\u5b9a\u7684\u5185\u5bb9\u5199\u5165\u5f52\u6863\u6587\u4ef6\u7684\u5f00\u5934\u3002<\/p>\n<p>-0123456789\uff1a\u5907\u4efd\u7684\u5c42\u7ea7\u30020 \u4e3a\u6700\u5b8c\u6574\u5907\u4efd\uff0c\u4f1a\u5907\u4efd\u6240\u6709\u6587\u4ef6\u3002\u82e5\u6307\u5b9a 0 \u4ee5\u4e0a\u7684\u5c42\u7ea7\uff0c\u5219\u5907\u4efd\u81f3\u4e0a\u4e00\u6b21\u5907\u4efd\u4ee5\u6765\u4fee\u6539\u6216\u65b0\u589e\u7684\u6587\u4ef6, \u5230 9 \u540e\uff0c\u53ef\u4ee5\u518d\u6b21\u8f6e\u66ff\u3002<\/p>\n<p>-f &lt;\u5907\u4efd\u540e\u6587\u4ef6\u540d>\uff1a\u6307\u5b9a\u5907\u4efd\u540e\u6587\u4ef6\u540d<\/p>\n<p>-j\uff1a \u8c03\u7528 bzlib \u5e93\u538b\u7f29\u5907\u4efd\u6587\u4ef6\uff0c\u4e5f\u5c31\u662f\u5c06\u5907\u4efd\u540e\u7684\u6587\u4ef6\u538b\u7f29\u6210 bz2 \u683c\u5f0f\uff0c\u8ba9\u6587\u4ef6\u66f4\u5c0f<\/p>\n<p>-T &lt;\u65e5\u671f>\uff1a\u6307\u5b9a\u5f00\u59cb\u5907\u4efd\u7684\u65f6\u95f4\u4e0e\u65e5\u671f<\/p>\n<p>-u \uff1a\u5907\u4efd\u5b8c\u6bd5\u540e\uff0c\u5728\/etc\/dumpdates \u4e2d\u8bb0\u5f55\u5907\u4efd\u7684\u6587\u4ef6\u7cfb\u7edf\uff0c\u5c42\u7ea7\uff0c\u65e5\u671f\u4e0e\u65f6\u95f4\u7b49\u3002<\/p>\n<p>-t \uff1a\u6307\u5b9a\u6587\u4ef6\u540d\uff0c\u82e5\u8be5\u6587\u4ef6\u5df2\u5b58\u5728\u5907\u4efd\u6587\u4ef6\u4e2d\uff0c\u5219\u5217\u51fa\u540d\u79f0<\/p>\n<p>-W\uff1a\u663e\u793a\u9700\u8981\u5907\u4efd\u7684\u6587\u4ef6\u53ca\u5176\u6700\u540e\u4e00\u6b21\u5907\u4efd\u7684\u5c42\u7ea7\uff0c\u65f6\u95f4 \uff0c\u65e5\u671f\u3002<\/p>\n<p>-w\uff1a\u4e0e-W \u7c7b\u4f3c\uff0c\u4f46\u4ec5\u663e\u793a\u9700\u8981\u5907\u4efd\u7684\u6587\u4ef6\u3002<\/p>\n<\/li>\n<li>\n<p>dump \u5e94\u7528\u6848\u4f8b1<\/p>\n<p>\u5c06\/boot \u5206\u533a\u6240\u6709\u5185\u5bb9\u5907\u4efd\u5230\/opt\/boot.bak0.bz2 \u6587\u4ef6\u4e2d\uff0c\u5907\u4efd\u5c42\u7ea7\u4e3a\u201c0\u201d<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 ~]# dump -0uj -f \/opt\/boot.bak0.bz2 \/boot<br \/>\n   DUMP: Date of this level 0 dump: Wed May  5 21:49:34 2021<br \/>\n   DUMP: Dumping \/dev\/sda1 (\/boot) to \/opt\/boot.bak0.bz2<br \/>\n   DUMP: Label: none<br \/>\n   DUMP: Writing 10 Kilobyte records<br \/>\n   DUMP: Compressing output at compression level 2 (bzlib)<br \/>\n   DUMP: mapping (Pass I) [regular files]<br \/>\n   DUMP: mapping (Pass II) [directories]<br \/>\n   DUMP: estimated 144895 blocks.<br \/>\n   DUMP: Volume 1 started with block 1 at: Wed May  5 21:49:34 2021<br \/>\n   DUMP: dumping (Pass III) [directories]<br \/>\n   DUMP: dumping (Pass IV) [regular files]<br \/>\n   DUMP: Closing \/opt\/boot.bak0.bz2<br \/>\n   DUMP: Volume 1 completed at: Wed May  5 21:49:57 2021<br \/>\n   DUMP: Volume 1 took 0:00:23<br \/>\n   DUMP: Volume 1 transfer rate: 5689 kB\/s<br \/>\n   DUMP: Volume 1 145510kB uncompressed, 130867kB compressed, 1.112:1<br \/>\n   DUMP: 145510 blocks (142.10MB) on 1 volume(s)<br \/>\n   DUMP: finished in 23 seconds, throughput 6326 kBytes\/sec<br \/>\n   DUMP: Date of this level 0 dump: Wed May  5 21:49:34 2021<br \/>\n   DUMP: Date this dump completed:  Wed May  5 21:49:57 2021<br \/>\n   DUMP: Average transfer rate: 5689 kB\/s<br \/>\n   DUMP: Wrote 145510kB uncompressed, 130867kB compressed, 1.112:1<br \/>\n   DUMP: DUMP IS DONE<br \/>\n [root@alanCentos01 ~]#<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;dump \u5e94\u7528\u6848\u4f8b2<\/p>\n<p>\u5728\/boot \u76ee\u5f55\u4e0b\u589e\u52a0\u65b0\u6587\u4ef6\uff0c\u5907\u4efd\u5c42\u7ea7\u4e3a\u201c1\u201d(\u53ea\u5907\u4efd\u4e0a\u6b21\u4f7f\u7528\u5c42\u6b21\u201c0\u201d\u5907\u4efd\u540e\u53d1\u751f\u8fc7\u6539\u53d8\u7684\u6570\u636e)\uff0c\u6ce8\u610f\u6bd4\u8f83\u770b\u770b\u8fd9\u6b21\u751f\u6210\u7684\u5907\u4efd\u6587\u4ef6 boot1.bak \u6709\u591a\u5927<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 ~]# dump -1uj -f \/opt\/boot.bak1.bz2 \/boot<br \/>\n   DUMP: Date of this level 1 dump: Wed May  5 21:57:39 2021<br \/>\n   DUMP: Date of last level 0 dump: Wed May  5 21:49:34 2021<br \/>\n   DUMP: Dumping \/dev\/sda1 (\/boot) to \/opt\/boot.bak1.bz2<br \/>\n   DUMP: Label: none<br \/>\n   DUMP: Writing 10 Kilobyte records<br \/>\n   DUMP: Compressing output at compression level 2 (bzlib)<br \/>\n   DUMP: mapping (Pass I) [regular files]<br \/>\n   DUMP: mapping (Pass II) [directories]<br \/>\n   DUMP: estimated 31 blocks.<br \/>\n   DUMP: Volume 1 started with block 1 at: Wed May  5 21:57:39 2021<br \/>\n   DUMP: dumping (Pass III) [directories]<br \/>\n   DUMP: dumping (Pass IV) [regular files]<br \/>\n   DUMP: Closing \/opt\/boot.bak1.bz2<br \/>\n   DUMP: Volume 1 completed at: Wed May  5 21:57:39 2021<br \/>\n   DUMP: 30 blocks (0.03MB) on 1 volume(s)<br \/>\n   DUMP: finished in less than a second<br \/>\n   DUMP: Date of this level 1 dump: Wed May  5 21:57:39 2021<br \/>\n   DUMP: Date this dump completed:  Wed May  5 21:57:39 2021<br \/>\n   DUMP: Average transfer rate: 0 kB\/s<br \/>\n   DUMP: Wrote 30kB uncompressed, 10kB compressed, 3.001:1<br \/>\n   DUMP: DUMP IS DONE<br \/>\n [root@alanCentos01 ~]# ls -lh \/opt\/<br \/>\n \u603b\u7528\u91cf 182M<br \/>\n -rw-r&#8211;r&#8211;. 1 root root 128M 5\u6708   5 21:49 boot.bak0.bz2<br \/>\n -rw-r&#8211;r&#8211;. 1 root root  11K 5\u6708   5 21:57 boot.bak1.bz2<br \/>\n drwxr-xr-x. 3 root root 4.0K 4\u6708  28 23:07 idea<br \/>\n drwxr-xr-x. 2 root root 4.0K 4\u6708  25 18:48 jdk<br \/>\n drwxr-xr-x. 2 root root 4.0K 4\u6708  25 23:19 mysql<br \/>\n drwxr-xr-x. 2 root root 4.0K 10\u6708 31 2018 rh<br \/>\n drwxr-xr-x. 3 root root 4.0K 4\u6708  25 21:54 tomcat<br \/>\n -rw-r&#8211;r&#8211;. 1 root root  54M 6\u6708  13 2019 VMwareTools-10.3.10-13959562.tar.gz<br \/>\n drwxr-xr-x. 9 root root 4.0K 6\u6708  13 2019 vmware-tools-distrib<br \/>\n [root@alanCentos01 ~]# <\/p>\n<p>&#8220;`<\/p>\n<p>&lt;span class=&quot;text-highlighted-inline&quot; style=&quot;background-color: #fffd38;&quot;&gt;\u63d0\u9192: \u901a\u8fc7 dump \u547d\u4ee4\u5728\u914d\u5408 crontab \u53ef\u4ee5\u5b9e\u73b0\u65e0\u4eba\u503c\u5b88\u5907\u4efd&lt;\/span&gt;&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;dump -W<\/p>\n<p>\u663e\u793a\u9700\u8981\u5907\u4efd\u7684\u6587\u4ef6\u53ca\u5176\u6700\u540e\u4e00\u6b21\u5907\u4efd\u7684\u5c42\u7ea7\uff0c\u65f6\u95f4 \uff0c\u65e5\u671f<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 ~]# dump -W<br \/>\n Last dump(s) done (Dump &#8216;>&#8217; file systems):<\/p>\n<blockquote><p>\n  \/dev\/sda3    (     \/) Last dump: never<br \/>\n     \/dev\/sda1    ( \/boot) Last dump: Level 1, Date Wed May  5 21:57:39 2021<br \/>\n   [root@alanCentos01 ~]#\n<\/p><\/blockquote>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u67e5\u770b\u5907\u4efd\u65f6\u95f4\u6587\u4ef6<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 ~]# cat \/etc\/dumpdates<br \/>\n \/dev\/sda1 0 Wed May  5 21:49:34 2021 +0800<br \/>\n \/dev\/sda1 1 Wed May  5 21:57:39 2021 +0800<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;dump \u5907\u4efd\u6587\u4ef6\u6216\u8005\u76ee\u5f55<\/p>\n<p>\u524d\u9762\u6211\u4eec\u5728\u5907\u4efd\u5206\u533a\u65f6\uff0c\u662f\u53ef\u4ee5\u652f\u6301\u589e\u91cf\u5907\u4efd\u7684\uff0c\u5982\u679c\u5907\u4efd\u6587\u4ef6\u6216\u8005\u76ee\u5f55\uff0c\u4e0d\u518d\u652f\u6301\u589e\u91cf\u5907\u4efd, \u5373\u53ea\u80fd\u4f7f\u7528 0 \u7ea7\u522b\u5907\u4efd<\/p>\n<p>\u6848\u4f8b\uff1a\u4f7f\u7528 dump \u5907\u4efd \/etc \u6574\u4e2a\u76ee\u5f55<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 ~]# dump -0j -f \/opt\/etc.bak.bz2 \/etc\/<br \/>\n   DUMP: Date of this level 0 dump: Wed May  5 22:23:42 2021<br \/>\n   DUMP: Dumping \/dev\/sda3 (\/ (dir etc)) to \/opt\/etc.bak.bz2<br \/>\n   DUMP: Label: none<br \/>\n   DUMP: Writing 10 Kilobyte records<br \/>\n   DUMP: Compressing output at compression level 2 (bzlib)<br \/>\n   DUMP: mapping (Pass I) [regular files]<br \/>\n   DUMP: mapping (Pass II) [directories]<br \/>\n   DUMP: estimated 67720 blocks.<br \/>\n   DUMP: Volume 1 started with block 1 at: Wed May  5 22:23:43 2021<br \/>\n   DUMP: dumping (Pass III) [directories]<br \/>\n   DUMP: dumping (Pass IV) [regular files]<br \/>\n   DUMP: Closing \/opt\/etc.bak.bz2<br \/>\n   DUMP: Volume 1 completed at: Wed May  5 22:23:51 2021<br \/>\n   DUMP: Volume 1 took 0:00:08<br \/>\n   DUMP: Volume 1 transfer rate: 3034 kB\/s<br \/>\n   DUMP: Volume 1 77340kB uncompressed, 24272kB compressed, 3.187:1<br \/>\n   DUMP: 77340 blocks (75.53MB) on 1 volume(s)<br \/>\n   DUMP: finished in 8 seconds, throughput 9667 kBytes\/sec<br \/>\n   DUMP: Date of this level 0 dump: Wed May  5 22:23:42 2021<br \/>\n   DUMP: Date this dump completed:  Wed May  5 22:23:51 2021<br \/>\n   DUMP: Average transfer rate: 3034 kB\/s<br \/>\n   DUMP: Wrote 77340kB uncompressed, 24272kB compressed, 3.187:1<br \/>\n   DUMP: DUMP IS DONE<br \/>\n [root@alanCentos01 ~]#<\/p>\n<p>&#8220;`<\/p>\n<p>&lt;span class=&quot;text-highlighted-inline&quot; style=&quot;background-color: #fffd38;&quot;&gt;\u4e0b\u9762\u8fd9\u6761\u8bed\u53e5\u4f1a\u62a5\u9519\uff0c\u63d0\u793a DUMP: Only level 0 dumps are allowed on a subdirectory&lt;\/span&gt;<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 ~]# dump -1j -f \/opt\/etc.bak.bz2 \/etc\/<br \/>\n   DUMP: Only level 0 dumps are allowed on a subdirectory<br \/>\n   DUMP: The ENTIRE dump is aborted.<br \/>\n [root@alanCentos01 ~]#<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;&lt;span class=&quot;text-highlighted-inline&quot; style=&quot;background-color: #fffd38;&quot;&gt;\u63d0\u9192\uff1a\u5982\u679c\u662f\u91cd\u8981\u7684\u5907\u4efd\u6587\u4ef6\uff0c \u6bd4\u5982\u6570\u636e\u533a\uff0c\u5efa\u8bae\u5c06\u6587\u4ef6\u4e0a\u4f20\u5230\u5176\u5b83\u670d\u52a1\u5668\u4fdd\u5b58\uff0c\u4e0d\u8981\u5c06\u9e21\u86cb\u653e\u5728\u540c\u4e00\u4e2a\u7bee\u5b50\u4e0d\u8981\u5c06\u9e21\u86cb\u653e\u5728\u540c\u4e00\u4e2a\u7bee\u5b50\u3002&lt;\/span&gt;&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<\/p>\n<p>&lt;ol start=&quot;4&quot;&gt;<br \/>\n&lt;li&gt;\u4f7f\u7528 restore \u5b8c\u6210\u6062\u590d&lt;\/li&gt;<br \/>\n&lt;\/ol&gt;<\/p>\n<p>&lt;ul&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u57fa\u672c\u4ecb\u7ecd<\/p>\n<p>restore \u547d\u4ee4\u7528\u6765\u6062\u590d\u5df2\u5907\u4efd\u7684\u6587\u4ef6\uff0c\u53ef\u4ee5\u4ece dump \u751f\u6210\u7684\u5907\u4efd\u6587\u4ef6\u4e2d\u6062\u590d\u539f\u6587\u4ef6&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;restore \u57fa\u672c\u8bed\u6cd5<\/p>\n<p>restore &#091;\u6a21\u5f0f\u9009\u9879] &#091;\u9009\u9879]<\/p>\n<p>\u8bf4\u660e\u4e0b\u9762\u56db\u4e2a\u6a21\u5f0f\uff0c \u4e0d\u80fd\u6df7\u7528\uff0c\u5728\u4e00\u6b21\u547d\u4ee4\u4e2d\uff0c \u53ea\u80fd\u6307\u5b9a\u4e00\u79cd\u3002<\/p>\n<p>-C\uff1a\u4f7f\u7528\u5bf9\u6bd4\u6a21\u5f0f\uff0c\u5c06\u5907\u4efd\u7684\u6587\u4ef6\u4e0e\u5df2\u5b58\u5728\u7684\u6587\u4ef6\u76f8\u4e92\u5bf9\u6bd4\u3002<\/p>\n<p>-i\uff1a\u4f7f\u7528\u4ea4\u4e92\u6a21\u5f0f\uff0c\u5728\u8fdb\u884c\u8fd8\u539f\u64cd\u4f5c\u65f6\uff0crestors \u6307\u4ee4\u5c06\u4f9d\u5e8f\u8be2\u95ee\u7528\u6237<\/p>\n<p>-r\uff1a\u8fdb\u884c\u8fd8\u539f\u6a21\u5f0f<\/p>\n<p>-t\uff1a \u67e5\u770b\u6a21\u5f0f\uff0c\u770b\u5907\u4efd\u6587\u4ef6\u6709\u54ea\u4e9b\u6587\u4ef6<\/p>\n<p>\u9009\u9879<\/p>\n<p>-f &lt;\u5907\u4efd\u8bbe\u5907&gt;\uff1a\u4ece\u6307\u5b9a\u7684\u6587\u4ef6\u4e2d\u8bfb\u53d6\u5907\u4efd\u6570\u636e\uff0c\u8fdb\u884c\u8fd8\u539f\u64cd\u4f5c&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5e94\u7528\u6848\u4f8b1<\/p>\n<p>restore \u547d\u4ee4\u6bd4\u8f83\u6a21\u5f0f\uff0c\u6bd4\u8f83\u5907\u4efd\u6587\u4ef6\u548c\u539f\u6587\u4ef6\u7684\u533a\u522b<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 opt]# restore -C -f boot.bak1.bz2<br \/>\n Dump tape is compressed.<br \/>\n Dump   date: Wed May  5 21:57:39 2021<br \/>\n Dumped from: Wed May  5 21:49:34 2021<br \/>\n Level 1 dump of \/boot on alanCentos01:\/dev\/sda1<br \/>\n Label: none<br \/>\n filesys = \/boot<br \/>\n [root@alanCentos01 opt]#<\/p>\n<p>&#8220;`<\/p>\n<p>\u5982\u679c\u6bd4\u8f83\u6709\u533a\u522b\uff0c\u663e\u793a\u7ed3\u679c\u7c7b\u4f3c\u4e0b\u56fe<\/p>\n<p>&lt;img src=&quot;https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210505224608122.png&quot; alt=&quot;image-20210505224608122&quot; \/&gt;&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5e94\u7528\u6848\u4f8b2<\/p>\n<p>restore \u547d\u4ee4\u67e5\u770b\u6a21\u5f0f\uff0c\u770b\u5907\u4efd\u6587\u4ef6\u6709\u54ea\u4e9b\u6570\u636e\/\u6587\u4ef6<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 opt]# restore -t -f boot.bak0.bz2<br \/>\n Dump tape is compressed.<br \/>\n Dump   date: Wed May  5 21:49:34 2021<br \/>\n Dumped from: the epoch<br \/>\n Level 0 dump of \/boot on alanCentos01:\/dev\/sda1<br \/>\n Label: none<br \/>\n          2 .<br \/>\n         11 .\/lost+found<br \/>\n         12 .\/efi<br \/>\n         13 .\/efi\/EFI<br \/>\n         14 .\/efi\/EFI\/centos<br \/>\n         22 .\/efi\/EFI\/centos\/MokManager.efi<br \/>\n         20 .\/efi\/EFI\/centos\/BOOT.CSV<br \/>\n         21 .\/efi\/EFI\/centos\/BOOTX64.CSV<br \/>\n         25 .\/efi\/EFI\/centos\/shimx64-centos.efi<br \/>\n         23 .\/efi\/EFI\/centos\/mmx64.efi<br \/>\n         24 .\/efi\/EFI\/centos\/shim.efi<br \/>\n         27 .\/efi\/EFI\/centos\/fw<br \/>\n         26 .\/efi\/EFI\/centos\/shimx64.efi<br \/>\n         28 .\/efi\/EFI\/centos\/fwupia32.efi<br \/>\n         29 .\/efi\/EFI\/centos\/fwupx64.efi<br \/>\n         16 .\/efi\/EFI\/BOOT<br \/>\n         18 .\/efi\/EFI\/BOOT\/fallback.efi<br \/>\n         17 .\/efi\/EFI\/BOOT\/BOOTX64.EFI<br \/>\n         19 .\/efi\/EFI\/BOOT\/fbx64.efi<br \/>\n       8193 .\/grub2<br \/>\n         38 .\/grub2\/device.map<br \/>\n         39 .\/grub2\/i386-pc<br \/>\n         43 .\/grub2\/i386-pc\/videotest.mod<br \/>\n         44 .\/grub2\/i386-pc\/blocklist.mod<br \/>\n         45 .\/grub2\/i386-pc\/regexp.mod<br \/>\n         53 .\/grub2\/i386-pc\/parttool.mod<br \/>\n         54 .\/grub2\/i386-pc\/read.mod<br \/>\n         55 .\/grub2\/i386-pc\/truecrypt.mod<br \/>\n         56 .\/grub2\/i386-pc\/help.mod<br \/>\n         59 .\/grub2\/i386-pc\/serial.mod<br \/>\n         60 .\/grub2\/i386-pc\/cpio_be.mod<br \/>\n         61 .\/grub2\/i386-pc\/newc.mod<br \/>\n         64 .\/grub2\/i386-pc\/xfs.mod<br \/>\n         65 .\/grub2\/i386-pc\/test.mod<br \/>\n         69 .\/grub2\/i386-pc\/loopback.mod<br \/>\n         71 .\/grub2\/i386-pc\/loadenv.mod<br \/>\n         73 .\/grub2\/i386-pc\/ahci.mod<br \/>\n         74 .\/grub2\/i386-pc\/gfxterm.mod<br \/>\n         75 .\/grub2\/i386-pc\/gcry_md4.mod<br \/>\n         76 .\/grub2\/i386-pc\/ext2.mod<br \/>\n         78 .\/grub2\/i386-pc\/dm_nv.mod<br \/>\n         79 .\/grub2\/i386-pc\/gcry_rsa.mod<br \/>\n         80 .\/grub2\/i386-pc\/elf.mod<br \/>\n         85 .\/grub2\/i386-pc\/udf.mod<br \/>\n         87 .\/grub2\/i386-pc\/part_dvh.mod<br \/>\n         88 .\/grub2\/i386-pc\/part_apple.mod<br \/>\n         91 .\/grub2\/i386-pc\/multiboot.mod<br \/>\n         92 .\/grub2\/i386-pc\/functional_test.mod<br \/>\n         94 .\/grub2\/i386-pc\/gcry_sha512.mod<br \/>\n         98 .\/grub2\/i386-pc\/gzio.mod<br \/>\n        101 .\/grub2\/i386-pc\/progress.mod<br \/>\n        103 .\/grub2\/i386-pc\/geli.mod<br \/>\n        104 .\/grub2\/i386-pc\/msdospart.mod<br \/>\n        107 .\/grub2\/i386-pc\/ufs1_be.mod<br \/>\n        108 .\/grub2\/i386-pc\/cmosdump.mod<br \/>\n        113 .\/grub2\/i386-pc\/cmostest.mod<br \/>\n        115 .\/grub2\/i386-pc\/uhci.mod<br \/>\n        117 .\/grub2\/i386-pc\/gcry_sha256.mod<br \/>\n        118 .\/grub2\/i386-pc\/xnu_uuid.mod<br \/>\n        119 .\/grub2\/i386-pc\/part_bsd.mod<br \/>\n        121 .\/grub2\/i386-pc\/sleep_test.mod<br \/>\n        123 .\/grub2\/i386-pc\/archelp.mod<br \/>\n        127 .\/grub2\/i386-pc\/legacycfg.mod<br \/>\n        129 .\/grub2\/i386-pc\/halt.mod<br \/>\n        131 .\/grub2\/i386-pc\/bitmap_scale.mod<br \/>\n        136 .\/grub2\/i386-pc\/zfsinfo.mod<br \/>\n        137 .\/grub2\/i386-pc\/btrfs.mod<br \/>\n        138 .\/grub2\/i386-pc\/gcry_blowfish.mod<br \/>\n        139 .\/grub2\/i386-pc\/gcry_tiger.mod<br \/>\n        140 .\/grub2\/i386-pc\/play.mod<br \/>\n        141 .\/grub2\/i386-pc\/minix_be.mod<br \/>\n        142 .\/grub2\/i386-pc\/hashsum.mod<br \/>\n        143 .\/grub2\/i386-pc\/gcry_idea.mod<br \/>\n        144 .\/grub2\/i386-pc\/bsd.mod<br \/>\n        145 .\/grub2\/i386-pc\/sfs.mod<br \/>\n        147 .\/grub2\/i386-pc\/mdraid09.mod<br \/>\n        149 .\/grub2\/i386-pc\/part_sun.mod<br \/>\n        151 .\/grub2\/i386-pc\/hfspluscomp.mod<br \/>\n        155 .\/grub2\/i386-pc\/macbless.mod<br \/>\n        156 .\/grub2\/i386-pc\/bitmap.mod<br \/>\n        157 .\/grub2\/i386-pc\/pxechain.mod<br \/>\n        158 .\/grub2\/i386-pc\/priority_queue.mod<br \/>\n        161 .\/grub2\/i386-pc\/memrw.mod<br \/>\n        163 .\/grub2\/i386-pc\/relocator.mod<br \/>\n        165 .\/grub2\/i386-pc\/affs.mod<br \/>\n        166 .\/grub2\/i386-pc\/net.mod<br \/>\n        167 .\/grub2\/i386-pc\/file.mod<br \/>\n        170 .\/grub2\/i386-pc\/adler32.mod<br \/>\n        172 .\/grub2\/i386-pc\/legacy_password_test.mod<br \/>\n        175 .\/grub2\/i386-pc\/password_pbkdf2.mod<br \/>\n        176 .\/grub2\/i386-pc\/setjmp_test.mod<br \/>\n        179 .\/grub2\/i386-pc\/cbmemc.mod<br \/>\n        180 .\/grub2\/i386-pc\/part_plan.mod<br \/>\n        181 .\/grub2\/i386-pc\/linux16.mod<br \/>\n        182 .\/grub2\/i386-pc\/echo.mod<br \/>\n        184 .\/grub2\/i386-pc\/part_msdos.mod<br \/>\n        190 .\/grub2\/i386-pc\/search.mod<br \/>\n        191 .\/grub2\/i386-pc\/gfxmenu.mod<br \/>\n        192 .\/grub2\/i386-pc\/usb.mod<br \/>\n        196 .\/grub2\/i386-pc\/ufs1.mod<br \/>\n        201 .\/grub2\/i386-pc\/chain.mod<br \/>\n        202 .\/grub2\/i386-pc\/linux.mod<br \/>\n        207 .\/grub2\/i386-pc\/minix3.mod<br \/>\n        209 .\/grub2\/i386-pc\/cs5536.mod<br \/>\n        212 .\/grub2\/i386-pc\/minix.mod<br \/>\n        213 .\/grub2\/i386-pc\/crc64.mod<br \/>\n        214 .\/grub2\/i386-pc\/gettext.mod<br \/>\n        216 .\/grub2\/i386-pc\/video_colors.mod<br \/>\n        218 .\/grub2\/i386-pc\/gcry_crc.mod<br \/>\n        222 .\/grub2\/i386-pc\/videotest_checksum.mod<br \/>\n        223 .\/grub2\/i386-pc\/minix2_be.mod<br \/>\n        226 .\/grub2\/i386-pc\/lsapm.mod<br \/>\n        227 .\/grub2\/i386-pc\/lsacpi.mod<br \/>\n        229 .\/grub2\/i386-pc\/terminfo.mod<br \/>\n        230 .\/grub2\/i386-pc\/boot.mod<br \/>\n        231 .\/grub2\/i386-pc\/raid6rec.mod<br \/>\n        233 .\/grub2\/i386-pc\/part_gpt.mod<br \/>\n        234 .\/grub2\/i386-pc\/video.mod<br \/>\n        236 .\/grub2\/i386-pc\/gcry_serpent.mod<br \/>\n        239 .\/grub2\/i386-pc\/raid5rec.mod<br \/>\n        240 .\/grub2\/i386-pc\/usbserial_usbdebug.mod<br \/>\n        241 .\/grub2\/i386-pc\/minicmd.mod<br \/>\n        244 .\/grub2\/i386-pc\/gcry_sha1.mod<br \/>\n        246 .\/grub2\/i386-pc\/squash4.mod<br \/>\n        248 .\/grub2\/i386-pc\/cbfs.mod<br \/>\n        250 .\/grub2\/i386-pc\/mda_text.mod<br \/>\n        256 .\/grub2\/i386-pc\/hfsplus.mod<br \/>\n        257 .\/grub2\/i386-pc\/gcry_md5.mod<br \/>\n        258 .\/grub2\/i386-pc\/aout.mod<br \/>\n        259 .\/grub2\/i386-pc\/verify.mod<br \/>\n        260 .\/grub2\/i386-pc\/backtrace.mod<br \/>\n        262 .\/grub2\/i386-pc\/mdraid09_be.mod<br \/>\n        264 .\/grub2\/i386-pc\/part_sunpc.mod<br \/>\n        265 .\/grub2\/i386-pc\/part_dfly.mod<br \/>\n        272 .\/grub2\/i386-pc\/usbtest.mod<br \/>\n        277 .\/grub2\/i386-pc\/date.mod<br \/>\n        279 .\/grub2\/i386-pc\/exfctest.mod<br \/>\n        280 .\/grub2\/i386-pc\/usbms.mod<br \/>\n        281 .\/grub2\/i386-pc\/tga.mod<br \/>\n        282 .\/grub2\/i386-pc\/cpuid.mod<br \/>\n        283 .\/grub2\/i386-pc\/crypto.mod<br \/>\n        284 .\/grub2\/i386-pc\/cmdline_cat_test.mod<br \/>\n        285 .\/grub2\/i386-pc\/cbls.mod<br \/>\n        287 .\/grub2\/i386-pc\/ntldr.mod<br \/>\n        289 .\/grub2\/i386-pc\/ntfscomp.mod<br \/>\n        293 .\/grub2\/i386-pc\/hfs.mod<br \/>\n        301 .\/grub2\/i386-pc\/partmap.lst<br \/>\n        200 .\/grub2\/i386-pc\/gcry_rfc2268.mod<br \/>\n        198 .\/grub2\/i386-pc\/ufs2.mod<br \/>\n         49 .\/grub2\/i386-pc\/minix3_be.mod<br \/>\n         96 .\/grub2\/i386-pc\/xnu_uuid_test.mod<br \/>\n        232 .\/grub2\/i386-pc\/mdraid1x.mod<br \/>\n        168 .\/grub2\/i386-pc\/terminal.mod<br \/>\n        199 .\/grub2\/i386-pc\/gdb.mod<br \/>\n         95 .\/grub2\/i386-pc\/luks.mod<br \/>\n        132 .\/grub2\/i386-pc\/signature_test.mod<br \/>\n         93 .\/grub2\/i386-pc\/setjmp.mod<br \/>\n        205 .\/grub2\/i386-pc\/all_video.mod<br \/>\n        110 .\/grub2\/i386-pc\/part_acorn.mod<br \/>\n         82 .\/grub2\/i386-pc\/cmp.mod<br \/>\n        114 .\/grub2\/i386-pc\/usbserial_pl2303.mod<br \/>\n        152 .\/grub2\/i386-pc\/pbkdf2_test.mod<br \/>\n        146 .\/grub2\/i386-pc\/vga.mod<br \/>\n        169 .\/grub2\/i386-pc\/sendkey.mod<br \/>\n        162 .\/grub2\/i386-pc\/usbserial_ftdi.mod<br \/>\n        185 .\/grub2\/i386-pc\/ata.mod<br \/>\n        125 .\/grub2\/i386-pc\/div_test.mod<br \/>\n         52 .\/grub2\/i386-pc\/search_label.mod<br \/>\n         42 .\/grub2\/i386-pc\/afs.mod<br \/>\n        134 .\/grub2\/i386-pc\/syslinuxcfg.mod<br \/>\n        102 .\/grub2\/i386-pc\/reboot.mod<br \/>\n         41 .\/grub2\/i386-pc\/hdparm.mod<br \/>\n        228 .\/grub2\/i386-pc\/usbserial_common.mod<br \/>\n        159 .\/grub2\/i386-pc\/lspci.mod<br \/>\n         97 .\/grub2\/i386-pc\/gcry_camellia.mod<br \/>\n        116 .\/grub2\/i386-pc\/procfs.mod<br \/>\n        150 .\/grub2\/i386-pc\/lvm.mod<br \/>\n         77 .\/grub2\/i386-pc\/mmap.mod<br \/>\n        197 .\/grub2\/i386-pc\/cryptodisk.mod<br \/>\n        235 .\/grub2\/i386-pc\/gfxterm_menu.mod<br \/>\n         86 .\/grub2\/i386-pc\/tr.mod<br \/>\n         51 .\/grub2\/i386-pc\/sleep.mod<br \/>\n         90 .\/grub2\/i386-pc\/video_bochs.mod<br \/>\n        174 .\/grub2\/i386-pc\/pxe.mod<br \/>\n        219 .\/grub2\/i386-pc\/gcry_rijndael.mod<br \/>\n        128 .\/grub2\/i386-pc\/freedos.mod<br \/>\n        210 .\/grub2\/i386-pc\/ntfs.mod<br \/>\n        186 .\/grub2\/i386-pc\/nilfs2.mod<br \/>\n        105 .\/grub2\/i386-pc\/minix2.mod<br \/>\n         57 .\/grub2\/i386-pc\/fshelp.mod<br \/>\n        177 .\/grub2\/i386-pc\/pata.mod<br \/>\n        195 .\/grub2\/i386-pc\/biosdisk.mod<br \/>\n        109 .\/grub2\/i386-pc\/video_fb.mod<br \/>\n        173 .\/grub2\/i386-pc\/bufio.mod<br \/>\n        204 .\/grub2\/i386-pc\/pcidump.mod<br \/>\n        193 .\/grub2\/i386-pc\/zfs.mod<br \/>\n        211 .\/grub2\/i386-pc\/gcry_des.mod<br \/>\n        100 .\/grub2\/i386-pc\/tftp.mod<br \/>\n        120 .\/grub2\/i386-pc\/keylayouts.mod<br \/>\n        221 .\/grub2\/i386-pc\/datehook.mod<br \/>\n         48 .\/grub2\/i386-pc\/macho.mod<br \/>\n         72 .\/grub2\/i386-pc\/testspeed.mod<br \/>\n        194 .\/grub2\/i386-pc\/mpi.mod<br \/>\n        206 .\/grub2\/i386-pc\/gcry_rmd160.mod<br \/>\n         58 .\/grub2\/i386-pc\/spkmodem.mod<br \/>\n        238 .\/grub2\/i386-pc\/bfs.mod<br \/>\n         62 .\/grub2\/i386-pc\/gcry_whirlpool.mod<br \/>\n        130 .\/grub2\/i386-pc\/morse.mod<br \/>\n        126 .\/grub2\/i386-pc\/pbkdf2.mod<br \/>\n        171 .\/grub2\/i386-pc\/hello.mod<br \/>\n        122 .\/grub2\/i386-pc\/test_blockarg.mod<br \/>\n        237 .\/grub2\/i386-pc\/zfscrypt.mod<br \/>\n        183 .\/grub2\/i386-pc\/romfs.mod<br \/>\n         50 .\/grub2\/i386-pc\/ehci.mod<br \/>\n        153 .\/grub2\/i386-pc\/memdisk.mod<br \/>\n        208 .\/grub2\/i386-pc\/extcmd.mod<br \/>\n        112 .\/grub2\/i386-pc\/disk.mod<br \/>\n        178 .\/grub2\/i386-pc\/gcry_dsa.mod<br \/>\n         84 .\/grub2\/i386-pc\/cbtime.mod<br \/>\n        187 .\/grub2\/i386-pc\/odc.mod<br \/>\n        111 .\/grub2\/i386-pc\/setpci.mod<br \/>\n         83 .\/grub2\/i386-pc\/exfat.mod<br \/>\n        215 .\/grub2\/i386-pc\/jpeg.mod<br \/>\n        164 .\/grub2\/i386-pc\/time.mod<br \/>\n        217 .\/grub2\/i386-pc\/gcry_arcfour.mod<br \/>\n        189 .\/grub2\/i386-pc\/efiemu.mod<br \/>\n         67 .\/grub2\/i386-pc\/xnu.mod<br \/>\n        135 .\/grub2\/i386-pc\/cat.mod<br \/>\n         68 .\/grub2\/i386-pc\/video_cirrus.mod<br \/>\n        160 .\/grub2\/i386-pc\/password.mod<br \/>\n        124 .\/grub2\/i386-pc\/configfile.mod<br \/>\n         66 .\/grub2\/i386-pc\/http.mod<br \/>\n        188 .\/grub2\/i386-pc\/ldm.mod<br \/>\n        154 .\/grub2\/i386-pc\/search_fs_file.mod<br \/>\n         46 .\/grub2\/i386-pc\/eval.mod<br \/>\n         70 .\/grub2\/i386-pc\/ohci.mod<br \/>\n        225 .\/grub2\/i386-pc\/probe.mod<br \/>\n        224 .\/grub2\/i386-pc\/normal.mod<br \/>\n        203 .\/grub2\/i386-pc\/trig.mod<br \/>\n        133 .\/grub2\/i386-pc\/true.mod<br \/>\n         89 .\/grub2\/i386-pc\/iso9660.mod<br \/>\n         99 .\/grub2\/i386-pc\/gcry_twofish.mod<br \/>\n         63 .\/grub2\/i386-pc\/hexdump.mod<br \/>\n        148 .\/grub2\/i386-pc\/plan9.mod<br \/>\n        220 .\/grub2\/i386-pc\/pci.mod<br \/>\n        106 .\/grub2\/i386-pc\/usb_keyboard.mod<br \/>\n         81 .\/grub2\/i386-pc\/drivemap.mod<br \/>\n         47 .\/grub2\/i386-pc\/cbtable.mod<br \/>\n        242 .\/grub2\/i386-pc\/search_fs_uuid.mod<br \/>\n        243 .\/grub2\/i386-pc\/vga_text.mod<br \/>\n        245 .\/grub2\/i386-pc\/jfs.mod<br \/>\n        247 .\/grub2\/i386-pc\/xzio.mod<br \/>\n        249 .\/grub2\/i386-pc\/iorw.mod<br \/>\n        251 .\/grub2\/i386-pc\/diskfilter.mod<br \/>\n        252 .\/grub2\/i386-pc\/scsi.mod<br \/>\n        253 .\/grub2\/i386-pc\/videoinfo.mod<br \/>\n        254 .\/grub2\/i386-pc\/cpio.mod<br \/>\n        255 .\/grub2\/i386-pc\/font.mod<br \/>\n        261 .\/grub2\/i386-pc\/fat.mod<br \/>\n        263 .\/grub2\/i386-pc\/lsmmap.mod<br \/>\n        266 .\/grub2\/i386-pc\/ls.mod<br \/>\n        267 .\/grub2\/i386-pc\/multiboot2.mod<br \/>\n        268 .\/grub2\/i386-pc\/testload.mod<br \/>\n        269 .\/grub2\/i386-pc\/vbe.mod<br \/>\n        270 .\/grub2\/i386-pc\/tar.mod<br \/>\n        271 .\/grub2\/i386-pc\/lzopio.mod<br \/>\n        273 .\/grub2\/i386-pc\/offsetio.mod<br \/>\n        274 .\/grub2\/i386-pc\/gcry_cast5.mod<br \/>\n        275 .\/grub2\/i386-pc\/reiserfs.mod<br \/>\n        276 .\/grub2\/i386-pc\/blscfg.mod<br \/>\n        278 .\/grub2\/i386-pc\/datetime.mod<br \/>\n        286 .\/grub2\/i386-pc\/keystatus.mod<br \/>\n        288 .\/grub2\/i386-pc\/gcry_seed.mod<br \/>\n        290 .\/grub2\/i386-pc\/gptsync.mod<br \/>\n        291 .\/grub2\/i386-pc\/part_amiga.mod<br \/>\n        292 .\/grub2\/i386-pc\/at_keyboard.mod<br \/>\n        294 .\/grub2\/i386-pc\/nativedisk.mod<br \/>\n        295 .\/grub2\/i386-pc\/png.mod<br \/>\n        296 .\/grub2\/i386-pc\/acpi.mod<br \/>\n        297 .\/grub2\/i386-pc\/gfxterm_background.mod<br \/>\n        298 .\/grub2\/i386-pc\/moddep.lst<br \/>\n        299 .\/grub2\/i386-pc\/command.lst<br \/>\n        300 .\/grub2\/i386-pc\/fs.lst<br \/>\n        302 .\/grub2\/i386-pc\/parttool.lst<br \/>\n        303 .\/grub2\/i386-pc\/video.lst<br \/>\n        304 .\/grub2\/i386-pc\/crypto.lst<br \/>\n        305 .\/grub2\/i386-pc\/terminal.lst<br \/>\n        306 .\/grub2\/i386-pc\/modinfo.sh<br \/>\n        344 .\/grub2\/i386-pc\/core.img<br \/>\n        345 .\/grub2\/i386-pc\/boot.img<br \/>\n         40 .\/grub2\/locale<br \/>\n        307 .\/grub2\/locale\/pt_BR.mo<br \/>\n        308 .\/grub2\/locale\/de.mo<br \/>\n        309 .\/grub2\/locale\/es.mo<br \/>\n        310 .\/grub2\/locale\/en@cyrillic.mo<br \/>\n        311 .\/grub2\/locale\/zh_TW.mo<br \/>\n        312 .\/grub2\/locale\/lt.mo<br \/>\n        313 .\/grub2\/locale\/eo.mo<br \/>\n        314 .\/grub2\/locale\/id.mo<br \/>\n        315 .\/grub2\/locale\/en@quot.mo<br \/>\n        316 .\/grub2\/locale\/en@hebrew.mo<br \/>\n        317 .\/grub2\/locale\/ru.mo<br \/>\n        318 .\/grub2\/locale\/fi.mo<br \/>\n        319 .\/grub2\/locale\/nl.mo<br \/>\n        320 .\/grub2\/locale\/ca.mo<br \/>\n        321 .\/grub2\/locale\/gl.mo<br \/>\n        322 .\/grub2\/locale\/ast.mo<br \/>\n        323 .\/grub2\/locale\/de_CH.mo<br \/>\n        324 .\/grub2\/locale\/en@arabic.mo<br \/>\n        325 .\/grub2\/locale\/it.mo<br \/>\n        326 .\/grub2\/locale\/fr.mo<br \/>\n        327 .\/grub2\/locale\/pa.mo<br \/>\n        328 .\/grub2\/locale\/hu.mo<br \/>\n        329 .\/grub2\/locale\/vi.mo<br \/>\n        330 .\/grub2\/locale\/de@hebrew.mo<br \/>\n        331 .\/grub2\/locale\/sv.mo<br \/>\n        332 .\/grub2\/locale\/ja.mo<br \/>\n        333 .\/grub2\/locale\/tr.mo<br \/>\n        334 .\/grub2\/locale\/en@piglatin.mo<br \/>\n        335 .\/grub2\/locale\/pl.mo<br \/>\n        336 .\/grub2\/locale\/sl.mo<br \/>\n        337 .\/grub2\/locale\/zh_CN.mo<br \/>\n        338 .\/grub2\/locale\/da.mo<br \/>\n        339 .\/grub2\/locale\/uk.mo<br \/>\n        340 .\/grub2\/locale\/en@greek.mo<br \/>\n        341 .\/grub2\/fonts<br \/>\n        342 .\/grub2\/fonts\/unicode.pf2<br \/>\n        343 .\/grub2\/grubenv<br \/>\n        346 .\/grub2\/grub.cfg<br \/>\n       8194 .\/grub<br \/>\n         15 .\/grub\/splash.xpm.gz<br \/>\n         35 .\/initramfs-3.10.0-957.el7.x86_64.img<br \/>\n         30 .\/.vmlinuz-3.10.0-957.el7.x86_64.hmac<br \/>\n         31 .\/System.map-3.10.0-957.el7.x86_64<br \/>\n         32 .\/config-3.10.0-957.el7.x86_64<br \/>\n         33 .\/symvers-3.10.0-957.el7.x86_64.gz<br \/>\n         34 .\/vmlinuz-3.10.0-957.el7.x86_64<br \/>\n         36 .\/initramfs-0-rescue-7156b93e99974f91aaaceb7593173fc4.img<br \/>\n         37 .\/vmlinuz-0-rescue-7156b93e99974f91aaaceb7593173fc4<br \/>\n        347 .\/initramfs-3.10.0-957.el7.x86_64kdump.img<br \/>\n [root@alanCentos01 opt]# <\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5e94\u7528\u6848\u4f8b3<\/p>\n<p>restore \u547d\u4ee4\u8fd8\u539f\u6a21\u5f0f\uff0c\u6ce8\u610f\u7ec6\u8282\uff1a\u5982\u679c\u4f60\u6709\u589e\u91cf\u5907\u4efd\uff0c\u9700\u8981\u628a\u589e\u91cf\u5907\u4efd\u6587\u4ef6\u4e5f\u8fdb\u884c\u6062\u590d\uff0c\u6709\u51e0\u4e2a\u589e\u91cf\u5907\u4efd\u6587\u4ef6\uff0c\u5c31\u8981\u6062\u590d\u51e0\u4e2a\uff0c\u6309\u987a\u5e8f\u6765\u6062\u590d\u5373\u53ef\u3002<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 opt]# mkdir \/opt\/boottmp<br \/>\n [root@alanCentos01 opt]# cd \/opt\/boottmp<br \/>\n [root@alanCentos01 boottmp]# restore -r -f \/opt\/boot.bak0.bz2<br \/>\n Dump tape is compressed.<br \/>\n [root@alanCentos01 boottmp]# restore -r -f \/opt\/boot.bak1.bz2<br \/>\n Dump tape is compressed.<br \/>\n [root@alanCentos01 boottmp]# ll<br \/>\n \u603b\u7528\u91cf 128428<br \/>\n -rw-r&#8211;r&#8211;. 1 root root   151918 11\u6708  9 2018 config-3.10.0-957.el7.x86_64<br \/>\n drwx&#8212;&#8212;. 3 root root     4096 11\u6708  9 2018 efi<br \/>\n drwxr-xr-x. 2 root root     4096 4\u6708   2 00:25 grub<br \/>\n drwx&#8212;&#8212;. 5 root root     4096 4\u6708   2 00:33 grub2<br \/>\n -rw&#8212;&#8212;-. 1 root root 74311607 4\u6708   2 00:31 initramfs-0-rescue-7156b93e99974f91aaaceb7593173fc4.img<br \/>\n -rw&#8212;&#8212;-. 1 root root 28926577 4\u6708   2 00:33 initramfs-3.10.0-957.el7.x86_64.img<br \/>\n -rw&#8212;&#8212;-. 1 root root 10797022 5\u6708   5 21:05 initramfs-3.10.0-957.el7.x86_64kdump.img<br \/>\n drwx&#8212;&#8212;. 2 root root     4096 4\u6708   2 00:23 lost+found<br \/>\n -rw&#8212;&#8212;-. 1 root root   145264 5\u6708   5 22:55 restoresymtable<br \/>\n -rw-r&#8211;r&#8211;. 1 root root   314036 11\u6708  9 2018 symvers-3.10.0-957.el7.x86_64.gz<br \/>\n -rw&#8212;&#8212;-. 1 root root  3543471 11\u6708  9 2018 System.map-3.10.0-957.el7.x86_64<br \/>\n -rwxr-xr-x. 1 root root  6639904 4\u6708   2 00:31 vmlinuz-0-rescue-7156b93e99974f91aaaceb7593173fc4<br \/>\n -rwxr-xr-x. 1 root root  6639904 11\u6708  9 2018 vmlinuz-3.10.0-957.el7.x86_64<br \/>\n [root@alanCentos01 boottmp]# <\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5e94\u7528\u6848\u4f8b4<\/p>\n<p>restore \u547d\u4ee4\u6062\u590d\u5907\u4efd\u7684\u6587\u4ef6\uff0c\u6216\u8005\u6574\u4e2a\u76ee\u5f55\u7684\u6587\u4ef6<\/p>\n<p>\u57fa\u672c\u8bed\u6cd5\uff1a restore -r -f \u5907\u4efd\u597d\u7684\u6587\u4ef6<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 \/]# mkdir \/opt\/etctmp<br \/>\n [root@alanCentos01 \/]# cd \/opt\/etctmp<br \/>\n [root@alanCentos01 etctmp]# restore -r -f \/opt\/etc.bak.bz2<br \/>\n Dump tape is compressed.<br \/>\n .\/lost+found: (inode 11) not found on tape<br \/>\n .\/boot: (inode 655361) not found on tape<br \/>\n .\/dev: (inode 131073) not found on tape<br \/>\n .\/proc: (inode 917505) not found on tape<br \/>\n .\/run: (inode 786433) not found on tape<br \/>\n .\/sys: (inode 262145) not found on tape<br \/>\n .\/root: (inode 524289) not found on tape<br \/>\n .\/var: (inode 393222) not found on tape<br \/>\n .\/tmp: (inode 262146) not found on tape<br \/>\n .\/P: (inode 440) not found on tape<br \/>\n .\/usr: (inode 131074) not found on tape<br \/>\n .\/bin: (inode 17) not found on tape<br \/>\n .\/sbin: (inode 16) not found on tape<br \/>\n .\/lib: (inode 13) not found on tape<br \/>\n .\/lib64: (inode 15) not found on tape<br \/>\n .\/home: (inode 917506) not found on tape<br \/>\n .\/media: (inode 524290) not found on tape<br \/>\n .\/mnt: (inode 655362) not found on tape<br \/>\n .\/opt: (inode 786434) not found on tape<br \/>\n .\/srv: (inode 524291) not found on tape<br \/>\n .\/.jetbrains: (inode 393919) not found on tape<br \/>\n .\/tmpjcef-p19572_scheme.tmp: (inode 2890) not found on tape<br \/>\n [root@alanCentos01 etctmp]# ll<br \/>\n \u603b\u7528\u91cf 2172<br \/>\n drwxr-xr-x. 144 root root   12288 5\u6708   5 21:28 etc<br \/>\n -rw&#8212;&#8212;-.   1 root root 2211664 5\u6708   5 22:59 restoresymtable<br \/>\n [root@alanCentos01 etctmp]#<\/p>\n<p>&#8220;`<br \/>\n&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<\/p>\n<p>&lt;h3&gt;\u4e8c\u5341\u516d\u3001Linux\u53ef\u89c6\u5316\u7ba1\u7406webmin\u548cbt\u8fd0\u7ef4\u5de5\u5177&lt;\/h3&gt;<\/p>\n<p>&lt;ol&gt;<br \/>\n&lt;li&gt;webmin&lt;\/li&gt;<br \/>\n&lt;\/ol&gt;<\/p>\n<p>&lt;ul&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u57fa\u672c\u4ecb\u7ecd<\/p>\n<p>Webmin \u662f\u529f\u80fd\u5f3a\u5927\u7684\u57fa\u4e8e Web \u7684 Unix\/linux \u7cfb\u7edf\u7ba1\u7406\u5de5\u5177\u3002\u7ba1\u7406\u5458\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee Webmin \u7684\u5404\u79cd\u7ba1\u7406\u529f\u80fd\u5e76\u5b8c\u6210\u76f8\u5e94\u7684\u7ba1\u7406\u64cd\u4f5c\u3002\u9664\u4e86\u5404\u7248\u672c\u7684 linux \u4ee5\u5916\u8fd8\u53ef\u7528\u4e8e\uff1aAIX\u3001HPUX\u3001Solaris\u3001Unixware\u3001Irix \u548c FreeBSD \u7b49\u7cfb\u7edf\u3002<\/p>\n<p>&lt;img src=&quot;https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210505231312859.png&quot; alt=&quot;image-20210505231312859&quot; \/&gt;&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5b89\u88c5 webmin\u548c\u914d\u7f6e<\/p>\n<p>1)\u4e0b\u8f7d\u5730\u5740 : http:\/\/download.webmin.com\/download\/yum\/<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 opt]# wget http:\/\/download.webmin.com\/download\/yum\/webmin-1.700-1.noarch.rpm<br \/>\n &#8211;2021-05-05 23:15:33&#8211;  http:\/\/download.webmin.com\/download\/yum\/webmin-1.700-1.noarch.rpm<br \/>\n \u6b63\u5728\u89e3\u6790\u4e3b\u673a download.webmin.com (download.webmin.com)&#8230; 104.207.151.13, 108.60.199.109<br \/>\n \u6b63\u5728\u8fde\u63a5 download.webmin.com (download.webmin.com)|104.207.151.13|:80&#8230; \u5df2\u8fde\u63a5\u3002<br \/>\n \u5df2\u53d1\u51fa HTTP \u8bf7\u6c42\uff0c\u6b63\u5728\u7b49\u5f85\u56de\u5e94&#8230; 200 OK<br \/>\n \u957f\u5ea6\uff1a22287607 (21M) [application\/octet-stream]<br \/>\n \u6b63\u5728\u4fdd\u5b58\u81f3: \u201cwebmin-1.700-1.noarch.rpm\u201d<\/p>\n<p>100%[<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\"><\/span><span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">>] 22,287,607  39.3KB\/s \u7528\u65f6 13m 14s<\/span><\/p>\n<p>2021-05-05 23:28:49 (27.4 KB\/s) &#8211; \u5df2\u4fdd\u5b58 \u201cwebmin-1.700-1.noarch.rpm\u201d [22287607\/22287607])<\/p>\n<p>[root@alanCentos01 opt]#<\/p>\n<p>&#8220;`<\/p>\n<p>2)\u5b89\u88c5\uff1arpm -ivh webmin-1.700-1.noarch.rpm<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 opt]# mkdir webmin<br \/>\n [root@alanCentos01 opt]# cd webmin<br \/>\n [root@alanCentos01 webmin]# mv \/opt\/webmin-1.700-1.noarch.rpm \/opt\/webmin<br \/>\n [root@alanCentos01 webmin]# ls<br \/>\n webmin-1.700-1.noarch.rpm<br \/>\n [root@alanCentos01 webmin]# rpm -ivh webmin-1.700-1.noarch.rpm<br \/>\n \u8b66\u544a\uff1awebmin-1.700-1.noarch.rpm: \u5934V3 DSA\/SHA1 Signature, \u5bc6\u94a5 ID 11f63c51: NOKEY<br \/>\n \u51c6\u5907\u4e2d&#8230;                          ################################# [100%]<br \/>\n Operating system is CentOS Linux<br \/>\n \u6b63\u5728\u5347\u7ea7\/\u5b89\u88c5&#8230;<br \/>\n    1:webmin-1.700-1                   ################################# [100%]<br \/>\n Webmin install complete. You can now login to http:\/\/alanCentos01:10000\/<br \/>\n as root with your root password.<br \/>\n [root@alanCentos01 webmin]#<\/p>\n<p>&#8220;`<\/p>\n<p>3)\u91cd\u7f6e\u5bc6\u7801\/usr\/libexec\/webmin\/changepass.pl \/etc\/webmin root test<\/p>\n<p>root \u662f webmin \u7684\u7528\u6237\u540d\uff0c\u4e0d\u662f OS \u7684 , \u8fd9\u91cc\u5c31\u662f\u628a webmin \u7684 root \u7528\u6237\u5bc6\u7801\u6539\u6210\u4e86 test<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 webmin]# \/usr\/libexec\/webmin\/changepass.pl \/etc\/webmin root test<br \/>\n Updated password of Webmin user root<br \/>\n [root@alanCentos01 webmin]#<\/p>\n<p>&#8220;`<\/p>\n<p>4)\u4fee\u6539 webmin \u670d\u52a1\u7684\u7aef\u53e3\u53f7\uff08\u9ed8\u8ba4\u662f 10000 \u51fa\u4e8e\u5b89\u5168\u76ee\u7684\uff09<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 webmin]# vim \/etc\/webmin\/miniserv.conf<\/p>\n<p>&#8220;`<\/p>\n<p>5)\u5c06 port=10000 \u4fee\u6539\u4e3a\u5176\u4ed6\u7aef\u53e3\u53f7\uff0c\u5982 port=6868<\/p>\n<p>&lt;img src=&quot;https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210505233713833.png&quot; alt=&quot;image-20210505233713833&quot; \/&gt;<\/p>\n<p>&#8220;`shell<br \/>\n port=6868<br \/>\n root=\/usr\/libexec\/webmin<br \/>\n mimetypes=\/usr\/libexec\/webmin\/mime.types<br \/>\n addtype_cgi=internal\/cgi<br \/>\n realm=Webmin Server<br \/>\n logfile=\/var\/webmin\/miniserv.log<br \/>\n errorlog=\/var\/webmin\/miniserv.error<br \/>\n pidfile=\/var\/webmin\/miniserv.pid<br \/>\n logtime=168<br \/>\n ppath=<br \/>\n ssl=0<br \/>\n env_WEBMIN_CONFIG=\/etc\/webmin<br \/>\n env_WEBMIN_VAR=\/var\/webmin<br \/>\n atboot=1<br \/>\n logout=\/etc\/webmin\/logout-flag<br \/>\n listen=6868<br \/>\n denyfile=\\.pl$<br \/>\n log=1<br \/>\n blockhost_failures=5<br \/>\n blockhost_time=60<br \/>\n syslog=1<br \/>\n session=1<br \/>\n premodules=WebminCore<br \/>\n server=MiniServ\/1.700<br \/>\n userfile=\/etc\/webmin\/miniserv.users<br \/>\n keyfile=\/etc\/webmin\/miniserv.pem<br \/>\n passwd_file=\/etc\/shadow<br \/>\n passwd_uindex=0<br \/>\n passwd_pindex=1<br \/>\n passwd_cindex=2<br \/>\n passwd_mindex=4<br \/>\n passwd_mode=0<br \/>\n preroot=gray-theme<br \/>\n passdelay=1<\/p>\n<p>&#8220;`<\/p>\n<p>6)\u91cd\u542f webmin<\/p>\n<p>\/etc\/webmin\/restart # \u91cd\u542f<\/p>\n<p>\/etc\/webmin\/start # \u542f\u52a8<\/p>\n<p>\/etc\/webmin\/stop # \u505c\u6b62<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 webmin]# \/etc\/webmin\/restart<br \/>\n Stopping Webmin server in \/usr\/libexec\/webmin<br \/>\n Starting Webmin server in \/usr\/libexec\/webmin<br \/>\n Pre-loaded WebminCore<br \/>\n [root@alanCentos01 webmin]# \/etc\/webmin\/stop<br \/>\n Stopping Webmin server in \/usr\/libexec\/webmin<br \/>\n [root@alanCentos01 webmin]# \/etc\/webmin\/start<br \/>\n Starting Webmin server in \/usr\/libexec\/webmin<br \/>\n Pre-loaded WebminCore<br \/>\n [root@alanCentos01 webmin]# <\/p>\n<p>&#8220;`<\/p>\n<p>7)\u9632\u706b\u5899\u653e\u5f00 6868 \u7aef\u53e3<\/p>\n<p>firewall-cmd &#8211;zone=public &#8211;add-port=6868\/tcp &#8211;permanent # \u914d\u7f6e\u9632\u706b\u5899\u5f00\u653e 6868\u7aef\u53e3<\/p>\n<p>firewall-cmd &#8211;reload # \u66f4\u65b0\u9632\u706b\u5899\u914d\u7f6e<\/p>\n<p>firewall-cmd &#8211;zone=public &#8211;list-ports # \u67e5\u770b\u5df2\u7ecf\u5f00\u653e\u7684\u7aef\u53e3\u53f7<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 webmin]# firewall-cmd &#8211;zone=public &#8211;add-port=6868\/tcp &#8211;permanent<br \/>\n success<br \/>\n [root@alanCentos01 webmin]# firewall-cmd &#8211;reload<br \/>\n success<br \/>\n [root@alanCentos01 webmin]# firewall-cmd &#8211;zone=public &#8211;list-ports<br \/>\n 8080\/tcp 6868\/tcp<br \/>\n [root@alanCentos01 webmin]# <\/p>\n<p>&#8220;`<\/p>\n<p>8)\u767b\u5f55 webmin<\/p>\n<p>http:\/\/ip:6868 \u53ef\u4ee5\u8bbf\u95ee\u4e86<\/p>\n<p>\u7528 root \u8d26\u53f7\u548c\u91cd\u7f6e\u7684\u65b0\u5bc6\u7801 test&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<\/p>\n<p>&lt;ol start=&quot;2&quot;&gt;<br \/>\n&lt;li&gt;bt(\u5b9d\u5854)&lt;\/li&gt;<br \/>\n&lt;\/ol&gt;<\/p>\n<p>&lt;ul&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u57fa\u672c\u4ecb\u7ecd<\/p>\n<p>bt \u5b9d\u5854 Linux \u9762\u677f\u662f\u63d0\u5347\u8fd0\u7ef4\u6548\u7387\u7684\u670d\u52a1\u5668\u7ba1\u7406\u8f6f\u4ef6\uff0c\u652f\u6301\u4e00\u952e LAMP\/LNMP\/\u96c6\u7fa4\/\u76d1\u63a7\/\u7f51\u7ad9\/FTP\/\u6570\u636e\u5e93\/JAVA \u7b49\u591a\u9879\u670d\u52a1\u5668\u7ba1\u7406\u529f\u80fd\u3002&lt;\/p&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;p&gt;\u5b89\u88c5\u548c\u4f7f\u7528<\/p>\n<p>1)\u5b89\u88c5 : yum install -y wget &amp;&amp; wget -O install.sh http:\/\/download.bt.cn\/install\/install_6.0.sh &amp;&amp; sh install.sh&lt;span class=&quot;text-highlighted-inline&quot; style=&quot;background-color: #fffd38;&quot;&gt;\uff08\u5982\u679c\u5df2\u7ecf\u5b89\u88c5wget\u53ef\u4ee5\u53bb\u6389\u524d\u9762\u7684 yum install -y wget &amp;&amp;\uff09&lt;\/span&gt;<\/p>\n<p>2)\u5b89\u88c5\u6210\u529f\u540e\u63a7\u5236\u53f0\u4f1a\u663e\u793a\u767b\u5f55\u5730\u5740\uff0c\u8d26\u6237\u5bc6\u7801\uff0c\u590d\u5236\u6d4f\u89c8\u5668\u6253\u5f00\u767b\u5f55<\/p>\n<p>&lt;img src=&quot;https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210506233925334.png&quot; alt=&quot;image-20210506233925334&quot; \/&gt;<\/p>\n<p>3)\u5982\u679c bt \u7684\u7528\u6237\u540d\uff0c\u5bc6\u7801\u5fd8\u8bb0\u4e86\uff0c\u4f7f\u7528 bt default \u53ef\u4ee5\u67e5\u770b<\/p>\n<p>&#8220;`bash<br \/>\n [root@alanCentos01 bt]# bt default<br \/>\n ==================================================================<br \/>\n BT-Panel default info!<br \/>\n ==================================================================<br \/>\n \u5916\u7f51\u9762\u677f\u5730\u5740: http:\/\/106.7.162.209:8888\/39719663<br \/>\n \u5185\u7f51\u9762\u677f\u5730\u5740: http:\/\/192.168.18.7:8888\/39719663<br \/>\n *\u4ee5\u4e0b\u4ec5\u4e3a\u521d\u59cb\u9ed8\u8ba4\u8d26\u6237\u5bc6\u7801\uff0c\u82e5\u65e0\u6cd5\u767b\u5f55\u8bf7\u6267\u884cbt\u547d\u4ee4\u91cd\u7f6e\u8d26\u6237\/\u5bc6\u7801\u767b\u5f55<br \/>\n username: ryw01nza<br \/>\n password: 8fd34f5a<br \/>\n If you cannot access the panel,<br \/>\n release the following panel port [8888] in the security group<br \/>\n \u82e5\u65e0\u6cd5\u8bbf\u95ee\u9762\u677f\uff0c\u8bf7\u68c0\u67e5\u9632\u706b\u5899\/\u5b89\u5168\u7ec4\u662f\u5426\u6709\u653e\u884c\u9762\u677f[8888]\u7aef\u53e3<br \/>\n ==================================================================<\/p>\n<p>&#8220;`\n<\/p>\n<\/li>\n<\/ul>\n<h3>\u4e8c\u5341\u4e03\u3001Linux\u5e94\u7528\u76f8\u5173<\/h3>\n<ol>\n<li>\n<p>\u5206\u6790\u65e5\u5fd7 t.log(\u8bbf\u95ee\u91cf)\uff0c\u5c06\u5404\u4e2a ip \u5730\u5740\u622a\u53d6\uff0c\u5e76\u7edf\u8ba1\u51fa\u73b0\u6b21\u6570,\u5e76\u6309\u4ece\u5927\u5230\u5c0f\u6392\u5e8f\u3002<\/p>\n<p>http:\/\/192.168.200.10\/index1.html<br \/>\nhttp:\/\/192.168.200.10\/index2.html<br \/>\nhttp:\/\/192.168.200.20\/index1.html<br \/>\nhttp:\/\/192.168.200.30\/index1.html<br \/>\nhttp:\/\/192.168.200.40\/index1.html<br \/>\nhttp:\/\/192.168.200.30\/order.html<br \/>\nhttp:\/\/192.168.200.10\/order.html<br \/>\n\u7b54\u6848: cat t.log| cut -d &#8216;\/&#8217; -f 3| sort | uniq -c | sort -nr<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim t.log\n[root@alanCentos01 home]# cat t.log\nhttp:\/\/192.168.200.10\/index1.html\nhttp:\/\/192.168.200.10\/index2.html\nhttp:\/\/192.168.200.20\/index1.html\nhttp:\/\/192.168.200.30\/index1.html\nhttp:\/\/192.168.200.40\/index1.html\nhttp:\/\/192.168.200.30\/order.html\nhttp:\/\/192.168.200.10\/order.html\n[root@alanCentos01 home]# cat t.log | cut -d '\/' -f 3 | sort | uniq -c | sort -nr\n     3 192.168.200.10\n     2 192.168.200.30\n     1 192.168.200.40\n     1 192.168.200.20\n[root@alanCentos01 home]#\n\n<\/code><\/pre>\n<\/li>\n<li>\u7edf\u8ba1\u8fde\u63a5\u5230\u670d\u52a1\u5668\u7684\u5404\u4e2a ip \u60c5\u51b5\uff0c\u5e76\u6309\u8fde\u63a5\u6570\u4ece\u5927\u5230\u5c0f\u6392\u5e8f\u3002\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# netstat -an| grep ESTABLISHED | awk -F \" \" '{print $5}' | cut -d \":\" -f 1 | sort | uniq -c| sort -nr\n     1 192.168.18.1\n[root@alanCentos01 home]#\n\n<\/code><\/pre>\n<\/li>\n<li>\u5199\u51fa\u6307\u4ee4\uff1a\u7edf\u8ba1 ip \u8bbf\u95ee\u60c5\u51b5\uff0c\u8981\u6c42\u5206\u6790 nginx \u8bbf\u95ee\u65e5\u5fd7(access.log)\uff0c\u627e\u51fa\u8bbf\u95ee\u9875\u9762\u6570\u91cf\u5728\u524d 2 \u4f4d\u7684 ip\u3002\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# cat access.log| awk -F \" \" '{print $1}' | sort | uniq -c | sort -nr | head -2\n\n<\/code><\/pre>\n<\/li>\n<li>\u4f7f\u7528 tcpdump \u76d1\u542c\u672c\u673a, \u5c06\u6765\u81ea ip 192.168.18.1\uff0ctcp \u7aef\u53e3\u4e3a 22 \u7684\u6570\u636e\uff0c\u4fdd\u5b58\u8f93\u51fa\u5230tcpdump.log , \u7528\u505a\u5c06\u6765\u6570\u636e\u5206\u6790\u3002\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# tcpdump -i ens33 host 192.168.18.1 and port 22 &gt;&gt; \/home\/tcpdump.log\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\nlistening on ens33, link-type EN10MB (Ethernet), capture size 262144 bytes\n\n<\/code><\/pre>\n<\/li>\n<li>\u5728\u8fdb\u884c Linux \u7cfb\u7edf\u6743\u9650\u5212\u5206\u65f6,\u5e94\u8003\u8651\u54ea\u4e9b\u56e0\u7d20?\n<p>1)Linux \u6743\u9650\u7684\u4e3b\u8981\u5bf9\u8c61<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509200048568.png\" alt=\"image-20210509200048568\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509200204855.png\" alt=\"image-20210509200204855\" \/><\/p>\n<p>2)\u6839\u636e\u81ea\u5df1\u5b9e\u9645\u7ecf\u9a8c\u8c08\u8003\u8651\u56e0\u7d20<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u6ce8\u610f\u6743\u9650\u5206\u79bb\uff0c\u6bd4\u5982: \u5de5\u4f5c\u4e2d\uff0cLinux \u7cfb\u7edf\u6743\u9650\u548c\u6570\u636e\u5e93\u6743\u9650\u4e0d\u8981\u5728\u540c\u4e00\u4e2a\u90e8\u95e8\uff1b<\/p>\n<\/li>\n<li>\n<p>\u6743\u9650\u6700\u5c0f\u539f\u5219(\u5373:\u5728\u6ee1\u8db3\u4f7f\u7528\u7684\u60c5\u51b5\u4e0b\u6700\u5c11\u4f18\u5148)\uff1b<\/p>\n<\/li>\n<li>\n<p>\u51cf\u5c11\u4f7f\u7528 root \u7528\u6237\uff0c\u5c3d\u91cf\u7528\u666e\u901a\u7528\u6237+sudo \u63d0\u6743\u8fdb\u884c\u65e5\u5e38\u64cd\u4f5c\uff1b<\/p>\n<\/li>\n<li>\n<p>\u91cd\u8981\u7684\u7cfb\u7edf\u6587\u4ef6\uff0c\u6bd4\u5982\/etc\/passwd\uff0c\/etc\/shadowetc\/fstab\uff0c\/etc\/sudoers \u7b49\uff0c\u65e5\u5e38\u5efa\u8bae\u4f7f\u7528 chattr(change attribute)\u9501\u5b9a\uff0c\u9700\u8981\u64cd\u4f5c\u65f6\u518d\u6253\u5f00\u3010\u6bd4\u5982:\u9501\u5b9a \/etc\/passwd \u8ba9\u4efb\u4f55\u7528\u6237\u90fd\u4e0d\u80fd\u968f\u610f useradd\uff0c\u9664\u975e\u89e3\u9664\u9501\u5b9a\u3011\uff1b<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528 SUID, SGID, Sticky \u8bbe\u7f6e\u7279\u6b8a\u6743\u9650\uff1b<\/p>\n<\/li>\n<li>\n<p>\u53ef\u4ee5\u5229\u7528\u5de5\u5177\uff0c\u6bd4\u5982 chkrootkit\/rootkit hunter \u68c0\u6d4b rootkit \u811a\u672c\uff08rootkit \u662f\u5165\u4fb5\u8005\u4f7f\u7528\u5de5\u5177,\u5728\u4e0d\u5bdf\u89c9\u7684\u5efa\u7acb\u4e86\u5165\u4fb5\u7cfb\u7edf\u9014\u5f84\uff09 \u3010\u4f7f\u7528wgetftp:\/\/ftp.pangeia.com.br\/pub\/seg\/pac\/chkrootkit.tar.gz\u3011\uff1b<\/p>\n<\/li>\n<li>\n<p>\u5229\u7528\u5de5\u5177 Tripwire \u68c0\u6d4b\u6587\u4ef6\u7cfb\u7edf\u5b8c\u6574\u6027<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509200611309.png\" alt=\"image-20210509200611309\" \/><\/p>\n<\/li>\n<\/ul>\n<ol start=\"6\">\n<li>\u6743\u9650\u64cd\u4f5c\u601d\u8003<\/li>\n<\/ol>\n<ul>\n<li>\u7528\u6237 tom \u5bf9\u76ee\u5f55 \/home\/test \u6709\u6267\u884c x \u548c\u8bfb r \u5199 w \u6743\u9650\uff0c\/home\/test\/hello.java \u662f\u53ea\u8bfb\u6587\u4ef6\uff0c\u95ee tom \u5bf9 hello.java \u6587\u4ef6\u80fd\u8bfb\u5417(ok)\uff1f\u80fd\u4fee\u6539\u5417(no)\uff1f\u80fd\u5220\u9664\u5417\uff1f(ok)<\/li>\n<li>\u7528\u6237tom \u5bf9\u76ee\u5f55 \/home\/test \u53ea\u6709\u8bfb\u5199\u6743\u9650\uff0c\/home\/test\/hello.java \u662f\u53ea\u8bfb\u6587\u4ef6\uff0c\u95eetom\u5bf9 hello.java\u6587\u4ef6\u80fd\u8bfb\u5417(no)\uff1f\u80fd\u4fee\u6539\u5417(no)\uff1f\u80fd\u5220\u9664\u5417(no)\uff1f<\/li>\n<li>\u7528\u6237 tom \u5bf9\u76ee\u5f55 \/home\/test \u53ea\u6709\u6267\u884c\u6743\u9650 x\uff0c\/home\/test\/hello.java \u662f\u53ea\u8bfb\u6587\u4ef6\uff0c\u95ee tom \u5bf9 hello.java \u6587\u4ef6\u80fd\u8bfb\u5417(ok)\uff1f\u80fd\u4fee\u6539\u5417(no)\uff1f\u80fd\u5220\u9664\u5417(no)\uff1f<\/li>\n<li>\u7528\u6237 tom \u5bf9\u76ee\u5f55 \/home\/test \u53ea\u6709\u6267\u884c\u548c\u5199\u6743\u9650\uff0c\/home\/test\/hello.java \u662f\u53ea\u8bfb\u6587\u4ef6\uff0c\u95ee tom \u5bf9 hello.java \u6587\u4ef6\u80fd\u8bfb\u5417(ok)\uff1f\u80fd\u4fee\u6539\u5417(no)\uff1f\u80fd\u5220\u9664(ok)\uff1f<\/li>\n<\/ul>\n<ol start=\"7\">\n<li>\n<p>\u5217\u4e3e Linux \u9ad8\u7ea7\u547d\u4ee4\uff0c\u81f3\u5c11 6 \u4e2a<\/p>\n<p>netstat \/\/\u7f51\u7edc\u72b6\u6001\u76d1\u63a7<\/p>\n<p>top \/\/\u7cfb\u7edf\u8fd0\u884c\u72b6\u6001<\/p>\n<p>lsblk \/\/\u67e5\u770b\u786c\u76d8\u5206\u533a<\/p>\n<p>find<\/p>\n<p>ps -aux \/\/\u67e5\u770b\u8fd0\u884c\u8fdb\u7a0b<\/p>\n<p>chkconfig \/\/\u67e5\u770b\u670d\u52a1\u542f\u52a8\u72b6\u6001<\/p>\n<p>systemctl \/\/\u7ba1\u7406\u7cfb\u7edf\u670d\u52a1\u5668<\/p>\n<\/li>\n<li>\n<p>Linux \u67e5\u770b\u5185\u5b58\u3001io \u8bfb\u5199\u3001\u78c1\u76d8\u5b58\u50a8\u3001\u7aef\u53e3\u5360\u7528\u3001\u8fdb\u7a0b\u67e5\u770b\u547d\u4ee4\u662f\u4ec0\u4e48\uff1f<\/p>\n<p>top, iotop, df -lh , netstat -tunlp , ps -aux | grep \u5173\u5fc3\u7684\u8fdb\u7a0b<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528 Linux \u547d\u4ee4\u8ba1\u7b97 t2.txt \u7b2c\u4e8c\u5217\u7684\u548c\u5e76\u8f93\u51fa\u3002<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim t2.txt\n[root@alanCentos01 home]# cat t2.txt | awk -F \" \" '{sum+=$2} END {print sum}'\n150\n\n<\/code><\/pre>\n<\/li>\n<li>Shell \u811a\u672c\u91cc\u5982\u4f55\u68c0\u67e5\u4e00\u4e2a\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff1f\u5e76\u7ed9\u51fa\u63d0\u793a\u3002\n<p>if [ -f \u6587\u4ef6\u540d ] then echo \u201c\u5b58\u5728\u201d else echo \u201c\u4e0d\u5b58\u5728\u201d fi<\/p>\n<\/li>\n<li>\n<p>\u7528 shell \u5199\u4e00\u4e2a\u811a\u672c\uff0c\u5bf9\u6587\u672c t3.txt \u4e2d\u65e0\u5e8f\u7684\u4e00\u5217\u6570\u5b57\u6392\u5e8f, \u5e76\u5c06\u603b\u548c\u8f93\u51fa\u3002<\/p>\n<p>9<\/p>\n<p>8<\/p>\n<p>7<\/p>\n<p>6<\/p>\n<p>5<\/p>\n<p>4<\/p>\n<p>3<\/p>\n<p>2<\/p>\n<p>10<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# vim t3.txt\n[root@alanCentos01 home]# sort -nr t3.txt | awk '{sum+=<span class=\"katex math inline\">0; print<\/span>0} END {print \"\u548c=\"sum}'\n10\n9\n8\n7\n6\n5\n4\n3\n2\n\u548c=54\n[root@alanCentos01 home]#\n\n<\/code><\/pre>\n<\/li>\n<li>\u8bf7\u7528\u6307\u4ee4\u5199\u51fa\u67e5\u627e\u5f53\u524d\u6587\u4ef6\u5939\uff08\/home\uff09\u4e0b\u6240\u6709\u7684\u6587\u672c\u6587\u4ef6\u5185\u5bb9\u4e2d\u5305\u542b\u6709\u5b57\u7b26 \u201ccat\u201d\u7684\u6587\u4ef6\u540d\u79f0\u3002\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# grep -r \"cat\" \/home |cut -d \":\" -f 1\n\/home\/IdeaProjects\/test\/.idea\/workspace.xml\n\/home\/IdeaProjects\/test\/.idea\/workspace.xml\n\/home\/IdeaProjects\/test\/.idea\/workspace.xml\n\/home\/IdeaProjects\/test\/.idea\/workspace.xml\n\/home\/var.sh\n[root@alanCentos01 home]#\n\n<\/code><\/pre>\n<\/li>\n<li>\u8bf7\u5199\u51fa\u7edf\u8ba1\/home \u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u4e2a\u6570\u548c\u6240\u6709\u6587\u4ef6\u603b\u884c\u6570\u7684\u6307\u4ee4\u3002\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 home]# find \/home -name \"*.*\"| wc -l\n49\n[root@alanCentos01 home]# find \/home -name \"*.*\"| xargs wc -l\n     12 \/home\/info.txt\n      7 \/home\/IdeaProjects\/test\/out\/production\/hello\/com\/test\/Hello.class\nwc: \/home\/IdeaProjects\/test\/.idea: \u662f\u4e00\u4e2a\u76ee\u5f55\n      0 \/home\/IdeaProjects\/test\/.idea\n      5 \/home\/IdeaProjects\/test\/.idea\/misc.xml\n     73 \/home\/IdeaProjects\/test\/.idea\/workspace.xml\n      7 \/home\/IdeaProjects\/test\/.idea\/modules.xml\n      0 \/home\/IdeaProjects\/test\/.idea\/.name\n      8 \/home\/IdeaProjects\/test\/.idea\/.gitignore\n      8 \/home\/IdeaProjects\/test\/src\/com\/test\/Hello.java\n     10 \/home\/IdeaProjects\/test\/hello.iml\n     14 \/home\/getSum.sh\n      3 \/home\/cat.txt\n     11 \/home\/testWhile.sh\n      7 \/home\/testRead.sh\n      3 \/home\/t2.txt\n      5 \/home\/position.sh\n      0 \/home\/orange.txt\n      0 \/home\/apple.txt\n      3 \/home\/dog.txt\n     11 \/home\/zwj\/.bashrc\n     12 \/home\/zwj\/.bash_profile\nwc: \/home\/zwj\/.mozilla: \u662f\u4e00\u4e2a\u76ee\u5f55\n      0 \/home\/zwj\/.mozilla\n      2 \/home\/zwj\/.bash_logout\n     13 \/home\/testFor1.sh\n     12 \/home\/tcpdump.log\n     11 \/home\/fox\/.bashrc\n     12 \/home\/fox\/.bash_profile\nwc: \/home\/fox\/.mozilla: \u662f\u4e00\u4e2a\u76ee\u5f55\n      0 \/home\/fox\/.mozilla\n      2 \/home\/fox\/.bash_logout\n      5 \/home\/myshell.sh\n      8 \/home\/Hello.java\n      9 \/home\/ifCase.sh\n     11 \/home\/alan\/.bashrc\nwc: \/home\/alan\/.config: \u662f\u4e00\u4e2a\u76ee\u5f55\n      0 \/home\/alan\/.config\n     12 \/home\/alan\/.bash_profile\n     23 \/home\/alan\/.bash_history\nwc: \/home\/alan\/.mozilla: \u662f\u4e00\u4e2a\u76ee\u5f55\n      0 \/home\/alan\/.mozilla\nwc: \/home\/alan\/.cache: \u662f\u4e00\u4e2a\u76ee\u5f55\n      0 \/home\/alan\/.cache\n      2 \/home\/alan\/.bash_logout\n      1 \/home\/alan\/.Xauthority\n      7 \/home\/t.log\n     21 \/home\/ifdemo.sh\n     13 \/home\/testCase.sh\n      6 \/home\/preVar.sh\n     23 \/home\/var.sh\n      8 \/home\/Hello.class\n      9 \/home\/t3.txt\n      1 \/home\/hello.txt\n     10 \/home\/testFor2.sh\n    420 \u603b\u7528\u91cf\n[root@alanCentos01 home]# \n\n<\/code><\/pre>\n<\/li>\n<li>18\u6bcf\u5929\u665a\u4e0a 8 \u70b9 30 \u5206\uff0c\u6253\u5305\u7ad9\u70b9\u76ee\u5f55\/var\/spool\/mail \u5907\u4efd\u5230\/home \u76ee\u5f55\u4e0b\uff08\u6bcf\u6b21\u5907\u4efd\u6309\u65f6\u95f4\u751f\u6210\u4e0d\u540c\u7684\u5907\u4efd\u5305 \u6bd4\u5982\u6309\u7167 \u5e74\u6708\u65e5\u65f6\u5206\u79d2\uff09\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509202645103.png\" alt=\"image-20210509202645103\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509202714563.png\" alt=\"image-20210509202714563\" \/><\/p>\n<\/li>\n<li>\n<p>\u5982\u4f55\u4f18\u5316 Linux \u7cfb\u7edf\uff1f<\/p>\n<p>(1) \u4e0d\u7528 root ,\u4f7f\u7528 sudo \u63d0\u793a\u6743\u9650<\/p>\n<p>(2) \u5b9a\u65f6\u7684\u81ea\u52a8\u66f4\u65b0\u670d\u52a1\u65f6\u95f4,\u4f7f\u7528 nptdate npt1.aliyun.com , \u8ba9 croud \u5b9a\u65f6\u66f4\u65b0<\/p>\n<p>(3) \u914d\u7f6e yum \u6e90\uff0c\u6307\u5411\u56fd\u5185\u955c\u50cf(\u6e05\u534e\uff0c163)<\/p>\n<p>(4) \u914d\u7f6e\u5408\u7406\u7684\u9632\u706b\u5899\u7b56\u7565,\u6253\u5f00\u5fc5\u8981\u7684\u7aef\u53e3\uff0c\u5173\u95ed\u4e0d\u5fc5\u8981\u7684\u7aef\u53e3<\/p>\n<p>(5) \u6253\u5f00\u6700\u5927\u6587\u4ef6\u6570(\u8c03\u6574\u6587\u4ef6\u7684\u63cf\u8ff0\u7684\u6570\u91cf) vim \/etc\/profile ulimit -SHn 65535<\/p>\n<p>(6) \u914d\u7f6e\u5408\u7406\u7684\u76d1\u63a7\u7b56\u7565<\/p>\n<p>(7) \u914d\u7f6e\u5408\u7406\u7684\u7cfb\u7edf\u91cd\u8981\u6587\u4ef6\u7684\u5907\u4efd\u7b56\u7565<\/p>\n<p>(8) \u5bf9\u5b89\u88c5\u7684\u8f6f\u4ef6\u8fdb\u884c\u4f18\u5316\uff0c\u6bd4\u5982 nginx ,apache<\/p>\n<p>(9) \u5185\u6838\u53c2\u6570\u8fdb\u884c\u4f18\u5316 \/etc\/sysctl.conf<\/p>\n<p>(10) \u9501\u5b9a\u4e00\u4e9b\u91cd\u8981\u7684\u7cfb\u7edf\u6587\u4ef6 chattr \/etc\/passwd \/ect\/shadow \/etc\/inittab<\/p>\n<p>(11) \u7981\u7528\u4e0d\u5fc5\u8981\u7684\u670d\u52a1 setup , ntsysv<\/p>\n<\/li>\n<\/ol>\n<h3>\u4e8c\u5341\u516b\u3001Linux\u865a\u62df\u673a(VM)\u6269\u5bb9<\/h3>\n<ol>\n<li>\n<p>VM\u4e0a\u4fee\u6539\u78c1\u76d8\u4fe1\u606f\uff0c\u5c06\u865a\u62df\u673a\u5173\u673a\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509230340098.png\" alt=\"image-20210509230340098\" \/><\/p>\n<p>\u4e4b\u540e\u4f1a\u6536\u5230\u63d0\u793a\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509230409586.png\" alt=\"image-20210509230409586\" \/><\/p>\n<\/li>\n<li>\n<p>\u5f00\u542f\u865a\u62df\u673a\u5e76\u767b\u5f55\u540e\uff0c\u4f7f\u7528\u547d\u4ee4\u67e5\u770b\u5f53\u78c1\u76d8\u72b6\u6001\uff0c\u53ef\u770b\u5230\u5f53\u524d\u8fd8\u662f\u539f\u672c\u768420G\uff0c\u5e76\u672a\u6269\u5bb9\u3002<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# df -h\n\u6587\u4ef6\u7cfb\u7edf        \u5bb9\u91cf  \u5df2\u7528  \u53ef\u7528 \u5df2\u7528% \u6302\u8f7d\u70b9\n\/dev\/sda3        17G   13G  3.7G   78% \/\ndevtmpfs        895M     0  895M    0% \/dev\ntmpfs           910M     0  910M    0% \/dev\/shm\ntmpfs           910M   11M  900M    2% \/run\ntmpfs           910M     0  910M    0% \/sys\/fs\/cgroup\n\/dev\/sda1       976M  144M  766M   16% \/boot\n.host:\/         601G  400G  201G   67% \/mnt\/hgfs\ntmpfs           182M  8.0K  182M    1% \/run\/user\/42\ntmpfs           182M     0  182M    0% \/run\/user\/0\n[root@alanCentos01 ~]#\n\n<\/code><\/pre>\n<\/li>\n<li>\u67e5\u770b\u5230\u65b0\u78c1\u76d8\u7684\u5206\u533a\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# fdisk -l\n\n\u78c1\u76d8 \/dev\/sda\uff1a53.7 GB, 53687091200 \u5b57\u8282\uff0c104857600 \u4e2a\u6247\u533a\nUnits = \u6247\u533a of 1 * 512 = 512 bytes\n\u6247\u533a\u5927\u5c0f(\u903b\u8f91\/\u7269\u7406)\uff1a512 \u5b57\u8282 \/ 512 \u5b57\u8282\nI\/O \u5927\u5c0f(\u6700\u5c0f\/\u6700\u4f73)\uff1a512 \u5b57\u8282 \/ 512 \u5b57\u8282\n\u78c1\u76d8\u6807\u7b7e\u7c7b\u578b\uff1ados\n\u78c1\u76d8\u6807\u8bc6\u7b26\uff1a0x000ce340\n\n  \u8bbe\u5907 Boot      Start         End      Blocks   Id  System\n\/dev\/sda1   *        2048     2099199     1048576   83  Linux\n\/dev\/sda2         2099200     6293503     2097152   82  Linux swap \/ Solaris\n\/dev\/sda3         6293504    41936895    17821696   83  Linux\n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<\/li>\n<li>\u7136\u540e\u5bf9\u65b0\u52a0\u7684\u78c1\u76d8\u8fdb\u884c\u5206\u533a\u64cd\u4f5c\uff0c<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u8bb0\u4f4f\u6839\u5206\u533a\u8d77\u59cb\u4f4d\u7f6e\u548c\u7ed3\u675f\u4f4d\u7f6e<\/span>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509225240775.png\" alt=\"image-20210509225240775\" \/><\/p>\n<\/li>\n<li>\n<p>\u5220\u9664\u6839\u5206\u533a\uff0c<span class=\"text-highlighted-inline\" style=\"background-color: #fffd38;\">\u5207\u8bb0\u4e0d\u8981\u4fdd\u5b58<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509225323631.png\" alt=\"image-20210509225323631\" \/><\/p>\n<\/li>\n<li>\n<p>\u521b\u5efa\u5206\u533a\uff0c\u7bad\u5934\u4f4d\u7f6e\u4e3a\u5206\u533a\u8d77\u59cb\u4f4d\u7f6e<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509230900174.png\" alt=\"image-20210509230900174\" \/><\/p>\n<\/li>\n<li>\n<p>\u4fdd\u5b58\u9000\u51fa<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/alan-lou2020\/markdown_doc\/raw\/master\/assets\/CentOS7.6\u8be6\u7ec6\u8bf4\u660e\/image-20210509225540710.png\" alt=\"image-20210509225540710\" \/><\/p>\n<\/li>\n<li>\n<p>\u5237\u65b0\u5206\u533a<\/p>\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# partprobe \/dev\/sda\n\n<\/code><\/pre>\n<\/li>\n<li>\u67e5\u770b\u5206\u533a\u72b6\u6001\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# lsblk\nNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT\nsda      8:0    0   50G  0 disk \n\u251c\u2500sda1   8:1    0    1G  0 part \/boot\n\u251c\u2500sda2   8:2    0    2G  0 part [SWAP]\n\u2514\u2500sda3   8:3    0   47G  0 part \/\nsr0     11:0    1  4.3G  0 rom  \/run\/media\/root\/CentOS 7 x86_64\n[root@alanCentos01 ~]# df -h\n\u6587\u4ef6\u7cfb\u7edf        \u5bb9\u91cf  \u5df2\u7528  \u53ef\u7528 \u5df2\u7528% \u6302\u8f7d\u70b9\n\/dev\/sda3        17G   13G  3.7G   78% \/\ndevtmpfs        895M     0  895M    0% \/dev\ntmpfs           910M     0  910M    0% \/dev\/shm\ntmpfs           910M   11M  900M    2% \/run\ntmpfs           910M     0  910M    0% \/sys\/fs\/cgroup\n\/dev\/sda1       976M  144M  766M   16% \/boot\n.host:\/         601G  400G  201G   67% \/mnt\/hgfs\ntmpfs           182M  4.0K  182M    1% \/run\/user\/42\ntmpfs           182M   28K  182M    1% \/run\/user\/0\n\/dev\/sr0        4.3G  4.3G     0  100% \/run\/media\/root\/CentOS 7 x86_64\n\n<\/code><\/pre>\n<\/li>\n<li>\u5237\u65b0\u6839\u5206\u533a\u5e76\u67e5\u770b\u72b6\u6001\n<pre><code class=\"language-bash line-numbers\">[root@alanCentos01 ~]# resize2fs \/dev\/sda3\nresize2fs 1.42.9 (28-Dec-2013)\nFilesystem at \/dev\/sda3 is mounted on \/; on-line resizing required\nold_desc_blocks = 3, new_desc_blocks = 6\nThe filesystem on \/dev\/sda3 is now 12320512 blocks long.\n\n[root@alanCentos01 ~]# df -h\n\u6587\u4ef6\u7cfb\u7edf        \u5bb9\u91cf  \u5df2\u7528  \u53ef\u7528 \u5df2\u7528% \u6302\u8f7d\u70b9\n\/dev\/sda3        47G   13G   32G   28% \/\ndevtmpfs        895M     0  895M    0% \/dev\ntmpfs           910M     0  910M    0% \/dev\/shm\ntmpfs           910M   11M  900M    2% \/run\ntmpfs           910M     0  910M    0% \/sys\/fs\/cgroup\n\/dev\/sda1       976M  144M  766M   16% \/boot\n.host:\/         601G  400G  201G   67% \/mnt\/hgfs\ntmpfs           182M  4.0K  182M    1% \/run\/user\/42\ntmpfs           182M   28K  182M    1% \/run\/user\/0\n\/dev\/sr0        4.3G  4.3G     0  100% \/run\/media\/root\/CentOS 7 x86_64\n[root@alanCentos01 ~]# \n\n<\/code><\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001Linux\u76ee\u5f55\u7ed3\u6784 \/bin\uff1a\u662f Binary \u7684\u7f29\u5199, \u8fd9\u4e2a\u76ee\u5f55\u5b58\u653e\u7740\u6700\u7ecf\u5e38\u4f7f\u7528\u7684\u547d\u4ee4\u3002[\u5e38\u7528] \/sb &#8230; <a title=\"CentOS7.6\u8be6\u7ec6\u8bf4\u660e\" class=\"read-more\" href=\"http:\/\/www.ooboou.com\/?p=508\" aria-label=\"\u9605\u8bfb CentOS7.6\u8be6\u7ec6\u8bf4\u660e\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[20],"class_list":["post-508","post","type-post","status-publish","format-standard","hentry","category-centos","tag-centos"],"_links":{"self":[{"href":"http:\/\/www.ooboou.com\/index.php?rest_route=\/wp\/v2\/posts\/508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ooboou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ooboou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ooboou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ooboou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=508"}],"version-history":[{"count":4,"href":"http:\/\/www.ooboou.com\/index.php?rest_route=\/wp\/v2\/posts\/508\/revisions"}],"predecessor-version":[{"id":512,"href":"http:\/\/www.ooboou.com\/index.php?rest_route=\/wp\/v2\/posts\/508\/revisions\/512"}],"wp:attachment":[{"href":"http:\/\/www.ooboou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ooboou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=508"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ooboou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}