{"id":93,"date":"2019-02-10T17:42:20","date_gmt":"2019-02-10T09:42:20","guid":{"rendered":"http:\/\/b.yesiyu.top\/?p=93"},"modified":"2019-02-10T17:43:04","modified_gmt":"2019-02-10T09:43:04","slug":"linux-%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e8%bf%87%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/b.yesiyu.top\/?p=93","title":{"rendered":"Linux \u7cfb\u7edf\u542f\u52a8\u8fc7\u7a0b"},"content":{"rendered":"<div class=\"article-body\">\n<div id=\"content\" class=\"article-intro\">\n<h1><span class=\"color_h1\">Linux\u00a0<\/span>\u7cfb\u7edf\u542f\u52a8\u8fc7\u7a0b<\/h1>\n<p>linux\u542f\u52a8\u65f6\u6211\u4eec\u4f1a\u770b\u5230\u8bb8\u591a\u542f\u52a8\u4fe1\u606f\u3002<\/p>\n<p>Linux\u7cfb\u7edf\u7684\u542f\u52a8\u8fc7\u7a0b\u5e76\u4e0d\u662f\u5927\u5bb6\u60f3\u8c61\u4e2d\u7684\u90a3\u4e48\u590d\u6742\uff0c\u5176\u8fc7\u7a0b\u53ef\u4ee5\u5206\u4e3a5\u4e2a\u9636\u6bb5\uff1a<\/p>\n<ul>\n<li>\u5185\u6838\u7684\u5f15\u5bfc\u3002<\/li>\n<li>\u8fd0\u884c init\u3002<\/li>\n<li>\u7cfb\u7edf\u521d\u59cb\u5316\u3002<\/li>\n<li>\u5efa\u7acb\u7ec8\u7aef \u3002<\/li>\n<li>\u7528\u6237\u767b\u5f55\u7cfb\u7edf\u3002<\/li>\n<\/ul>\n<blockquote><p>init\u7a0b\u5e8f\u7684\u7c7b\u578b\uff1a<\/p>\n<ul>\n<li><strong>SysV:<\/strong>\u00a0init, CentOS 5\u4e4b\u524d, \u914d\u7f6e\u6587\u4ef6\uff1a \/etc\/inittab\u3002<\/li>\n<li><strong>Upstart:<\/strong>\u00a0init,CentOS 6, \u914d\u7f6e\u6587\u4ef6\uff1a \/etc\/inittab, \/etc\/init\/*.conf\u3002<\/li>\n<li><strong>Systemd\uff1a<\/strong>\u00a0systemd, CentOS 7,\u914d\u7f6e\u6587\u4ef6\uff1a \/usr\/lib\/systemd\/system\u3001 \/etc\/systemd\/system\u3002<\/li>\n<\/ul>\n<\/blockquote>\n<hr \/>\n<h2>\u5185\u6838\u5f15\u5bfc<\/h2>\n<p>\u5f53\u8ba1\u7b97\u673a\u6253\u5f00\u7535\u6e90\u540e\uff0c\u9996\u5148\u662fBIOS\u5f00\u673a\u81ea\u68c0\uff0c\u6309\u7167BIOS\u4e2d\u8bbe\u7f6e\u7684\u542f\u52a8\u8bbe\u5907\uff08\u901a\u5e38\u662f\u786c\u76d8\uff09\u6765\u542f\u52a8\u3002<\/p>\n<p>\u64cd\u4f5c\u7cfb\u7edf\u63a5\u7ba1\u786c\u4ef6\u4ee5\u540e\uff0c\u9996\u5148\u8bfb\u5165 \/boot \u76ee\u5f55\u4e0b\u7684\u5185\u6838\u6587\u4ef6\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/bg2013081702.png\" \/><\/p>\n<hr \/>\n<h2>\u8fd0\u884cinit<\/h2>\n<p>init \u8fdb\u7a0b\u662f\u7cfb\u7edf\u6240\u6709\u8fdb\u7a0b\u7684\u8d77\u70b9\uff0c\u4f60\u53ef\u4ee5\u628a\u5b83\u6bd4\u62df\u6210\u7cfb\u7edf\u6240\u6709\u8fdb\u7a0b\u7684\u8001\u7956\u5b97\uff0c\u6ca1\u6709\u8fd9\u4e2a\u8fdb\u7a0b\uff0c\u7cfb\u7edf\u4e2d\u4efb\u4f55\u8fdb\u7a0b\u90fd\u4e0d\u4f1a\u542f\u52a8\u3002<\/p>\n<p>init \u7a0b\u5e8f\u9996\u5148\u662f\u9700\u8981\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6 \/etc\/inittab\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/bg2013081703.png\" \/><\/p>\n<h3>\u8fd0\u884c\u7ea7\u522b<\/h3>\n<p>\u8bb8\u591a\u7a0b\u5e8f\u9700\u8981\u5f00\u673a\u542f\u52a8\u3002\u5b83\u4eec\u5728Windows\u53eb\u505a&#8221;\u670d\u52a1&#8221;\uff08service\uff09\uff0c\u5728Linux\u5c31\u53eb\u505a&#8221;\u5b88\u62a4\u8fdb\u7a0b&#8221;\uff08daemon\uff09\u3002<\/p>\n<p>init\u8fdb\u7a0b\u7684\u4e00\u5927\u4efb\u52a1\uff0c\u5c31\u662f\u53bb\u8fd0\u884c\u8fd9\u4e9b\u5f00\u673a\u542f\u52a8\u7684\u7a0b\u5e8f\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u4e0d\u540c\u7684\u573a\u5408\u9700\u8981\u542f\u52a8\u4e0d\u540c\u7684\u7a0b\u5e8f\uff0c\u6bd4\u5982\u7528\u4f5c\u670d\u52a1\u5668\u65f6\uff0c\u9700\u8981\u542f\u52a8Apache\uff0c\u7528\u4f5c\u684c\u9762\u5c31\u4e0d\u9700\u8981\u3002<\/p>\n<p>Linux\u5141\u8bb8\u4e3a\u4e0d\u540c\u7684\u573a\u5408\uff0c\u5206\u914d\u4e0d\u540c\u7684\u5f00\u673a\u542f\u52a8\u7a0b\u5e8f\uff0c\u8fd9\u5c31\u53eb\u505a&#8221;\u8fd0\u884c\u7ea7\u522b&#8221;\uff08runlevel\uff09\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u542f\u52a8\u65f6\u6839\u636e&#8221;\u8fd0\u884c\u7ea7\u522b&#8221;\uff0c\u786e\u5b9a\u8981\u8fd0\u884c\u54ea\u4e9b\u7a0b\u5e8f\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/bg2013081704.png\" \/><\/p>\n<p>Linux\u7cfb\u7edf\u67097\u4e2a\u8fd0\u884c\u7ea7\u522b(runlevel)\uff1a<\/p>\n<ul>\n<li>\u8fd0\u884c\u7ea7\u522b0\uff1a\u7cfb\u7edf\u505c\u673a\u72b6\u6001\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u8fd0\u884c\u7ea7\u522b\u4e0d\u80fd\u8bbe\u4e3a0\uff0c\u5426\u5219\u4e0d\u80fd\u6b63\u5e38\u542f\u52a8<\/li>\n<li>\u8fd0\u884c\u7ea7\u522b1\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<\/li>\n<li>\u8fd0\u884c\u7ea7\u522b2\uff1a\u591a\u7528\u6237\u72b6\u6001(\u6ca1\u6709NFS)<\/li>\n<li>\u8fd0\u884c\u7ea7\u522b3\uff1a\u5b8c\u5168\u7684\u591a\u7528\u6237\u72b6\u6001(\u6709NFS)\uff0c\u767b\u9646\u540e\u8fdb\u5165\u63a7\u5236\u53f0\u547d\u4ee4\u884c\u6a21\u5f0f<\/li>\n<li>\u8fd0\u884c\u7ea7\u522b4\uff1a\u7cfb\u7edf\u672a\u4f7f\u7528\uff0c\u4fdd\u7559<\/li>\n<li>\u8fd0\u884c\u7ea7\u522b5\uff1aX11\u63a7\u5236\u53f0\uff0c\u767b\u9646\u540e\u8fdb\u5165\u56fe\u5f62GUI\u6a21\u5f0f<\/li>\n<li>\u8fd0\u884c\u7ea7\u522b6\uff1a\u7cfb\u7edf\u6b63\u5e38\u5173\u95ed\u5e76\u91cd\u542f\uff0c\u9ed8\u8ba4\u8fd0\u884c\u7ea7\u522b\u4e0d\u80fd\u8bbe\u4e3a6\uff0c\u5426\u5219\u4e0d\u80fd\u6b63\u5e38\u542f\u52a8<\/li>\n<\/ul>\n<hr \/>\n<h2>\u7cfb\u7edf\u521d\u59cb\u5316<\/h2>\n<p>\u5728init\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u6709\u8fd9\u4e48\u4e00\u884c\uff1a si::sysinit:\/etc\/rc.d\/rc.sysinit\u3000\u5b83\u8c03\u7528\u6267\u884c\u4e86\/etc\/rc.d\/rc.sysinit\uff0c\u800crc.sysinit\u662f\u4e00\u4e2abash shell\u7684\u811a\u672c\uff0c\u5b83\u4e3b\u8981\u662f\u5b8c\u6210\u4e00\u4e9b\u7cfb\u7edf\u521d\u59cb\u5316\u7684\u5de5\u4f5c\uff0crc.sysinit\u662f\u6bcf\u4e00\u4e2a\u8fd0\u884c\u7ea7\u522b\u90fd\u8981\u9996\u5148\u8fd0\u884c\u7684\u91cd\u8981\u811a\u672c\u3002<\/p>\n<p>\u5b83\u4e3b\u8981\u5b8c\u6210\u7684\u5de5\u4f5c\u6709\uff1a\u6fc0\u6d3b\u4ea4\u6362\u5206\u533a\uff0c\u68c0\u67e5\u78c1\u76d8\uff0c\u52a0\u8f7d\u786c\u4ef6\u6a21\u5757\u4ee5\u53ca\u5176\u5b83\u4e00\u4e9b\u9700\u8981\u4f18\u5148\u6267\u884c\u4efb\u52a1\u3002<\/p>\n<pre class=\"prettyprint\">l5:5:wait:\/etc\/rc.d\/rc 5\r\n<\/pre>\n<p>\u8fd9\u4e00\u884c\u8868\u793a\u4ee55\u4e3a\u53c2\u6570\u8fd0\u884c\/etc\/rc.d\/rc\uff0c\/etc\/rc.d\/rc\u662f\u4e00\u4e2aShell\u811a\u672c\uff0c\u5b83\u63a5\u53d75\u4f5c\u4e3a\u53c2\u6570\uff0c\u53bb\u6267\u884c\/etc\/rc.d\/rc5.d\/\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u7684rc\u542f\u52a8\u811a\u672c\uff0c\/etc\/rc.d\/rc5.d\/\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e9b\u542f\u52a8\u811a\u672c\u5b9e\u9645\u4e0a\u90fd\u662f\u4e00\u4e9b\u8fde\u63a5\u6587\u4ef6\uff0c\u800c\u4e0d\u662f\u771f\u6b63\u7684rc\u542f\u52a8\u811a\u672c\uff0c\u771f\u6b63\u7684rc\u542f\u52a8\u811a\u672c\u5b9e\u9645\u4e0a\u90fd\u662f\u653e\u5728\/etc\/rc.d\/init.d\/\u76ee\u5f55\u4e0b\u3002<\/p>\n<p>\u800c\u8fd9\u4e9brc\u542f\u52a8\u811a\u672c\u6709\u7740\u7c7b\u4f3c\u7684\u7528\u6cd5\uff0c\u5b83\u4eec\u4e00\u822c\u80fd\u63a5\u53d7start\u3001stop\u3001restart\u3001status\u7b49\u53c2\u6570\u3002<\/p>\n<p>\/etc\/rc.d\/rc5.d\/\u4e2d\u7684rc\u542f\u52a8\u811a\u672c\u901a\u5e38\u662fK\u6216S\u5f00\u5934\u7684\u8fde\u63a5\u6587\u4ef6\uff0c\u5bf9\u4e8e\u4ee5 S \u5f00\u5934\u7684\u542f\u52a8\u811a\u672c\uff0c\u5c06\u4ee5start\u53c2\u6570\u6765\u8fd0\u884c\u3002<\/p>\n<p>\u800c\u5982\u679c\u53d1\u73b0\u5b58\u5728\u76f8\u5e94\u7684\u811a\u672c\u4e5f\u5b58\u5728K\u6253\u5934\u7684\u8fde\u63a5\uff0c\u800c\u4e14\u5df2\u7ecf\u5904\u4e8e\u8fd0\u884c\u6001\u4e86(\u4ee5\/var\/lock\/subsys\/\u4e0b\u7684\u6587\u4ef6\u4f5c\u4e3a\u6807\u5fd7)\uff0c\u5219\u5c06\u9996\u5148\u4ee5stop\u4e3a\u53c2\u6570\u505c\u6b62\u8fd9\u4e9b\u5df2\u7ecf\u542f\u52a8\u4e86\u7684\u5b88\u62a4\u8fdb\u7a0b\uff0c\u7136\u540e\u518d\u91cd\u65b0\u8fd0\u884c\u3002<\/p>\n<p>\u8fd9\u6837\u505a\u662f\u4e3a\u4e86\u4fdd\u8bc1\u662f\u5f53init\u6539\u53d8\u8fd0\u884c\u7ea7\u522b\u65f6\uff0c\u6240\u6709\u76f8\u5173\u7684\u5b88\u62a4\u8fdb\u7a0b\u90fd\u5c06\u91cd\u542f\u3002<\/p>\n<p>\u81f3\u4e8e\u5728\u6bcf\u4e2a\u8fd0\u884c\u7ea7\u4e2d\u5c06\u8fd0\u884c\u54ea\u4e9b\u5b88\u62a4\u8fdb\u7a0b\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7chkconfig\u6216setup\u4e2d\u7684&#8221;System Services&#8221;\u6765\u81ea\u884c\u8bbe\u5b9a\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/bg2013081705.png\" \/><\/p>\n<hr \/>\n<h2>\u5efa\u7acb\u7ec8\u7aef<\/h2>\n<p>rc\u6267\u884c\u5b8c\u6bd5\u540e\uff0c\u8fd4\u56deinit\u3002\u8fd9\u65f6\u57fa\u672c\u7cfb\u7edf\u73af\u5883\u5df2\u7ecf\u8bbe\u7f6e\u597d\u4e86\uff0c\u5404\u79cd\u5b88\u62a4\u8fdb\u7a0b\u4e5f\u5df2\u7ecf\u542f\u52a8\u4e86\u3002<\/p>\n<p>init\u63a5\u4e0b\u6765\u4f1a\u6253\u5f006\u4e2a\u7ec8\u7aef\uff0c\u4ee5\u4fbf\u7528\u6237\u767b\u5f55\u7cfb\u7edf\u3002\u5728inittab\u4e2d\u7684\u4ee5\u4e0b6\u884c\u5c31\u662f\u5b9a\u4e49\u4e866\u4e2a\u7ec8\u7aef\uff1a<\/p>\n<pre class=\"prettyprint\">1:2345:respawn:\/sbin\/mingetty tty1\r\n2:2345:respawn:\/sbin\/mingetty tty2\r\n3:2345:respawn:\/sbin\/mingetty tty3\r\n4:2345:respawn:\/sbin\/mingetty tty4\r\n5:2345:respawn:\/sbin\/mingetty tty5\r\n6:2345:respawn:\/sbin\/mingetty tty6\r\n<\/pre>\n<p>\u4ece\u4e0a\u9762\u53ef\u4ee5\u770b\u51fa\u57282\u30013\u30014\u30015\u7684\u8fd0\u884c\u7ea7\u522b\u4e2d\u90fd\u5c06\u4ee5respawn\u65b9\u5f0f\u8fd0\u884cmingetty\u7a0b\u5e8f\uff0cmingetty\u7a0b\u5e8f\u80fd\u6253\u5f00\u7ec8\u7aef\u3001\u8bbe\u7f6e\u6a21\u5f0f\u3002<\/p>\n<p>\u540c\u65f6\u5b83\u4f1a\u663e\u793a\u4e00\u4e2a\u6587\u672c\u767b\u5f55\u754c\u9762\uff0c\u8fd9\u4e2a\u754c\u9762\u5c31\u662f\u6211\u4eec\u7ecf\u5e38\u770b\u5230\u7684\u767b\u5f55\u754c\u9762\uff0c\u5728\u8fd9\u4e2a\u767b\u5f55\u754c\u9762\u4e2d\u4f1a\u63d0\u793a\u7528\u6237\u8f93\u5165\u7528\u6237\u540d\uff0c\u800c\u7528\u6237\u8f93\u5165\u7684\u7528\u6237\u5c06\u4f5c\u4e3a\u53c2\u6570\u4f20\u7ed9login\u7a0b\u5e8f\u6765\u9a8c\u8bc1\u7528\u6237\u7684\u8eab\u4efd\u3002<\/p>\n<hr \/>\n<h2>\u7528\u6237\u767b\u5f55\u7cfb\u7edf<\/h2>\n<p>\u4e00\u822c\u6765\u8bf4\uff0c\u7528\u6237\u7684\u767b\u5f55\u65b9\u5f0f\u6709\u4e09\u79cd\uff1a<\/p>\n<ul>\n<li>\uff081\uff09\u547d\u4ee4\u884c\u767b\u5f55<\/li>\n<li>\uff082\uff09ssh\u767b\u5f55<\/li>\n<li>\uff083\uff09\u56fe\u5f62\u754c\u9762\u767b\u5f55<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/bg2013081706.png\" \/><\/p>\n<p>\u5bf9\u4e8e\u8fd0\u884c\u7ea7\u522b\u4e3a5\u7684\u56fe\u5f62\u65b9\u5f0f\u7528\u6237\u6765\u8bf4\uff0c\u4ed6\u4eec\u7684\u767b\u5f55\u662f\u901a\u8fc7\u4e00\u4e2a\u56fe\u5f62\u5316\u7684\u767b\u5f55\u754c\u9762\u3002\u767b\u5f55\u6210\u529f\u540e\u53ef\u4ee5\u76f4\u63a5\u8fdb\u5165 KDE\u3001Gnome \u7b49\u7a97\u53e3\u7ba1\u7406\u5668\u3002<\/p>\n<p>\u800c\u672c\u6587\u4e3b\u8981\u8bb2\u7684\u8fd8\u662f\u6587\u672c\u65b9\u5f0f\u767b\u5f55\u7684\u60c5\u51b5\uff1a\u5f53\u6211\u4eec\u770b\u5230mingetty\u7684\u767b\u5f55\u754c\u9762\u65f6\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801\u6765\u767b\u5f55\u7cfb\u7edf\u4e86\u3002<\/p>\n<p>Linux \u7684\u8d26\u53f7\u9a8c\u8bc1\u7a0b\u5e8f\u662f login\uff0clogin \u4f1a\u63a5\u6536 mingetty \u4f20\u6765\u7684\u7528\u6237\u540d\u4f5c\u4e3a\u7528\u6237\u540d\u53c2\u6570\u3002<\/p>\n<p>\u7136\u540e login \u4f1a\u5bf9\u7528\u6237\u540d\u8fdb\u884c\u5206\u6790\uff1a\u5982\u679c\u7528\u6237\u540d\u4e0d\u662f root\uff0c\u4e14\u5b58\u5728 \/etc\/nologin \u6587\u4ef6\uff0clogin \u5c06\u8f93\u51fa nologin \u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u7136\u540e\u9000\u51fa\u3002<\/p>\n<p>\u8fd9\u901a\u5e38\u7528\u6765\u7cfb\u7edf\u7ef4\u62a4\u65f6\u9632\u6b62\u975eroot\u7528\u6237\u767b\u5f55\u3002\u53ea\u6709\/etc\/securetty\u4e2d\u767b\u8bb0\u4e86\u7684\u7ec8\u7aef\u624d\u5141\u8bb8 root \u7528\u6237\u767b\u5f55\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u8fd9\u4e2a\u6587\u4ef6\uff0c\u5219 root \u7528\u6237\u53ef\u4ee5\u5728\u4efb\u4f55\u7ec8\u7aef\u4e0a\u767b\u5f55\u3002<\/p>\n<p>\/etc\/usertty\u6587\u4ef6\u7528\u4e8e\u5bf9\u7528\u6237\u4f5c\u51fa\u9644\u52a0\u8bbf\u95ee\u9650\u5236\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u8fd9\u4e2a\u6587\u4ef6\uff0c\u5219\u6ca1\u6709\u5176\u4ed6\u9650\u5236\u3002<\/p>\n<p>&lt;p\u5728\u5206\u6790\u5b8c\u7528\u6237\u540d\u540e\uff0clogin \u5c06\u641c\u7d22=&#8221;&#8221; etc=&#8221;&#8221; passwd=&#8221;&#8221; \u4ee5\u53ca=&#8221;&#8221; shadow=&#8221;&#8221; \u6765\u9a8c\u8bc1\u5bc6\u7801\u4ee5\u53ca\u8bbe\u7f6e\u8d26\u6237\u7684\u5176\u5b83\u4fe1\u606f\uff0c\u6bd4\u5982\uff1a\u4e3b\u76ee\u5f55\u662f\u4ec0\u4e48\u3001\u4f7f\u7528\u4f55\u79cd=&#8221;&#8221; shell\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u4e3b\u76ee\u5f55\uff0c\u5c06\u9ed8\u8ba4\u4e3a\u6839\u76ee\u5f55\uff1b\u5982\u679c\u6ca1\u6709\u6307\u5b9a=&#8221;&#8221; shell\uff0c\u5c06\u9ed8\u8ba4\u4e3a=&#8221;&#8221; bin=&#8221;&#8221; bash\u3002&lt;=&#8221;&#8221; p=&#8221;&#8221;&gt;<\/p>\n<hr \/>\n<h2>\u56fe\u5f62\u6a21\u5f0f\u4e0e\u6587\u5b57\u6a21\u5f0f\u7684\u5207\u6362\u65b9\u5f0f<\/h2>\n<p>Linux\u9884\u8bbe\u63d0\u4f9b\u4e86\u516d\u4e2a\u547d\u4ee4\u7a97\u53e3\u7ec8\u7aef\u673a\u8ba9\u6211\u4eec\u6765\u767b\u5f55\u3002<\/p>\n<p>\u9ed8\u8ba4\u6211\u4eec\u767b\u5f55\u7684\u5c31\u662f\u7b2c\u4e00\u4e2a\u7a97\u53e3\uff0c\u4e5f\u5c31\u662ftty1\uff0c\u8fd9\u4e2a\u516d\u4e2a\u7a97\u53e3\u5206\u522b\u4e3atty1,tty2 \u2026 tty6\uff0c\u4f60\u53ef\u4ee5\u6309\u4e0bCtrl + Alt + F1 ~ F6 \u6765\u5207\u6362\u5b83\u4eec\u3002<\/p>\n<p>\u5982\u679c\u4f60\u5b89\u88c5\u4e86\u56fe\u5f62\u754c\u9762\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8fdb\u5165\u56fe\u5f62\u754c\u9762\u7684\uff0c\u6b64\u65f6\u4f60\u5c31\u53ef\u4ee5\u6309Ctrl + Alt + F1 ~ F6\u6765\u8fdb\u5165\u5176\u4e2d\u4e00\u4e2a\u547d\u4ee4\u7a97\u53e3\u754c\u9762\u3002<\/p>\n<p>\u5f53\u4f60\u8fdb\u5165\u547d\u4ee4\u7a97\u53e3\u754c\u9762\u540e\u518d\u8fd4\u56de\u56fe\u5f62\u754c\u9762\u53ea\u8981\u6309\u4e0bCtrl + Alt + F7 \u5c31\u56de\u6765\u4e86\u3002<\/p>\n<p>\u5982\u679c\u4f60\u7528\u7684vmware \u865a\u62df\u673a\uff0c\u547d\u4ee4\u7a97\u53e3\u5207\u6362\u7684\u5feb\u6377\u952e\u4e3a Alt + Space + F1~F6. \u5982\u679c\u4f60\u5728\u56fe\u5f62\u754c\u9762\u4e0b\u8bf7\u6309Alt + Shift + Ctrl + F1~F6 \u5207\u6362\u81f3\u547d\u4ee4\u7a97\u53e3\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/bg2013081707.png\" \/><\/p>\n<hr \/>\n<h2>Linux \u5173\u673a<\/h2>\n<p>\u5728linux\u9886\u57df\u5185\u5927\u591a\u7528\u5728\u670d\u52a1\u5668\u4e0a\uff0c\u5f88\u5c11\u9047\u5230\u5173\u673a\u7684\u64cd\u4f5c\u3002\u6bd5\u7adf\u670d\u52a1\u5668\u4e0a\u8dd1\u4e00\u4e2a\u670d\u52a1\u662f\u6c38\u65e0\u6b62\u5883\u7684\uff0c\u9664\u975e\u7279\u6b8a\u60c5\u51b5\u4e0b\uff0c\u4e0d\u5f97\u5df2\u624d\u4f1a\u5173\u673a\u3002<\/p>\n<p>\u6b63\u786e\u7684\u5173\u673a\u6d41\u7a0b\u4e3a\uff1async &gt; shutdown &gt; reboot &gt; halt<\/p>\n<p>\u5173\u673a\u6307\u4ee4\u4e3a\uff1ashutdown \uff0c\u4f60\u53ef\u4ee5man shutdown \u6765\u770b\u4e00\u4e0b\u5e2e\u52a9\u6587\u6863\u3002<\/p>\n<p>\u4f8b\u5982\u4f60\u53ef\u4ee5\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\u5173\u673a\uff1a<\/p>\n<pre class=\"prettyprint\">sync \u5c06\u6570\u636e\u7531\u5185\u5b58\u540c\u6b65\u5230\u786c\u76d8\u4e2d\u3002\r\n\r\nshutdown \u5173\u673a\u6307\u4ee4\uff0c\u4f60\u53ef\u4ee5man shutdown \u6765\u770b\u4e00\u4e0b\u5e2e\u52a9\u6587\u6863\u3002\u4f8b\u5982\u4f60\u53ef\u4ee5\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\u5173\u673a\uff1a\r\n\r\nshutdown \u2013h 10 \u2018This server will shutdown after 10 mins\u2019 \u8fd9\u4e2a\u547d\u4ee4\u544a\u8bc9\u5927\u5bb6\uff0c\u8ba1\u7b97\u673a\u5c06\u572810\u5206\u949f\u540e\u5173\u673a\uff0c\u5e76\u4e14\u4f1a\u663e\u793a\u5728\u767b\u9646\u7528\u6237\u7684\u5f53\u524d\u5c4f\u5e55\u4e2d\u3002\r\n\r\nshutdown \u2013h now \u7acb\u9a6c\u5173\u673a\r\n\r\nshutdown \u2013h 20:25 \u7cfb\u7edf\u4f1a\u5728\u4eca\u592920:25\u5173\u673a\r\n\r\nshutdown \u2013h +10 \u5341\u5206\u949f\u540e\u5173\u673a\r\n\r\nshutdown \u2013r now \u7cfb\u7edf\u7acb\u9a6c\u91cd\u542f\r\n\r\nshutdown \u2013r +10 \u7cfb\u7edf\u5341\u5206\u949f\u540e\u91cd\u542f\r\n\r\nreboot \u5c31\u662f\u91cd\u542f\uff0c\u7b49\u540c\u4e8e shutdown \u2013r now\r\n\r\nhalt \u5173\u95ed\u7cfb\u7edf\uff0c\u7b49\u540c\u4e8eshutdown \u2013h now \u548c poweroff\r\n<\/pre>\n<p>\u6700\u540e\u603b\u7ed3\u4e00\u4e0b\uff0c\u4e0d\u7ba1\u662f\u91cd\u542f\u7cfb\u7edf\u8fd8\u662f\u5173\u95ed\u7cfb\u7edf\uff0c\u9996\u5148\u8981\u8fd0\u884c\u00a0<strong>sync<\/strong>\u00a0\u547d\u4ee4\uff0c\u628a\u5185\u5b58\u4e2d\u7684\u6570\u636e\u5199\u5230\u78c1\u76d8\u4e2d\u3002<\/p>\n<p>\u5173\u673a\u7684\u547d\u4ee4\u6709\u00a0<strong>shutdown \u2013h now halt poweroff<\/strong>\u00a0\u548c<strong>\u00a0init 0<\/strong>\u00a0, \u91cd\u542f\u7cfb\u7edf\u7684\u547d\u4ee4\u6709\u00a0<strong>shutdown \u2013r now reboot init 6<\/strong>\u3002<\/p>\n<hr \/>\n<\/div>\n<\/div>\n<div id=\"comments\" class=\"title\"><\/div>\n<div id=\"postcomments\">\n<ol class=\"commentlist\">\n<li id=\"comment-38410\" class=\"comment even thread-even depth-1\">\n<div class=\"comt-avatar wrapper\">\n<p>&nbsp;<\/p>\n<div class=\"tooltip\">\n<p><i class=\"fa fa-user\" aria-hidden=\"true\"><\/i><\/p>\n<\/div>\n<\/div>\n<div id=\"div-comment-38410\" class=\"comt-main\">\n<p>shutdown \u4f1a\u7ed9\u7cfb\u7edf\u8ba1\u5212\u4e00\u4e2a\u65f6\u95f4\u5173\u673a\u3002\u5b83\u53ef\u4ee5\u88ab\u7528\u4e8e\u505c\u6b62\u3001\u5173\u673a\u3001\u91cd\u542f\u673a\u5668\u3002shutdown \u4f1a\u7ed9\u7cfb\u7edf\u8ba1\u5212\u4e00\u4e2a\u65f6\u95f4\u5173\u673a\u3002\u5b83\u53ef\u4ee5\u88ab\u7528\u4e8e\u505c\u6b62\u3001\u5173\u673a\u3001\u91cd\u542f\u673a\u5668\u3002<\/p>\n<pre class=\"prettyprint\"># shutdown -p now  ### \u5173\u95ed\u673a\u5668\r\n# shutdown -H now  ### \u505c\u6b62\u673a\u5668      \r\n# shutdown -r09:35 ### \u5728 09:35am \u91cd\u542f\u673a\u5668<\/pre>\n<p>\u8981\u53d6\u6d88\u5373\u5c06\u8fdb\u884c\u7684\u5173\u673a\uff0c\u53ea\u8981\u8f93\u5165\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n<pre class=\"prettyprint\"># shutdown -c<\/pre>\n<p>halt \u547d\u4ee4\u901a\u77e5\u786c\u4ef6\u6765\u505c\u6b62\u6240\u6709\u7684 CPU \u529f\u80fd\uff0c\u4f46\u662f\u4ecd\u7136\u4fdd\u6301\u901a\u7535\u3002\u4f60\u53ef\u4ee5\u7528\u5b83\u4f7f\u7cfb\u7edf\u5904\u4e8e\u4f4e\u5c42\u7ef4\u62a4\u72b6\u6001\u3002\u6ce8\u610f\u5728\u6709\u4e9b\u60c5\u51b5\u4f1a\u5b83\u4f1a\u5b8c\u5168\u5173\u95ed\u7cfb\u7edf\u3002<\/p>\n<pre class=\"prettyprint\"># halt             ### \u505c\u6b62\u673a\u5668\r\n# halt -p          ### \u5173\u95ed\u673a\u5668\r\n# halt --reboot    ### \u91cd\u542f\u673a\u5668<\/pre>\n<p>poweroff \u4f1a\u53d1\u9001\u4e00\u4e2a ACPI \u4fe1\u53f7\u6765\u901a\u77e5\u7cfb\u7edf\u5173\u673a\u3002<\/p>\n<pre class=\"prettyprint\"># poweroff           ### \u5173\u95ed\u673a\u5668\r\n# poweroff --halt    ### \u505c\u6b62\u673a\u5668\r\n# poweroff --reboot  ### \u91cd\u542f\u673a\u5668<\/pre>\n<p>reboot \u547d\u4ee4 reboot \u901a\u77e5\u7cfb\u7edf\u91cd\u542f\u3002<\/p>\n<pre class=\"prettyprint\"># reboot           ### \u91cd\u542f\u673a\u5668\r\n# reboot --halt    ### \u505c\u6b62\u673a\u5668\r\n# reboot -p        ### \u5173\u95ed\u673a\u5668<\/pre>\n<div class=\"comt-meta wrapper\"><\/div>\n<\/div>\n<\/li>\n<li id=\"comment-39099\" class=\"comment odd alt thread-odd thread-alt depth-1\">\n<div class=\"comt-avatar wrapper\">\n<p>&nbsp;<\/p>\n<div class=\"tooltip\"><\/div>\n<\/div>\n<div id=\"div-comment-39099\" class=\"comt-main\">\n<p>&nbsp;<\/p>\n<p><strong>[Tab] \u6709\u300e\u547d\u4ee4\u8865\u5168\u300f\u4e0e\u300e\u6587\u4ef6\u8865\u9f50\u300f\u7684\u529f\u80fd<\/strong><\/p>\n<pre class=\"prettyprint\">[Tab]      ## \u63a5\u5728\u4e00\u4e32\u6307\u4ee4\u7684\u7b2c\u4e00\u4e2a\u5b57\u7684\u540e\u9762\uff0c\u5219\u4e3a\u300e\u547d\u4ee4\u8865\u5168\u300f\r\n[Tab]      ## \u63a5\u5728\u4e00\u4e32\u6307\u4ee4\u7684\u7b2c\u4e8c\u4e2a\u5b57\u4ee5\u540e\u65f6\uff0c\u5219\u4e3a\u300e\u6587\u4ef6\u8865\u9f50\u300f<\/pre>\n<p>\u82e5\u5b89\u88c5 bash-completion \u8f6f\u4ef6\uff0c\u5219\u5728\u67d0\u4e9b\u6307\u4ee4\u540e\u9762\u4f7f\u7528 [tab] \u6309\u952e\u65f6\uff0c\u53ef\u4ee5\u8fdb\u884c\u300e\u9009\u9879\/\u53c2\u6570\u7684\u8865\u9f50\u300f\u529f\u80fd\uff01<\/p>\n<p><strong>[Ctrl]+ C \u5982\u679c\u5728Linux \u5e95\u4e0b\u8f93\u5165\u4e86\u9519\u8bef\u7684\u6307\u4ee4\u6216\u53c2\u6570\uff0c\u60f3\u8ba9\u5f53\u524d\u7684\u7a0b\u5e8f\u300e\u505c\u6389\u300f\u7684\u8bdd\uff0c\u53ef\u4ee5\u8f93\u5165\uff1a<\/strong><\/p>\n<pre class=\"prettyprint\">[Ctrl] + c<\/pre>\n<p><strong>[Ctrl]-d \u300e\u952e\u76d8\u8f93\u5165\u7ed3\u675f(End Of File, EOF \u6216 End Of Input)\u300f\u7684\u610f\u601d<\/strong><\/p>\n<p>\u53e6\u5916\uff0c\u4ed6\u4e5f\u53ef\u4ee5\u7528\u6765\u53d6\u4ee3 exit \u7684\u8f93\u5165\u3002<\/p>\n<p>\u4f8b\u5982\u4f60\u60f3\u8981\u76f4\u63a5\u79bb\u5f00\u6587\u5b57\u63a5\u53e3\uff0c\u53ef\u4ee5\u76f4\u63a5\u6309\u4e0b\uff1a<\/p>\n<pre class=\"prettyprint\">[Ctrl] + d   ## \u76f8\u5f53\u4e8e\u8f93\u5165 exit<\/pre>\n<p><strong>[shift]+{[PageUP]|[Page Down]}<\/strong><\/p>\n<pre class=\"prettyprint\">[Shift]+[Page Up]    ## \u5f80\u524d\u7ffb\u9875 \r\n\r\n[Shift]+[Page Down] ## \u5f80\u540e\u7ffb\u9875<\/pre>\n<\/div>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u00a0\u7cfb\u7edf\u542f\u52a8\u8fc7\u7a0b linux\u542f\u52a8\u65f6\u6211\u4eec\u4f1a\u770b\u5230\u8bb8\u591a\u542f\u52a8\u4fe1\u606f\u3002 Linux\u7cfb\u7edf\u7684\u542f\u52a8\u8fc7\u7a0b\u5e76\u4e0d\u662f\u5927\u5bb6\u60f3\u8c61\u4e2d\u7684 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/b.yesiyu.top\/?p=93\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cLinux \u7cfb\u7edf\u542f\u52a8\u8fc7\u7a0b\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-liunx-"],"_links":{"self":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=93"}],"version-history":[{"count":2,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/93\/revisions"}],"predecessor-version":[{"id":95,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/93\/revisions\/95"}],"wp:attachment":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}