{"id":286,"date":"2019-08-06T21:16:12","date_gmt":"2019-08-06T13:16:12","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=286"},"modified":"2021-05-03T00:42:55","modified_gmt":"2021-05-02T16:42:55","slug":"chapter-02","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/chapter-02.html","title":{"rendered":"\u7b2c2\u7ae0 \u65b0\u624b\u5fc5\u987b\u638c\u63e1\u7684Linux\u547d\u4ee4\u3002"},"content":{"rendered":"

👇\u672c\u7ae0\u8282\u5185\u5bb9\u5df2\u66f4\u65b0\uff0c\u8bf7\u5728\u7ebf\u9605\u8bfb\u6700\u65b0RHEL 8\u7248\u672c\u4e66\u7c4d 👇<\/span><\/strong><\/span><\/p>\n

https:\/\/lrxjmw.cn\/basic-learning-02.html<\/span><\/strong><\/span><\/b><\/p>\n

\u7ae0\u8282\u7b80\u8ff0\uff1a<\/strong><\/span><\/p>\n

\u672c\u7ae0\u9996\u5148\u4ecb\u7ecd\u7cfb\u7edf\u5185\u6838\u548cShell\u7ec8\u7aef\u7684\u5173\u7cfb\u4e0e\u4f5c\u7528\uff0c\u7136\u540e\u4ecb\u7ecdBash\u89e3\u91ca\u5668\u76844\u5927\u4f18\u52bf\u5e76\u5b66\u4e60Linux\u547d\u4ee4\u7684\u6267\u884c\u65b9\u6cd5\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u8fd0\u7ef4\u4eba\u5458\u53ef\u4ee5\u901a\u8fc7\u5408\u7406\u5730\u7ec4\u5408\u9002\u5f53\u7684\u547d\u4ee4\u4e0e\u53c2\u6570\uff0c\u6765\u66f4\u7cbe\u51c6\u5730\u6ee1\u8db3\u5de5\u4f5c\u9700\u6c42\uff0c\u8fc5\u901f\u5f97\u5230\u81ea\u5df1\u60f3\u8981\u7684\u7ed3\u679c\uff0c\u8fd8\u53ef\u4ee5\u5c3d\u53ef\u80fd\u5730\u964d\u4f4e\u7cfb\u7edf\u8d44\u6e90\u6d88\u8017\u3002<\/p>\n

\u672c\u4e66\u7cbe\u6311\u7ec6\u9009\u51fa\u8bfb\u8005\u6709\u5fc5\u8981\u9996\u5148\u5b66\u4e60\u7684\u6570\u5341\u4e2aLinux\u547d\u4ee4\uff0c\u5b83\u4eec\u4e0e\u7cfb\u7edf\u5de5\u4f5c\u3001\u7cfb\u7edf\u72b6\u6001\u3001\u5de5\u4f5c\u76ee\u5f55\u3001\u6587\u4ef6\u3001\u76ee\u5f55\u3001\u6253\u5305\u538b\u7f29\u4e0e\u641c\u7d22\u7b49\u4e3b\u9898\u76f8\u5173\u3002\u901a\u8fc7\u628a\u4e0a\u8ff0\u547d\u4ee4\u5f52\u7eb3\u5230\u672c\u7ae0\u4e2d\u7684\u5404\u4e2a\u5c0f\u8282\uff0c\u8ba9\u60a8\u53ef\u4ee5\u5206\u95e8\u522b\u7c7b\u5730\u9010\u4e2a\u5b66\u4e60\u8fd9\u4e9b\u6700\u57fa\u7840\u7684Linux\u547d\u4ee4\uff0c\u4e3a\u4eca\u540e\u5b66\u4e60\u66f4\u590d\u6742\u7684\u547d\u4ee4\u548c\u670d\u52a1\u505a\u597d\u5fc5\u5907\u77e5\u8bc6\u94fa\u57ab\u3002<\/p>\n

Linux\u547d\u4ee4\u5927\u5168\uff1ahttps:\/\/www.linuxcool.com<\/a>\u00a0 \u00a0 \u2190\u5efa\u8bae\u5148\u6dfb\u52a0\u5230\u6d4f\u89c8\u5668\u6536\u85cf\u5939\uff0c\u5b66\u4e60\u5b8c\u672c\u7ae0\u8282\u540e\u518d\u6d4f\u89c8<\/strong><\/p>\n

2.1 \u5f3a\u5927\u597d\u7528\u7684SHELL<\/strong><\/span><\/h5>\n

\u901a\u5e38\u6765\u8bb2\uff0c\u8ba1\u7b97\u673a\u786c\u4ef6\u662f\u7531\u8fd0\u7b97\u5668\u3001\u63a7\u5236\u5668\u3001\u5b58\u50a8\u5668\u3001\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\u7b49\u5171\u540c\u7ec4\u6210\u7684\uff0c\u800c\u8ba9\u5404\u79cd\u786c\u4ef6\u8bbe\u5907\u5404\u53f8\u5176\u804c\u4e14\u53c8\u80fd\u534f\u540c\u8fd0\u884c\u7684\u4e1c\u897f\u5c31\u662f\u7cfb\u7edf\u5185\u6838\u3002Linux\u7cfb\u7edf\u7684\u5185\u6838\u8d1f\u8d23\u5b8c\u6210\u5bf9\u786c\u4ef6\u8d44\u6e90\u7684\u5206\u914d\u3001\u8c03\u5ea6\u7b49\u7ba1\u7406\u4efb\u52a1\u3002\u7531\u6b64\u53ef\u89c1\uff0c\u7cfb\u7edf\u5185\u6838\u5bf9\u8ba1\u7b97\u673a\u7684\u6b63\u5e38\u8fd0\u884c\u6765\u8bb2\u662f\u592a\u91cd\u8981\u4e86\uff0c\u56e0\u6b64\u4e00\u822c\u4e0d\u5efa\u8bae\u76f4\u63a5\u53bb\u7f16\u8f91\u5185\u6838\u4e2d\u7684\u53c2\u6570\uff0c\u800c\u662f\u8ba9\u7528\u6237\u901a\u8fc7\u57fa\u4e8e\u7cfb\u7edf\u8c03\u7528\u63a5\u53e3\u5f00\u53d1\u51fa\u7684\u7a0b\u5e8f\u6216\u670d\u52a1\u6765\u7ba1\u7406\u8ba1\u7b97\u673a\uff0c\u4ee5\u6ee1\u8db3\u65e5\u5e38\u5de5\u4f5c\u7684\u9700\u8981\uff0c\u5982\u56fe2-1\u6240\u793a\u3002<\/p>\n

\u5fc5\u987b\u80af\u5b9a\u7684\u662f\uff0cLinux\u7cfb\u7edf\u4e2d\u6709\u4e9b\u56fe\u5f62\u5316\u5de5\u5177\uff08\u6bd4\u5982\u903b\u8f91\u5377\u7ba1\u7406\u5668[Logical Volume Manager\uff0cLVM]\uff09\u786e\u5b9e\u975e\u5e38\u597d\u7528\uff0c\u6781\u5927\u5730\u964d\u4f4e\u4e86\u8fd0\u7ef4\u4eba\u5458\u64cd\u4f5c\u51fa\u9519\u7684\u6982\u7387\uff0c\u503c\u5f97\u79f0\u8d5e\u3002\u4f46\u662f\uff0c\u5f88\u591a\u56fe\u5f62\u5316\u5de5\u5177\u5176\u5b9e\u662f\u8c03\u7528\u4e86\u811a\u672c\u6765\u5b8c\u6210\u76f8\u5e94\u7684\u5de5\u4f5c\uff0c\u5f80\u5f80\u53ea\u662f\u4e3a\u4e86\u5b8c\u6210\u67d0\u79cd\u5de5\u4f5c\u800c\u8bbe\u8ba1\u7684\uff0c\u7f3a\u4e4fLinux\u547d\u4ee4\u539f\u6709\u7684\u7075\u6d3b\u6027\u53ca\u53ef\u63a7\u6027\u3002\u518d\u8005\uff0c\u56fe\u5f62\u5316\u5de5\u5177\u76f8\u8f83\u4e8eLinux\u547d\u4ee4\u884c\u754c\u9762\u4f1a\u66f4\u52a0\u6d88\u8017\u7cfb\u7edf\u8d44\u6e90\uff0c\u56e0\u6b64\u7ecf\u9a8c\u4e30\u5bcc\u7684\u8fd0\u7ef4\u4eba\u5458\u751a\u81f3\u90fd\u4e0d\u4f1a\u7ed9Linux\u7cfb\u7edf\u5b89\u88c5\u56fe\u5f62\u754c\u9762\uff0c\u9700\u8981\u5f00\u59cb\u8fd0\u7ef4\u5de5\u4f5c\u65f6\u76f4\u63a5\u901a\u8fc7\u547d\u4ee4\u884c\u6a21\u5f0f\u8fdc\u7a0b\u8fde\u63a5\u8fc7\u53bb\uff0c\u4e0d\u5f97\u4e0d\u8bf4\u8fd9\u6837\u505a\u786e\u5b9e\u633a\u9ad8\u6548\u7684\u3002<\/p>\n

\"\"<\/p>\n

\u56fe2-1\u00a0 \u7528\u6237\u4e0eLinux\u7cfb\u7edf\u7684\u4ea4\u4e92<\/p>\n

Shell\u5c31\u662f\u8fd9\u6837\u7684\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\u3002Shell\uff08\u4e5f\u79f0\u4e3a\u7ec8\u7aef\u6216\u58f3\uff09\u5145\u5f53\u7684\u662f\u4eba\u4e0e\u5185\u6838\uff08\u786c\u4ef6\uff09\u4e4b\u95f4\u7684\u7ffb\u8bd1\u5b98\uff0c\u7528\u6237\u628a\u4e00\u4e9b\u547d\u4ee4\u201c\u544a\u8bc9\u201d\u7ec8\u7aef\uff0c\u5b83\u5c31\u4f1a\u8c03\u7528\u76f8\u5e94\u7684\u7a0b\u5e8f\u670d\u52a1\u53bb\u5b8c\u6210\u67d0\u4e9b\u5de5\u4f5c\u3002\u73b0\u5728\u5305\u62ec\u7ea2\u5e3d<\/a>\u7cfb\u7edf\u5728\u5185\u7684\u8bb8\u591a\u4e3b\u6d41Linux\u7cfb\u7edf\u9ed8\u8ba4\u4f7f\u7528\u7684\u7ec8\u7aef\u662fBash\uff08Bourne-Again SHell\uff09\u89e3\u91ca\u5668\u3002\u4e3b\u6d41Linux\u7cfb\u7edf\u9009\u62e9Bash\u89e3\u91ca\u5668\u4f5c\u4e3a\u547d\u4ee4\u884c\u7ec8\u7aef\u4e3b\u8981\u6709\u4ee5\u4e0b4\u9879\u4f18\u52bf\uff0c\u8bfb\u8005\u53ef\u4ee5\u5728\u4eca\u540e\u7684\u5b66\u4e60\u548c\u751f\u4ea7\u5de5\u4f5c\u4e2d\u7ec6\u7ec6\u4f53\u4f1aLinux\u7cfb\u7edf\u547d\u4ee4\u884c\u7684\u7f8e\u5999\u4e4b\u5904\uff0c\u771f\u6b63\u4ece\u5fc3\u91cc\u7231\u4e0a\u5b83\u4eec\u3002<\/p>\n

1\uff1a\u901a\u8fc7\u4e0a\u4e0b\u65b9\u5411\u952e\u6765\u8c03\u53d6\u8fc7\u5f80\u6267\u884c\u8fc7\u7684Linux\u547d\u4ee4\uff1b<\/p>\n

2\uff1a\u547d\u4ee4\u6216\u53c2\u6570\u4ec5\u9700\u8f93\u5165\u524d\u51e0\u4f4d\u5c31\u53ef\u4ee5\u7528Tab\u952e\u8865\u5168\uff1b<\/p>\n

3\uff1a\u5177\u6709\u5f3a\u5927\u7684\u6279\u5904\u7406\u811a\u672c\uff1b<\/p>\n

4\uff1a\u5177\u6709\u5b9e\u7528\u7684\u73af\u5883\u53d8\u91cf\u529f\u80fd\u3002<\/p><\/blockquote>\n

2.2 \u6267\u884c\u67e5\u770b\u5e2e\u52a9\u547d\u4ee4<\/strong><\/span><\/h5>\n

\u65e2\u7136Linux\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u6709\u4e86Bash\u8fd9\u4e48\u597d\u7528\u7684\u201c\u7ffb\u8bd1\u5b98\u201d\uff0c\u90a3\u4e48\u63a5\u4e0b\u6765\u5c31\u6709\u5fc5\u8981\u597d\u597d\u5b66\u4e60\u4e0b\u600e\u4e48\u8ddf\u5b83\u6c9f\u901a\u4e86\u3002\u8981\u60f3\u51c6\u786e\u3001\u9ad8\u6548\u5730\u5b8c\u6210\u5404\u79cd\u4efb\u52a1\uff0c\u4ec5\u4f9d\u8d56\u4e8e\u547d\u4ee4\u672c\u8eab\u662f\u4e0d\u591f\u7684\uff0c\u8fd8\u5e94\u8be5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u6765\u7075\u6d3b\u8c03\u6574\u5404\u79cd\u547d\u4ee4\u7684\u53c2\u6570\u3002\u6bd4\u5982\uff0c\u6211\u4eec\u5207\u5bff\u53f8\u65f6\u5c3d\u7ba1\u53ef\u4ee5\u7528\u83dc\u5200\uff0c\u4f46\u7c73\u7c92\u4e00\u5b9a\u4f1a\u6492\u5f97\u6ee1\u5730\u90fd\u662f\uff0c\u56e0\u6b64\u5bff\u53f8\u5200\u4e0a\u8bbe\u8ba1\u7684\u7528\u4e8e\u900f\u6c14\u7684\u5706\u5b54\u5c31\u662f\u4e3a\u4e86\u66f4\u597d\u5730\u9002\u5e94\u573a\u666f\u800c\u989d\u5916\u589e\u52a0\u7684\u53c2\u6570\u3002\u5f53\u60a8\u5b66\u5b8c\u672c\u4e66\u5e76\u5177\u5907\u4e00\u5b9a\u7684\u5de5\u4f5c\u7ecf\u9a8c\u4e4b\u540e\uff0c\u4e00\u5b9a\u80fd\u591f\u9886\u609fLinux\u547d\u4ee4\u7684\u5965\u79d8\u3002\u5e38\u89c1\u6267\u884cLinux\u547d\u4ee4\u7684\u683c\u5f0f\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n

\u547d\u4ee4\u540d\u79f0 [\u547d\u4ee4\u53c2\u6570] [\u547d\u4ee4\u5bf9\u8c61]<\/strong><\/p><\/blockquote>\n

\u6ce8\u610f\uff0c\u547d\u4ee4\u540d\u79f0\u3001\u547d\u4ee4\u53c2\u6570\u3001\u547d\u4ee4\u5bf9\u8c61\u4e4b\u95f4\u8bf7\u7528\u7a7a\u683c\u952e\u5206\u9694\u3002<\/p>\n

\u547d\u4ee4\u5bf9\u8c61\u4e00\u822c\u662f\u6307\u8981\u5904\u7406\u7684\u6587\u4ef6\u3001\u76ee\u5f55\u3001\u7528\u6237\u7b49\u8d44\u6e90\uff0c\u800c\u547d\u4ee4\u53c2\u6570\u53ef\u4ee5\u7528\u957f\u683c\u5f0f\uff08\u5b8c\u6574\u7684\u9009\u9879\u540d\u79f0\uff09\uff0c\u4e5f\u53ef\u4ee5\u7528\u77ed\u683c\u5f0f\uff08\u5355\u4e2a\u5b57\u6bcd\u7684\u7f29\u5199\uff09\uff0c\u4e24\u8005\u5206\u522b\u7528--\u4e0e-\u4f5c\u4e3a\u524d\u7f00\uff08\u793a\u4f8b\u8bf7\u89c1\u88682-1\uff09\u3002Linux\u65b0\u624b\u4e0d\u4f1a\u6267\u884c\u547d\u4ee4\u5927\u591a\u662f\u56e0\u4e3a\u53c2\u6570\u6bd4\u8f83\u590d\u6742\uff0c\u53c2\u6570\u503c\u9700\u8981\u968f\u4e0d\u540c\u7684\u547d\u4ee4\u548c\u9700\u6c42\u60c5\u51b5\u800c\u53d1\u751f\u6539\u53d8\u3002\u56e0\u6b64\uff0c\u8981\u60f3\u7075\u6d3b\u642d\u914d\u5404\u79cd\u53c2\u6570\uff0c\u6267\u884c\u81ea\u5df1\u60f3\u8981\u7684\u529f\u80fd\uff0c\u5219\u9700\u8981\u957f\u65f6\u95f4\u7684\u7ecf\u9a8c\u79ef\u7d2f\u4e86\u3002<\/p>\n

\u88682-1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u547d\u4ee4\u53c2\u6570\u7684\u957f\u683c\u5f0f\u4e0e\u77ed\u683c\u5f0f\u793a\u4f8b<\/p>\n\n\n\n\n
\u957f\u683c\u5f0f<\/td>\nman --help<\/td>\n<\/tr>\n
\u77ed\u683c\u5f0f<\/td>\nman -h<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u6709\u8bfb\u8005\u73b0\u5728\u53ef\u80fd\u4f1a\u60f3\uff1a\u201cLinux\u7cfb\u7edf\u4e2d\u6709\u90a3\u4e48\u591a\u547d\u4ee4\uff0c\u6211\u600e\u4e48\u77e5\u9053\u67d0\u4e2a\u547d\u4ee4\u662f\u5e72\u561b\u7528\u7684\uff1f\u5728\u65e5\u5e38\u5de5\u4f5c\u4e2d\u9047\u5230\u4e86\u4e00\u4e2a\u4e0d\u719f\u6089\u7684Linux\u547d\u4ee4\uff0c\u6211\u53c8\u600e\u6837\u624d\u80fd\u77e5\u9053\u5b83\u6709\u54ea\u4e9b\u53ef\u7528\u53c2\u6570\u5462\uff1f\u201d\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c31\u62ffman\u8fd9\u4e2a\u547d\u4ee4\u4f5c\u4e3a\u672c\u4e66\u4e2d\u7b2c\u4e00\u4e2a\u6559\u7ed9\u8bfb\u8005\u53bb\u5b66\u4e60\u7684Linux\u547d\u4ee4\u4e86\u3002\u5bf9\u4e8e\u771f\u6b63\u7684\u96f6\u57fa\u7840\u8bfb\u8005\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u56fe2-2\u3001\u56fe2-3\u3001\u56fe2-4\u548c\u56fe2-5\u6765\u5b66\u4e60\u5982\u4f55\u5728RHEL 7\u7cfb\u7edf\u4e2d\u6267\u884cLinux\u547d\u4ee4\u3002<\/p>\n

\u9ed8\u8ba4\u4e3b\u673a\u767b\u5f55\u754c\u9762\u53ea\u6709\u6211\u4eec\u521a\u521a\u65b0\u5efa\u7684\u666e\u901a\u7528\u6237\uff0c\u56e0\u6b64\u5728\u6b63\u5f0f\u8fdb\u5165\u7cfb\u7edf\u4e4b\u524d\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u5148\u70b9\u51fb\u201cNot listed\u201d\u9009\u9879\u6765\u5207\u6362\u81f3root\u7ba1\u7406\u5458\u8eab\u4efd\uff0c\u8fd9\u662f\u7ea2\u5e3dRHEL7\u7cfb\u7edf\u4e3a\u4e86\u907f\u514d\u7528\u6237\u4e71\u4f7f\u7528\u6743\u9650\u800c\u91c7\u53d6\u7684\u4e00\u9879\u5c0f\u63aa\u65bd\u3002\u800c\u5982\u679c\u6211\u4eec\u987a\u624b\u4f7f\u7528\u9ed8\u8ba4\u7684linuxprobe\u7528\u6237\u767b\u5f55\u5230\u4e3b\u673a\u4e2d\uff0c\u90a3\u4e48\u63a5\u4e0b\u6765\u672c\u7ae0\u8282\u4e2d\u5219\u4f1a\u51fa\u73b0\u4e00\u90e8\u5206\u547d\u4ee4\u4f1a\u56e0\u6743\u9650\u4e0d\u8db3\u800c\u65e0\u6cd5\u6267\u884c\uff0c\u6211\u4eec\u9700\u8981\u8db3\u591f\u7684\u6743\u9650\u624d\u80fd\u5b8c\u6210\u63a5\u4e0b\u6765\u7684\u5b9e\u9a8c\u3002\u800c\u81f3\u4e8e\u540c\u5b66\u4eec\u5173\u5fc3\u7684root\u7ba1\u7406\u5458\u548c\u666e\u901a\u7528\u6237\u4e4b\u95f4\u7684\u533a\u522b\uff0c\u751f\u4ea7\u73af\u5883\u65f6\u53c8\u8be5\u5982\u4f55\u9009\u62e9\u7684\u7591\u95ee\uff0c\u6211\u4eec\u5c06\u4f1a\u5728\u7b2c5\u7ae0\u8282\u4e2d\u6162\u6162\u8bb2\u7ed9\u5927\u5bb6\u3002\u767b\u5f55\u754c\u9762\u5207\u6362\u81f3root\u7ba1\u7406\u5458\u8eab\u4efd\uff0c\u5982\u56fe2-2\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe2-2 \u9009\u62e9\u201c\u672a\u5217\u51fa\u201d\u9009\u9879\uff0c\u5207\u6362\u81f3root\u7ba1\u7406\u5458\u8eab\u4efd\u3002<\/p>\n

\u7b2c1\u6b65\uff1a\u5728RHEL 7\u7cfb\u7edf\u7684\u684c\u9762\u4e0a\u5355\u51fb\u9f20\u6807\u53f3\u952e\uff0c\u5728\u5f39\u51fa\u7684\u83dc\u5355\u4e2d\u9009\u62e9Open in Terminal\u547d\u4ee4\uff0c\u8fd9\u5c06\u6253\u5f00\u4e00\u4e2aLinux\u7cfb\u7edf\u547d\u4ee4\u884c\u7ec8\u7aef\uff0c\u5982\u56fe2-3\u6240\u793a\u3002<\/p>\n

\"\u8fd0\u884c\u865a\u62df\u673a\u4e2d\u7684RHEL7\u7cfb\u7edf\uff0c\u5e76\u5728\u684c\u9762\u4e0a\u6572\u51fb\u53f3\u952e\u540e\u70b9\u51fb\u201cOpen<\/div>\n

\u56fe2-3 \u00a0\u5728Linux\u7cfb\u7edf\u4e0a\u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef<\/p>\n

\u7b2c2\u6b65\uff1a\u5728\u547d\u4ee4\u884c\u7ec8\u7aef\u4e2d\u8f93\u5165man man\u547d\u4ee4\u6765\u67e5\u770bman\u547d\u4ee4\u81ea\u8eab\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5982\u56fe2-4\u6240\u793a\u3002<\/p>\n

\"\u67e5\u770bman\u5e2e\u52a9\u6587\u6863\"<\/div>\n

\u56fe2-4\u00a0 \u67e5\u770bman\u547d\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f<\/p>\n

\u7b2c3\u6b65\uff1a\u6572\u51fb\u56de\u8f66\u952e\u540e\u5373\u53ef\u770b\u5230\u5982\u56fe2-5\u6240\u793a\u7684\u5e2e\u52a9\u4fe1\u606f\u3002\"man\u547d\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f\u754c\u9762\"<\/p>\n

\u56fe2-5\u00a0 man\u547d\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f<\/p>\n

\u5728man\u547d\u4ee4\u5e2e\u52a9\u4fe1\u606f\u7684\u754c\u9762\u4e2d\uff0c\u6240\u5305\u542b\u7684\u5e38\u7528\u64cd\u4f5c\u6309\u952e\u53ca\u5176\u7528\u9014\u5982\u88682-2\u6240\u793a\u3002<\/p>\n

\u88682-2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 man\u547d\u4ee4\u4e2d\u5e38\u7528\u6309\u952e\u4ee5\u53ca\u7528\u9014<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u6309\u952e<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
\u7a7a\u683c\u952e<\/td>\n\u5411\u4e0b\u7ffb\u4e00\u9875<\/td>\n<\/tr>\n
PaGe down<\/td>\n\u5411\u4e0b\u7ffb\u4e00\u9875<\/td>\n<\/tr>\n
PaGe up<\/td>\n\u5411\u4e0a\u7ffb\u4e00\u9875<\/td>\n<\/tr>\n
home<\/td>\n\u76f4\u63a5\u524d\u5f80\u9996\u9875<\/td>\n<\/tr>\n
end<\/td>\n\u76f4\u63a5\u524d\u5f80\u5c3e\u9875<\/td>\n<\/tr>\n
\/<\/td>\n\u4ece\u4e0a\u81f3\u4e0b\u641c\u7d22\u67d0\u4e2a\u5173\u952e\u8bcd\uff0c\u5982\u201c\/linux\u201d<\/td>\n<\/tr>\n
?<\/td>\n\u4ece\u4e0b\u81f3\u4e0a\u641c\u7d22\u67d0\u4e2a\u5173\u952e\u8bcd\uff0c\u5982\u201c?linux\u201d<\/td>\n<\/tr>\n
n<\/td>\n\u5b9a\u4f4d\u5230\u4e0b\u4e00\u4e2a\u641c\u7d22\u5230\u7684\u5173\u952e\u8bcd<\/td>\n<\/tr>\n
N<\/td>\n\u5b9a\u4f4d\u5230\u4e0a\u4e00\u4e2a\u641c\u7d22\u5230\u7684\u5173\u952e\u8bcd<\/td>\n<\/tr>\n
b<\/td>\n\u5411\u4e0a\u7ffb\u4e00\u9875<\/td>\n<\/tr>\n
g<\/td>\n\u8df3\u8f6c\u5230\u7b2c\u4e00\u9875<\/td>\n<\/tr>\n
h<\/td>\n\u663e\u793a\u5e2e\u52a9\u754c\u9762<\/td>\n<\/tr>\n
u<\/td>\n\u5411\u4e0a\u6eda\u52a8\u534a\u9875<\/td>\n<\/tr>\n
d<\/td>\n\u5411\u4e0b\u6eda\u52a8\u534a\u9875<\/td>\n<\/tr>\n
q<\/td>\n\u9000\u51fa\u5e2e\u52a9\u6587\u6863<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u4e00\u822c\u6765\u8bb2\uff0c\u4f7f\u7528man\u547d\u4ee4\u67e5\u770b\u5230\u7684\u5e2e\u52a9\u5185\u5bb9\u4fe1\u606f\u90fd\u4f1a\u5f88\u957f\u5f88\u591a\uff0c\u5982\u679c\u8bfb\u8005\u4e0d\u4e86\u89e3\u5e2e\u52a9\u6587\u6863\u4fe1\u606f\u7684\u76ee\u5f55\u7ed3\u6784\u548c\u64cd\u4f5c\u65b9\u6cd5\uff0c\u4e4d\u4e00\u770b\u5230\u8fd9\u4e48\u591a\u4fe1\u606f\u53ef\u80fd\u4f1a\u611f\u5230\u76f8\u5f53\u56f0\u60d1\u3002man\u547d\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f\u7684\u7ed3\u6784\u5982\u88682-3\u6240\u793a\u3002<\/p>\n

\u88682-3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 man\u547d\u4ee4\u5e2e\u52a9\u4fe1\u606f\u7684\u7ed3\u6784\u4ee5\u53ca\u610f\u4e49<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u7ed3\u6784\u540d\u79f0<\/td>\n\u4ee3\u8868\u610f\u4e49<\/td>\n<\/tr>\n
NAME<\/td>\n\u547d\u4ee4\u7684\u540d\u79f0<\/td>\n<\/tr>\n
SYNOPSIS<\/td>\n\u53c2\u6570\u7684\u5927\u81f4\u4f7f\u7528\u65b9\u6cd5<\/td>\n<\/tr>\n
DESCRIPTION<\/td>\n\u4ecb\u7ecd\u8bf4\u660e<\/td>\n<\/tr>\n
EXAMPLES<\/td>\n\u6f14\u793a\uff08\u9644\u5e26\u7b80\u5355\u8bf4\u660e\uff09<\/td>\n<\/tr>\n
OVERVIEW<\/td>\n\u6982\u8ff0<\/td>\n<\/tr>\n
DEFAULTS<\/td>\n\u9ed8\u8ba4\u7684\u529f\u80fd<\/td>\n<\/tr>\n
OPTIONS<\/td>\n\u5177\u4f53\u7684\u53ef\u7528\u9009\u9879\uff08\u5e26\u4ecb\u7ecd\uff09<\/td>\n<\/tr>\n
ENVIRONMENT<\/td>\n\u73af\u5883\u53d8\u91cf<\/td>\n<\/tr>\n
FILES<\/td>\n\u7528\u5230\u7684\u6587\u4ef6<\/td>\n<\/tr>\n
SEE ALSO<\/td>\n\u76f8\u5173\u7684\u8d44\u6599<\/td>\n<\/tr>\n
HISTORY<\/td>\n\u7ef4\u62a4\u5386\u53f2\u4e0e\u8054\u7cfb\u65b9\u5f0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

2.3 \u5e38\u7528\u7cfb\u7edf\u5de5\u4f5c\u547d\u4ee4<\/strong><\/span><\/h5>\n

\u60a8\u73b0\u5728\u9605\u8bfb\u7684\u8fd9\u672c\u4e66\u662f\u5218\u9044\u8001\u5e08\u5728\u7ecf\u5386\u4e86\u5341\u591a\u5e74\u7684\u8fd0\u7ef4\u5b66\u4e60\u4ee5\u53ca\u6570\u5341\u671f\u7684\u57f9\u8bad\u6388\u8bfe\u540e\u603b\u7ed3\u800c\u6210\u7684\uff0c\u60a8\u53ef\u80fd\u65e0\u6cd5\u5728\u672c\u8282\u4e2d\u627e\u5230\u67d0\u4e9b\u4e4b\u524d\u89c1\u8fc7\u7684\u547d\u4ee4\u3002\u4f46\u4e0d\u7528\u62c5\u5fc3\uff0c\u4e4b\u6240\u4ee5\u8fd9\u6837\u5b89\u6392\uff0c\u539f\u56e0\u662f\u5218\u9044\u8001\u5e08\u52aa\u529b\u5730\u5c06Linux\u547d\u4ee4\u4e0e\u5b9e\u6218\u76f8\u7ed3\u5408\uff0c\u771f\u6b63\u8ba9\u8bfb\u8005\u5728\u5b9e\u64cd\u4e2d\u7406\u89e3\u6280\u672f\uff0c\u800c\u4e0d\u662f\u5355\u7eaf\u5730\u628a\u547d\u4ee4\u5806\u780c\u5230\u4e66\u4e2d\u8ba9\u8bfb\u8005\u53bb\u786c\u80cc\u3002<\/p>\n

\u5218\u9044\u8001\u5e08\u7528\u4e86\u8fd1\u4e00\u5e74\u7684\u65f6\u95f4\u628a\u6700\u5e38\u7528\u7684Linux\u547d\u4ee4\u8fdb\u884c\u6c47\u603b\u3001\u5f52\u7eb3\u3001\u6574\u7406\u3001\u5206\u7c7b\u540e\uff0c\u628a\u8fd9\u4e9b\u5e38\u7528\u7684\u547d\u4ee4\u5408\u7406\u5b89\u6392\u5230\u4e86\u540e\u7eed\u7ae0\u8282\u4e2d\uff0c\u7136\u540e\u91c7\u7528\u4ee5\u7ec3\u4ee3\u5b66\u7684\u65b9\u5f0f\u6765\u52a0\u6df1\u8bfb\u8005\u7684\u7406\u89e3\u548c\u638c\u63e1\u3002\u4ece\u6570\u5e74\u7684\u57f9\u8bad\u6210\u679c\u53cd\u9988\u6765\u770b\uff0c\u8fd9\u79cd\u65b9\u5f0f\u76f8\u5f53\u6709\u6548\uff0c\u56e0\u6b64\u4e5f\u76f8\u4fe1\u8fd9\u79cd\u65b9\u5f0f\u80af\u5b9a\u9002\u5408\u60a8\u7684\u5b66\u4e60\u3002<\/p>\n

1\uff0eecho\u547d\u4ee4<\/strong><\/p>\n

echo\u547d\u4ee4\u7528\u4e8e\u5728\u7ec8\u7aef\u8f93\u51fa\u5b57\u7b26\u4e32\u6216\u53d8\u91cf\u63d0\u53d6\u540e\u7684\u503c\uff0c\u683c\u5f0f\u4e3a\u201cecho [\u5b57\u7b26\u4e32\u00a0|\u00a0$\u53d8\u91cf]\u201d\u3002<\/p>\n

\u4f8b\u5982\uff0c\u628a\u6307\u5b9a\u5b57\u7b26\u4e32\u201clrxjmw.cn\u201d\u8f93\u51fa\u5230\u7ec8\u7aef\u5c4f\u5e55\u7684\u547d\u4ee4\u4e3a\uff1a<\/p>\n

[root@linuxprobe ~]# echo lrxjmw.cn\r\n<\/pre>\n

\u8be5\u547d\u4ee4\u4f1a\u5728\u7ec8\u7aef\u5c4f\u5e55\u4e0a\u663e\u793a\u5982\u4e0b\u4fe1\u606f\uff1a<\/p>\n

lrxjmw.cn<\/pre>\n

\u4e0b\u9762\uff0c\u6211\u4eec\u4f7f\u7528$\u53d8\u91cf\u7684\u65b9\u5f0f\u63d0\u53d6\u53d8\u91cfSHELL\u7684\u503c\uff0c\u5e76\u5c06\u5176\u8f93\u51fa\u5230\u5c4f\u5e55\u4e0a\uff1a<\/p>\n

[root@linuxprobe ~]# echo $SHELL\r\n\/bin\/bash<\/pre>\n

2\uff0edate\u547d\u4ee4<\/strong><\/p>\n

date\u547d\u4ee4\u7528\u4e8e\u663e\u793a\u53ca\u8bbe\u7f6e\u7cfb\u7edf\u7684\u65f6\u95f4\u6216\u65e5\u671f\uff0c\u683c\u5f0f\u4e3a\u201cdate [\u9009\u9879] [+\u6307\u5b9a\u7684\u683c\u5f0f]\u201d\u3002<\/p>\n

\u53ea\u9700\u5728\u5f3a\u5927\u7684date\u547d\u4ee4\u4e2d\u8f93\u5165\u4ee5\u201c+\u201d\u53f7\u5f00\u5934\u7684\u53c2\u6570\uff0c\u5373\u53ef\u6309\u7167\u6307\u5b9a\u683c\u5f0f\u6765\u8f93\u51fa\u7cfb\u7edf\u7684\u65f6\u95f4\u6216\u65e5\u671f\uff0c\u8fd9\u6837\u5728\u65e5\u5e38\u5de5\u4f5c\u65f6\u4fbf\u53ef\u4ee5\u628a\u5907\u4efd\u6570\u636e\u7684\u547d\u4ee4\u4e0e\u6307\u5b9a\u683c\u5f0f\u8f93\u51fa\u7684\u65f6\u95f4\u4fe1\u606f\u7ed3\u5408\u5230\u4e00\u8d77\u3002\u4f8b\u5982\uff0c\u628a\u6253\u5305\u540e\u7684\u6587\u4ef6\u81ea\u52a8\u6309\u7167\u201c\u5e74-\u6708-\u65e5\u201d\u7684\u683c\u5f0f\u6253\u5305\u6210\u201cbackup-2017-9-1.tar.gz\u201d\uff0c\u7528\u6237\u53ea\u9700\u8981\u770b\u4e00\u773c\u6587\u4ef6\u540d\u79f0\u5c31\u80fd\u5927\u6982\u4e86\u89e3\u5230\u6bcf\u4e2a\u6587\u4ef6\u7684\u5907\u4efd\u65f6\u95f4\u4e86\u3002date\u547d\u4ee4\u4e2d\u5e38\u89c1\u7684\u53c2\u6570\u683c\u5f0f\u53ca\u4f5c\u7528\u5982\u88682-4\u6240\u793a\u3002<\/p>\n

\u88682-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 date\u547d\u4ee4\u4e2d\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
%S<\/td>\n\u79d2\uff0800\uff5e59\uff09<\/td>\n<\/tr>\n
%M<\/td>\n\u5206\u949f\uff0800\uff5e59\uff09<\/td>\n<\/tr>\n
%H<\/td>\n\u5c0f\u65f6\uff0800\uff5e23\uff09<\/td>\n<\/tr>\n
%I<\/td>\n\u5c0f\u65f6\uff0800\uff5e12\uff09<\/td>\n<\/tr>\n
%m<\/td>\n\u6708\u4efd\uff081~12\uff09<\/td>\n<\/tr>\n
%p<\/td>\n\u663e\u793a\u51faAM\u6216PM<\/td>\n<\/tr>\n
%a <\/td>\n\u7f29\u5199\u7684\u5de5\u4f5c\u65e5\u540d\u79f0\uff08\u4f8b\u5982\uff1aSun\uff09<\/td>\n<\/tr>\n
%A <\/td>\n\u5b8c\u6574\u7684\u5de5\u4f5c\u65e5\u540d\u79f0\uff08\u4f8b\u5982\uff1aSunday\uff09<\/td>\n<\/tr>\n
%b<\/td>\n\u7f29\u5199\u7684\u6708\u4efd\u540d\u79f0\uff08\u4f8b\u5982\uff1aJan\uff09<\/td>\n<\/tr>\n
%B<\/td>\n\u5b8c\u6574\u7684\u6708\u4efd\u540d\u79f0\uff08\u4f8b\u5982\uff1aJanuary\uff09<\/td>\n<\/tr>\n
%q<\/td>\n\u5b63\u5ea6\uff081~4\uff09<\/td>\n<\/tr>\n
%y <\/td>\n\u7b80\u5199\u5e74\u4efd\uff08\u4f8b\u5982\uff1a25\uff09<\/td>\n<\/tr>\n
%Y<\/td>\n\u5b8c\u6574\u5e74\u4efd\uff08\u4f8b\u5982\uff1a2025\uff09<\/td>\n<\/tr>\n
%d<\/td>\n\u672c\u6708\u4e2d\u7684\u7b2c\u51e0\u5929<\/td>\n<\/tr>\n
%j<\/td>\n\u4eca\u5e74\u4e2d\u7684\u7b2c\u51e0\u5929<\/td>\n<\/tr>\n
%n <\/td>\n\u6362\u884c\u7b26\uff08\u76f8\u5f53\u4e8e\u6309\u4e0b\u56de\u8f66\u952e\uff09<\/td>\n<\/tr>\n
%t<\/td>\n\u8df3\u683c\uff08\u76f8\u5f53\u4e8e\u6309\u4e0bTab\u952e\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u6309\u7167\u9ed8\u8ba4\u683c\u5f0f\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u65f6\u95f4\u7684date\u547d\u4ee4\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

[root@linuxprobe ~]# date\r\nMon\u00a0Aug\u00a024\u00a016:11:23\u00a0CST\u00a02017<\/pre>\n

\u6309\u7167\u201c\u5e74-\u6708-\u65e5 \u5c0f\u65f6:\u5206\u949f:\u79d2\u201d\u7684\u683c\u5f0f\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u65f6\u95f4\u7684date\u547d\u4ee4\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

[root@linuxprobe ~]# date \"+%Y-%m-%d %H:%M:%S\"\r\n2017-08-24 16:29:12\r\n<\/pre>\n

\u5c06\u7cfb\u7edf\u7684\u5f53\u524d\u65f6\u95f4\u8bbe\u7f6e\u4e3a2017\u5e749\u67081\u65e58\u70b930\u5206\u7684date\u547d\u4ee4\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

[root@linuxprobe ~]# date -s \"20170901 8:30:00\"\r\nFri\u00a0Sep\u00a01\u00a008:30:00\u00a0CST\u00a02017<\/pre>\n

\u518d\u6b21\u4f7f\u7528date\u547d\u4ee4\u5e76\u6309\u7167\u9ed8\u8ba4\u7684\u683c\u5f0f\u67e5\u770b\u5f53\u524d\u7684\u7cfb\u7edf\u65f6\u95f4\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

[root@linuxprobe ~]# date\r\nFri\u00a0Sep\u00a01\u00a008:30:01\u00a0CST\u00a02017<\/pre>\n

date\u547d\u4ee4\u4e2d\u7684\u53c2\u6570%j\u53ef\u7528\u6765\u67e5\u770b\u4eca\u5929\u662f\u5f53\u5e74\u4e2d\u7684\u7b2c\u51e0\u5929\u3002\u8fd9\u4e2a\u53c2\u6570\u80fd\u591f\u5f88\u597d\u5730\u533a\u5206\u5907\u4efd\u65f6\u95f4\u7684\u65b0\u65e7\uff0c\u5373\u6570\u5b57\u8d8a\u5927\uff0c\u8d8a\u9760\u8fd1\u5f53\u524d\u65f6\u95f4\u3002\u8be5\u53c2\u6570\u7684\u4f7f\u7528\u65b9\u5f0f\u4ee5\u53ca\u663e\u793a\u7ed3\u679c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n

[root@linuxprobe ~]# date \"+%j\"\r\n244\r\n<\/pre>\n

3\uff0ereboot\u547d\u4ee4<\/strong><\/p>\n

reboot\u547d\u4ee4\u7528\u4e8e\u91cd\u542f\u7cfb\u7edf\uff0c\u5176\u683c\u5f0f\u4e3areboot\u3002<\/p>\n

\u7531\u4e8e\u91cd\u542f\u8ba1\u7b97\u673a\u8fd9\u79cd\u64cd\u4f5c\u4f1a\u6d89\u53ca\u786c\u4ef6\u8d44\u6e90\u7684\u7ba1\u7406\u6743\u9650\uff0c\u56e0\u6b64\u9ed8\u8ba4\u53ea\u80fd\u4f7f\u7528root\u7ba1\u7406\u5458\u6765\u91cd\u542f\uff0c\u5176\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n

[root@linuxprobe ~]# reboot\r\n<\/pre>\n

4\uff0epoweroff\u547d\u4ee4<\/strong><\/p>\n

poweroff\u547d\u4ee4\u7528\u4e8e\u5173\u95ed\u7cfb\u7edf\uff0c\u5176\u683c\u5f0f\u4e3apoweroff\u3002<\/p>\n

\u8be5\u547d\u4ee4\u4e0ereboot\u547d\u4ee4\u76f8\u540c\uff0c\u90fd\u4f1a\u6d89\u53ca\u786c\u4ef6\u8d44\u6e90\u7684\u7ba1\u7406\u6743\u9650\uff0c\u56e0\u6b64\u9ed8\u8ba4\u53ea\u6709root\u7ba1\u7406\u5458\u624d\u53ef\u4ee5\u5173\u95ed\u7535\u8111\uff0c\u5176\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n

[root@linuxprobe ~]# poweroff<\/pre>\n

5\uff0ewget\u547d\u4ee4<\/strong><\/p>\n

wget\u547d\u4ee4\u7528\u4e8e\u5728\u7ec8\u7aef\u4e2d\u4e0b\u8f7d\u7f51\u7edc\u6587\u4ef6\uff0c\u683c\u5f0f\u4e3a\u201cwget [\u53c2\u6570] \u4e0b\u8f7d\u5730\u5740\u201d\u3002<\/p>\n

\u5982\u679c\u60a8\u6ca1\u6709Linux\u7cfb\u7edf\u7684\u7ba1\u7406\u7ecf\u9a8c\uff0c\u5f53\u524d\u53ea\u9700\u4e86\u89e3\u4e00\u4e0bwget\u547d\u4ee4\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528\uff0c\u7136\u540e\u770b\u4e00\u4e0b\u4e0b\u9762\u7684\u6f14\u793a\u5b9e\u9a8c\u5373\u53ef\uff0c\u5207\u8bb0\u4e0d\u8981\u6025\u4e8e\u6c42\u6210\u3002\u540e\u9762\u7ae0\u8282\u5c06\u9010\u6b65\u8bb2\u89e3Linux\u7cfb\u7edf\u7684\u914d\u7f6e\u7ba1\u7406\u65b9\u6cd5\uff0c\u53ef\u4ee5\u7b49\u60a8\u638c\u63e1\u4e86\u7f51\u5361\u7684\u914d\u7f6e\u65b9\u6cd5\u540e\u518d\u6765\u8fdb\u884c\u8fd9\u4e2a\u5b9e\u9a8c\u64cd\u4f5c\u3002\u88682-5\u6240\u793a\u4e3awget\u547d\u4ee4\u7684\u53c2\u6570\u4ee5\u53ca\u53c2\u6570\u7684\u4f5c\u7528\u3002<\/p>\n

\u88682-5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 wget\u547d\u4ee4\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-b<\/td>\n\u540e\u53f0\u4e0b\u8f7d\u6a21\u5f0f<\/td>\n<\/tr>\n
-P<\/td>\n\u4e0b\u8f7d\u5230\u6307\u5b9a\u76ee\u5f55<\/td>\n<\/tr>\n
-t<\/td>\n\u6700\u5927\u5c1d\u8bd5\u6b21\u6570<\/td>\n<\/tr>\n
-c<\/td>\n\u65ad\u70b9\u7eed\u4f20<\/td>\n<\/tr>\n
-p<\/td>\n\u4e0b\u8f7d\u9875\u9762\u5185\u6240\u6709\u8d44\u6e90\uff0c\u5305\u62ec\u56fe\u7247\u3001\u89c6\u9891\u7b49<\/td>\n<\/tr>\n
-r<\/td>\n\u9012\u5f52\u4e0b\u8f7d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5c1d\u8bd5\u4f7f\u7528wget\u547d\u4ee4\u4ece\u672c\u4e66\u7684\u914d\u5957\u7ad9\u70b9\u4e2d\u4e0b\u8f7d\u672c\u4e66\u7684\u6700\u65b0pdf\u683c\u5f0f\u7535\u5b50\u6587\u6863\uff0c\u8fd9\u4e2a\u6587\u4ef6\u7684\u5b8c\u6574\u8def\u5f84\u4e3ahttps:\/\/lrxjmw.cn\/docs\/LinuxProbe.pdf<\/a>\uff0c\u6267\u884c\u8be5\u547d\u4ee4\u540e\u7684\u4e0b\u8f7d\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n

[root@linuxprobe\u00a0~]#\u00a0wget\u00a0https:\/\/lrxjmw.cn\/docs\/LinuxProbe.pdf\r\n--2017-08-24\u00a019:30:12\u00a0--\u00a0https:\/\/lrxjmw.cn\/docs\/LinuxProbe.pdf\r\nResolving\u00a0lrxjmw.cn\u00a0(lrxjmw.cn)...\u00a0220.181.105.185\r\nConnecting\u00a0to\u00a0lrxjmw.cn\u00a0(lrxjmw.cn)|220.181.105.185|:80...connected.\r\nHTTP\u00a0request\u00a0sent,\u00a0awaiting\u00a0response...\u00a0200\u00a0OK\r\nLength:\u00a045948568\u00a0(44M)\u00a0[application\/pdf]\r\nSaving\u00a0to:\u00a0\u2018LinuxProbe.pdf\u2019\r\n100%[===========================================>]\u00a045,948,568\u00a032.9MB\/s\u00a0in\u00a01.3s\r\n2017-08-24\u00a019:30:14\u00a0(32.9\u00a0MB\/s)\u00a0-\u00a0\u2018LinuxProbe.pdf\u2019\u00a0saved\u00a0[45948568\/45948568]<\/pre>\n

\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f7f\u7528wget\u547d\u4ee4\u9012\u5f52\u4e0b\u8f7dlrxjmw.cn<\/a>\u7f51\u7ad9\u5185\u7684\u6240\u6709\u9875\u9762\u6570\u636e\u4ee5\u53ca\u6587\u4ef6\uff0c\u4e0b\u8f7d\u5b8c\u540e\u4f1a\u81ea\u52a8\u4fdd\u5b58\u5230\u5f53\u524d\u8def\u5f84\u4e0b\u4e00\u4e2a\u540d\u4e3alrxjmw.cn\u7684\u76ee\u5f55\u4e2d\u3002\u6267\u884c\u8be5\u64cd\u4f5c\u7684\u547d\u4ee4\u4e3awget -r -p https:\/\/lrxjmw.cn<\/a>\uff0c\u8be5\u547d\u4ee4\u7684\u6267\u884c\u7ed3\u679c\u5982\u4e0b\u3002<\/p>\n

[root@linuxprobe\u00a0~]#\u00a0wget\u00a0-r\u00a0-p\u00a0https:\/\/lrxjmw.cn\r\n--2017-08-24\u00a019:31:41--\u00a0https:\/\/lrxjmw.cn\/\r\nResolving\u00a0lrxjmw.cn...\u00a0106.185.25.197\r\nConnecting\u00a0to\u00a0lrxjmw.cn|106.185.25.197|:80...\u00a0connected.\r\nHTTP\u00a0request\u00a0sent,\u00a0awaiting\u00a0response...\u00a0200\u00a0OK\r\nLength:\u00a0unspecified\u00a0[text\/html]\r\nSaving\u00a0to:\u00a0'lrxjmw.cn\/index.html'\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u4e0b\u8f7d\u8fc7\u7a0b\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

6\uff0eps\u547d\u4ee4<\/strong><\/p>\n

ps\u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u7cfb\u7edf\u4e2d\u7684\u8fdb\u7a0b\u72b6\u6001\uff0c\u683c\u5f0f\u4e3a\u201cps [\u53c2\u6570]\u201d\u3002<\/p>\n

\u4f30\u8ba1\u8bfb\u8005\u5728\u7b2c\u4e00\u6b21\u6267\u884c\u8fd9\u4e2a\u547d\u4ee4\u65f6\u90fd\u8981\u60ca\u5446\u4e00\u4e0b\u2014\u600e\u4e48\u4f1a\u6709\u8fd9\u4e48\u591a\u8f93\u51fa\u503c\uff0c\u8fd9\u53ef\u600e\u4e48\u770b\u5f97\u8fc7\u6765\uff1f\u5176\u5b9e\uff0c\u5218\u9044\u8001\u5e08\u901a\u5e38\u4f1a\u5c06ps\u547d\u4ee4\u4e0e\u7b2c3\u7ae0\u7684\u7ba1\u9053\u7b26\u6280\u672f\u642d\u914d\u4f7f\u7528\uff0c\u7528\u6765\u6293\u53d6\u4e0e\u67d0\u4e2a\u6307\u5b9a\u670d\u52a1\u8fdb\u7a0b\u76f8\u5bf9\u5e94\u7684PID\u53f7\u7801\u3002ps\u547d\u4ee4\u7684\u5e38\u89c1\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528\u5982\u88682-6\u6240\u793a\u3002<\/p>\n

\u88682-6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ps\u547d\u4ee4\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-a<\/td>\n\u663e\u793a\u6240\u6709\u8fdb\u7a0b\uff08\u5305\u62ec\u5176\u4ed6\u7528\u6237\u7684\u8fdb\u7a0b\uff09<\/td>\n<\/tr>\n
-u<\/td>\n\u7528\u6237\u4ee5\u53ca\u5176\u4ed6\u8be6\u7ec6\u4fe1\u606f<\/td>\n<\/tr>\n
-x<\/td>\n\u663e\u793a\u6ca1\u6709\u63a7\u5236\u7ec8\u7aef\u7684\u8fdb\u7a0b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

Linux\u7cfb\u7edf\u4e2d\u65f6\u523b\u8fd0\u884c\u7740\u8bb8\u591a\u8fdb\u7a0b\uff0c\u5982\u679c\u80fd\u591f\u5408\u7406\u5730\u7ba1\u7406\u5b83\u4eec\uff0c\u5219\u53ef\u4ee5\u4f18\u5316\u7cfb\u7edf\u7684\u6027\u80fd\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u67095\u79cd\u5e38\u89c1\u7684\u8fdb\u7a0b\u72b6\u6001\uff0c\u5206\u522b\u4e3a\u8fd0\u884c\u3001\u4e2d\u65ad\u3001\u4e0d\u53ef\u4e2d\u65ad\u3001\u50f5\u6b7b\u4e0e\u505c\u6b62\uff0c\u5176\u5404\u81ea\u542b\u4e49\u5982\u4e0b\u6240\u793a\u3002<\/p>\n

R\uff08\u8fd0\u884c\uff09\uff1a<\/strong>\u8fdb\u7a0b\u6b63\u5728\u8fd0\u884c\u6216\u5728\u8fd0\u884c\u961f\u5217\u4e2d\u7b49\u5f85\u3002<\/p>\n

S\uff08\u4e2d\u65ad\uff09\uff1a<\/strong>\u8fdb\u7a0b\u5904\u4e8e\u4f11\u7720\u4e2d\uff0c\u5f53\u67d0\u4e2a\u6761\u4ef6\u5f62\u6210\u540e\u6216\u8005\u63a5\u6536\u5230\u4fe1\u53f7\u65f6\uff0c\u5219\u8131\u79bb\u8be5\u00a0\u00a0 \u72b6\u6001\u3002<\/p>\n

D\uff08\u4e0d\u53ef\u4e2d\u65ad\uff09\uff1a<\/strong>\u8fdb\u7a0b\u4e0d\u54cd\u5e94\u7cfb\u7edf\u5f02\u6b65\u4fe1\u53f7\uff0c\u5373\u4fbf\u7528kill\u547d\u4ee4\u4e5f\u4e0d\u80fd\u5c06\u5176\u4e2d\u65ad\u3002<\/p>\n

Z\uff08\u50f5\u6b7b\uff09\uff1a<\/strong>\u8fdb\u7a0b\u5df2\u7ecf\u7ec8\u6b62\uff0c\u4f46\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u4f9d\u7136\u5b58\u5728, \u76f4\u5230\u7236\u8fdb\u7a0b\u8c03\u7528wait4()\u7cfb\u7edf\u51fd\u6570\u540e\u5c06\u8fdb\u7a0b\u91ca\u653e\u3002<\/p>\n

T\uff08\u505c\u6b62\uff09\uff1a<\/strong>\u8fdb\u7a0b\u6536\u5230\u505c\u6b62\u4fe1\u53f7\u540e\u505c\u6b62\u8fd0\u884c\u3002<\/p><\/blockquote>\n

\u5f53\u6267\u884cps aux\u547d\u4ee4\u540e\u901a\u5e38\u4f1a\u770b\u5230\u5982\u88682-7\u6240\u793a\u7684\u8fdb\u7a0b\u72b6\u6001\uff0c\u88682-7\u4e2d\u53ea\u662f\u5217\u4e3e\u4e86\u90e8\u5206\u8f93\u51fa\u503c\uff0c\u800c\u4e14\u6b63\u5e38\u7684\u8f93\u51fa\u503c\u4e2d\u4e0d\u5305\u62ec\u4e2d\u6587\u6ce8\u91ca\u3002<\/p>\n

\u88682-7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u8fdb\u7a0b\u72b6\u6001<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
USER<\/td>\nPID<\/td>\n%CPU<\/td>\n%MEM<\/td>\nVSZ<\/td>\nRSS<\/td>\nTTY<\/td>\nSTAT<\/td>\nSTART<\/td>\nTIME<\/td>\nCOMMAND<\/td>\n<\/tr>\n
\u8fdb\u7a0b\u7684\u6240\u6709\u8005<\/td>\n\u8fdb\u7a0bID\u53f7<\/td>\n\u8fd0\u7b97\u5668\u5360\u7528\u7387<\/td>\n\u5185\u5b58\u5360\u7528\u7387<\/td>\n\u865a\u62df\u5185\u5b58\u4f7f\u7528\u91cf(\u5355\u4f4d\u662fKB)<\/td>\n\u5360\u7528\u7684\u56fa\u5b9a\u5185\u5b58\u91cf(\u5355\u4f4d\u662fKB)<\/td>\n\u6240\u5728\u7ec8\u7aef<\/td>\n\u8fdb\u7a0b\u72b6\u6001<\/td>\n\u88ab\u542f\u52a8\u7684\u65f6\u95f4<\/td>\n\u5b9e\u9645\u4f7f\u7528CPU\u7684\u65f6\u95f4<\/td>\n\u547d\u4ee4\u540d\u79f0\u4e0e\u53c2\u6570<\/td>\n<\/tr>\n
root<\/td>\n1<\/td>\n0.0<\/td>\n0.8<\/td>\n172520<\/td>\n16372<\/td>\n?<\/td>\nSs<\/td>\n18:49<\/td>\n0:01<\/td>\n\/usr\/lib\/systemd\/s
\nystemd rhgb --switched-root --system --deserialize 31<\/td>\n<\/tr>\n
root<\/td>\n2<\/td>\n0.0<\/td>\n0.0<\/td>\n0<\/td>\n0<\/td>\n?<\/td>\nS<\/td>\n18:49<\/td>\n0:00<\/td>\n[kthreadd]<\/td>\n<\/tr>\n
root<\/td>\n3<\/td>\n0.0<\/td>\n0.0<\/td>\n0<\/td>\n0<\/td>\n?<\/td>\nI<\/td>\n18:49<\/td>\n0:00<\/td>\n[rcu_gp]<\/td>\n<\/tr>\n
root<\/td>\n4<\/td>\n0.0<\/td>\n0.0<\/td>\n0<\/td>\n0<\/td>\n?<\/td>\nI<\/td>\n18:49<\/td>\n0:00<\/td>\n[rcu_par_gp]<\/td>\n<\/tr>\n
root<\/td>\n5<\/td>\n0.0<\/td>\n0.0<\/td>\n0<\/td>\n0<\/td>\n?<\/td>\nI<\/td>\n18:49<\/td>\n0:00<\/td>\n[slub_flushwq]<\/td>\n<\/tr>\n
root<\/td>\n6<\/td>\n0.0<\/td>\n0.0<\/td>\n0<\/td>\n0<\/td>\n?<\/td>\nI<\/td>\n18:49<\/td>\n0:00<\/td>\n[netns]<\/td>\n<\/tr>\n
root<\/td>\n7<\/td>\n0.0<\/td>\n0.0<\/td>\n0<\/td>\n0<\/td>\n?<\/td>\nI<\/td>\n18:49<\/td>\n0:00<\/td>\n[kworker\/0:0H-even<\/td>\n<\/tr>\n
root<\/td>\n8<\/td>\n0.0<\/td>\n0.0<\/td>\n0<\/td>\n0<\/td>\n?<\/td>\nI<\/td>\n18:49<\/td>\n0:00<\/td>\nts_highpri]<\/td>\n<\/tr>\n
root<\/td>\n9<\/td>\n0.0<\/td>\n0.0<\/td>\n0<\/td>\n0<\/td>\n?<\/td>\nI<\/td>\n18:49<\/td>\n0:00<\/td>\n[kworker\/0:1H-kblo<\/td>\n<\/tr>\n
<\/td>\n\u2026\u2026\u2026\u2026\u2026\u2026<\/td>\n\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f<\/td>\n\u2026\u2026\u2026\u2026\u2026\u2026<\/td>\nckd]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5982\u524d\u9762\u6240\u63d0\u5230\u7684\uff0c\u5728Linux\u7cfb\u7edf\u4e2d\u7684\u547d\u4ee4\u53c2\u6570\u6709\u957f\u77ed\u683c\u5f0f\u4e4b\u5206\uff0c\u957f\u683c\u5f0f\u548c\u957f\u683c\u5f0f\u4e4b\u95f4\u4e0d\u80fd\u5408\u5e76\uff0c\u957f\u683c\u5f0f\u548c\u77ed\u683c\u5f0f\u4e4b\u95f4\u4e5f\u4e0d\u80fd\u5408\u5e76\uff0c\u4f46\u77ed\u683c\u5f0f\u548c\u77ed\u683c\u5f0f\u4e4b\u95f4\u662f\u53ef\u4ee5\u5408\u5e76\u7684\uff0c\u5408\u5e76\u540e\u4ec5\u4fdd\u7559\u4e00\u4e2a-\uff08\u51cf\u53f7\uff09\u5373\u53ef\u3002\u53e6\u5916ps\u547d\u4ee4\u53ef\u5141\u8bb8\u53c2\u6570\u4e0d\u52a0\u51cf\u53f7\uff08-\uff09\uff0c\u56e0\u6b64\u53ef\u76f4\u63a5\u5199\u6210ps aux\u7684\u6837\u5b50\u3002<\/p><\/blockquote>\n

7\uff0etop\u547d\u4ee4<\/strong><\/p>\n

top\u547d\u4ee4\u7528\u4e8e\u52a8\u6001\u5730\u76d1\u89c6\u8fdb\u7a0b\u6d3b\u52a8\u4e0e\u7cfb\u7edf\u8d1f\u8f7d\u7b49\u4fe1\u606f\uff0c\u5176\u683c\u5f0f\u4e3atop\u3002<\/p>\n

top\u547d\u4ee4\u76f8\u5f53\u5f3a\u5927\uff0c\u80fd\u591f\u52a8\u6001\u5730\u67e5\u770b\u7cfb\u7edf\u8fd0\u7ef4\u72b6\u6001\uff0c\u5b8c\u5168\u5c06\u5b83\u770b\u4f5cLinux\u4e2d\u7684\u201c\u5f3a\u5316\u7248\u7684Windows\u4efb\u52a1\u7ba1\u7406\u5668\u201d\u3002top\u547d\u4ee4\u7684\u8fd0\u884c\u754c\u9762\u5982\u56fe2-6\u6240\u793a\u3002<\/p>\n

\"top\u547d\u4ee4\"<\/p>\n

\u56fe2-6\u00a0 top\u547d\u4ee4\u7684\u8fd0\u884c\u754c\u9762<\/p>\n

\u5728\u56fe2-6\u4e2d\uff0ctop\u547d\u4ee4\u6267\u884c\u7ed3\u679c\u7684\u524d5\u884c\u4e3a\u7cfb\u7edf\u6574\u4f53\u7684\u7edf\u8ba1\u4fe1\u606f\uff0c\u5176\u6240\u4ee3\u8868\u7684\u542b\u4e49\u5982\u4e0b\u3002<\/p>\n

\u7b2c1\u884c\uff1a\u7cfb\u7edf\u65f6\u95f4\u3001\u8fd0\u884c\u65f6\u95f4\u3001\u767b\u5f55\u7ec8\u7aef\u6570\u3001\u7cfb\u7edf\u8d1f\u8f7d\uff08\u4e09\u4e2a\u6570\u503c\u5206\u522b\u4e3a1\u5206\u949f\u30015\u5206\u949f\u300115\u5206\u949f\u5185\u7684\u5e73\u5747\u503c\uff0c\u6570\u503c\u8d8a\u5c0f\u610f\u5473\u7740\u8d1f\u8f7d\u8d8a\u4f4e\uff09\u3002<\/p>\n

\u7b2c2\u884c\uff1a\u8fdb\u7a0b\u603b\u6570\u3001\u8fd0\u884c\u4e2d\u7684\u8fdb\u7a0b\u6570\u3001\u7761\u7720\u4e2d\u7684\u8fdb\u7a0b\u6570\u3001\u505c\u6b62\u7684\u8fdb\u7a0b\u6570\u3001\u50f5\u6b7b\u7684\u8fdb\u7a0b\u6570\u3002<\/p>\n

\u7b2c3\u884c\uff1a\u7528\u6237\u5360\u7528\u8d44\u6e90\u767e\u5206\u6bd4\u3001\u7cfb\u7edf\u5185\u6838\u5360\u7528\u8d44\u6e90\u767e\u5206\u6bd4\u3001\u6539\u53d8\u8fc7\u4f18\u5148\u7ea7\u7684\u8fdb\u7a0b\u8d44\u6e90\u767e\u5206\u6bd4\u3001\u7a7a\u95f2\u7684\u8d44\u6e90\u767e\u5206\u6bd4\u7b49\u3002\u5176\u4e2d\u6570\u636e\u5747\u4e3aCPU\u6570\u636e\u5e76\u4ee5\u767e\u5206\u6bd4\u683c\u5f0f\u663e\u793a\uff0c\u4f8b\u5982\u201c97.1 id\u201d\u610f\u5473\u7740\u670997.1%\u7684CPU\u5904\u7406\u5668\u8d44\u6e90\u5904\u4e8e\u7a7a\u95f2\u3002<\/p>\n

\u7b2c4\u884c\uff1a\u7269\u7406\u5185\u5b58\u603b\u91cf\u3001\u5185\u5b58\u4f7f\u7528\u91cf\u3001\u5185\u5b58\u7a7a\u95f2\u91cf\u3001\u4f5c\u4e3a\u5185\u6838\u7f13\u5b58\u7684\u5185\u5b58\u91cf\u3002<\/p>\n

\u7b2c5\u884c\uff1a\u865a\u62df\u5185\u5b58\u603b\u91cf\u3001\u865a\u62df\u5185\u5b58\u4f7f\u7528\u91cf\u3001\u865a\u62df\u5185\u5b58\u7a7a\u95f2\u91cf\u3001\u5df2\u88ab\u63d0\u524d\u52a0\u8f7d\u7684\u5185\u5b58\u91cf\u3002<\/p><\/blockquote>\n

8\uff0epidof\u547d\u4ee4<\/strong><\/p>\n

pidof\u547d\u4ee4\u7528\u4e8e\u67e5\u8be2\u67d0\u4e2a\u6307\u5b9a\u670d\u52a1\u8fdb\u7a0b\u7684PID\u503c\uff0c\u683c\u5f0f\u4e3a\u201cpidof [\u53c2\u6570] [\u670d\u52a1\u540d\u79f0]\u201d\u3002<\/p>\n

\u6bcf\u4e2a\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u53f7\u7801\u503c\uff08PID\uff09\u662f\u552f\u4e00\u7684\uff0c\u56e0\u6b64\u53ef\u4ee5\u901a\u8fc7PID\u6765\u533a\u5206\u4e0d\u540c\u7684\u8fdb\u7a0b\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u6765\u67e5\u8be2\u672c\u673a\u4e0asshd\u670d\u52a1\u7a0b\u5e8f\u7684PID\uff1a<\/p>\n

[root@linuxprobe ~]# pidof sshd\r\n2156<\/pre>\n

9\uff0ekill\u547d\u4ee4<\/strong><\/p>\n

kill\u547d\u4ee4\u7528\u4e8e\u7ec8\u6b62\u67d0\u4e2a\u6307\u5b9aPID\u7684\u670d\u52a1\u8fdb\u7a0b\uff0c\u683c\u5f0f\u4e3a\u201ckill [\u53c2\u6570] [\u8fdb\u7a0bPID]\u201d\u3002<\/p>\n

\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f7f\u7528kill\u547d\u4ee4\u628a\u4e0a\u9762\u7528pidof\u547d\u4ee4\u67e5\u8be2\u5230\u7684PID\u6240\u4ee3\u8868\u7684\u8fdb\u7a0b\u7ec8\u6b62\u6389\uff0c\u5176\u547d\u4ee4\u5982\u4e0b\u6240\u793a\u3002\u8fd9\u79cd\u64cd\u4f5c\u7684\u6548\u679c\u7b49\u540c\u4e8e\u5f3a\u5236\u505c\u6b62sshd\u670d\u52a1\u3002<\/p>\n

[root@linuxprobe ~]# kill 2156<\/pre>\n

10\uff0ekillall\u547d\u4ee4<\/strong><\/p>\n

killall\u547d\u4ee4\u7528\u4e8e\u7ec8\u6b62\u67d0\u4e2a\u6307\u5b9a\u540d\u79f0\u7684\u670d\u52a1\u6240\u5bf9\u5e94\u7684\u5168\u90e8\u8fdb\u7a0b\uff0c\u683c\u5f0f\u4e3a\uff1a\u201ckillall [\u53c2\u6570] [\u670d\u52a1\u540d\u79f0]\u201d\u3002<\/p>\n

\u901a\u5e38\u6765\u8bb2\uff0c\u590d\u6742\u8f6f\u4ef6\u7684\u670d\u52a1\u7a0b\u5e8f\u4f1a\u6709\u591a\u4e2a\u8fdb\u7a0b\u534f\u540c\u4e3a\u7528\u6237\u63d0\u4f9b\u670d\u52a1\uff0c\u5982\u679c\u9010\u4e2a\u53bb\u7ed3\u675f\u8fd9\u4e9b\u8fdb\u7a0b\u4f1a\u6bd4\u8f83\u9ebb\u70e6\uff0c\u6b64\u65f6\u53ef\u4ee5\u4f7f\u7528killall\u547d\u4ee4\u6765\u6279\u91cf\u7ed3\u675f\u67d0\u4e2a\u670d\u52a1\u7a0b\u5e8f\u5e26\u6709\u7684\u5168\u90e8\u8fdb\u7a0b\u3002\u4e0b\u9762\u4ee5httpd\u670d\u52a1\u7a0b\u5e8f\u4e3a\u4f8b\uff0c\u6765\u7ed3\u675f\u5176\u5168\u90e8\u8fdb\u7a0b\u3002\u7531\u4e8eRHEL7\u7cfb\u7edf\u9ed8\u8ba4\u6ca1\u6709\u5b89\u88c5httpd\u670d\u52a1\u7a0b\u5e8f\uff0c\u56e0\u6b64\u5927\u5bb6\u6b64\u65f6\u53ea\u9700\u770b\u64cd\u4f5c\u8fc7\u7a0b\u548c\u8f93\u51fa\u7ed3\u679c\u5373\u53ef\uff0c\u7b49\u5b66\u4e60\u4e86\u76f8\u5173\u5185\u5bb9\u4e4b\u540e\u518d\u6765\u5b9e\u8df5\u3002<\/p>\n

[root@linuxprobe ~]# pidof httpd\r\n13581 13580 13579 13578 13577 13576\r\n[root@linuxprobe ~]# killall httpd\r\n[root@linuxprobe ~]# pidof httpd\r\n[root@linuxprobe ~]# \r\n<\/pre>\n

\u5982\u679c\u6211\u4eec\u5728\u7cfb\u7edf\u7ec8\u7aef\u4e2d\u6267\u884c\u4e00\u4e2a\u547d\u4ee4\u540e\u60f3\u7acb\u5373\u505c\u6b62\u5b83\uff0c\u53ef\u4ee5\u540c\u65f6\u6309\u4e0bCtrl + C\u7ec4\u5408\u952e\uff08\u751f\u4ea7\u73af\u5883\u4e2d\u6bd4\u8f83\u5e38\u7528\u7684\u4e00\u4e2a\u5feb\u6377\u952e\uff09\uff0c\u8fd9\u6837\u5c06\u7acb\u5373\u7ec8\u6b62\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u3002\u6216\u8005\uff0c\u5982\u679c\u6709\u4e9b\u547d\u4ee4\u5728\u6267\u884c\u65f6\u4e0d\u65ad\u5730\u5728\u5c4f\u5e55\u4e0a\u8f93\u51fa\u4fe1\u606f\uff0c\u5f71\u54cd\u5230\u540e\u7eed\u547d\u4ee4\u7684\u8f93\u5165\uff0c\u5219\u53ef\u4ee5\u5728\u6267\u884c\u547d\u4ee4\u65f6\u5728\u672b\u5c3e\u6dfb\u52a0\u4e0a\u4e00\u4e2a&\u7b26\u53f7\uff0c\u8fd9\u6837\u547d\u4ee4\u5c06\u8fdb\u5165\u7cfb\u7edf\u540e\u53f0\u6765\u6267\u884c\u3002<\/p>\n

\u5f88\u591a\u540c\u5b66\u5728\u62a5\u540d\u5218\u9044\u8001\u5e08\u57f9\u8bad\u8bfe\u7a0b\u65f6\u4f1a\u63d0\u5230\u81ea\u5df1\u7684\u82f1\u8bed\u57fa\u7840\u4e0d\u597d\uff0c\u5176\u5b9e\u5927\u53ef\u4e0d\u5fc5\u62c5\u5fc3\uff0c\u56e0\u4e3a\u54b1\u4eec\u7684\u4e66\u7c4d\u3001\u57f9\u8bad\u8bfe\u7a0b\u751a\u81f3\u7ea2\u5e3d\u8003\u9898\u90fd\u662f\u4e2d\u6587\u7684\u3002\u800c\u63a5\u4e0b\u6765\u60a8\u4e5f\u5c31\u4f1a\u53d1\u73b0\uff0c\u539f\u6765\u4e00\u76f4\u4f7f\u7528\u7684\u662fLinux\u547d\u4ee4\uff0c\u800c\u7edd\u4e0d\u662f\u7eaf\u7cb9\u7684\u82f1\u8bed\u5355\u8bcd\uff0c\u5373\u4fbf\u5b83\u4eec\u7684\u62fc\u5199100%\u76f8\u540c\uff0c\u6700\u7ec8\u7528\u5904\u80af\u5b9a\u4e5f\u662f\u4e0d\u4e00\u6837\u7684\u3002\u56e0\u6b64\u5728\u5b66\u4e60Linux\u7cfb\u7edf\u6280\u672f\u7684\u8fd9\u4ef6\u4e8b\u4e0a\uff0c\u60a8\u8ddf\u82f1\u8bed\u8fbe\u4eba\u7edd\u5bf9\u90fd\u662f\u7ad9\u5728\u540c\u4e00\u8d77\u8dd1\u7ebf\u4e0a\u7684\uff0c\u66f4\u4f55\u51b5\u8fd8\u6b63\u786e\u7684\u9009\u62e9\u4e86\u4e00\u672c\u9002\u5408\u60a8\u7684Linux\u6559\u6750\uff0c\u653e\u5fc3\u5f00\u59cb\u5b66\u4e60\u5427\uff01<\/p>\n

\u5218\u9044\u8001\u5e08\u4e3b\u8bb2\u7684Linux\u6280\u672f\u57f9\u8bad\u8bfe\u7a0b\u4ecb\u7ecd\uff1ahttps:\/\/lrxjmw.cn\/training<\/a><\/p>\n

2.4 \u7cfb\u7edf\u72b6\u6001\u68c0\u6d4b\u547d\u4ee4<\/strong><\/span><\/h5>\n

\u4f5c\u4e3a\u4e00\u540d\u5408\u683c\u7684\u8fd0\u7ef4\u4eba\u5458\uff0c\u60f3\u8981\u66f4\u5feb\u3001\u66f4\u597d\u5730\u4e86\u89e3Linux\u670d\u52a1\u5668\uff0c\u5fc5\u987b\u5177\u5907\u5feb\u901f\u67e5\u770bLinux\u7cfb\u7edf\u8fd0\u884c\u72b6\u6001\u7684\u80fd\u529b\uff0c\u56e0\u6b64\u63a5\u4e0b\u6765\u4f1a\u9010\u4e2a\u8bb2\u89e3\u4e0e\u7f51\u5361\u7f51\u7edc\u3001\u7cfb\u7edf\u5185\u6838\u3001\u7cfb\u7edf\u8d1f\u8f7d\u3001\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3001\u5f53\u524d\u542f\u7528\u7ec8\u7aef\u6570\u91cf\u3001\u5386\u53f2\u767b\u5f55\u8bb0\u5f55\u3001\u547d\u4ee4\u6267\u884c\u8bb0\u5f55\u4ee5\u53ca\u6551\u63f4\u8bca\u65ad\u7b49\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\u65b9\u6cd5\u3002\u8fd9\u4e9b\u547d\u4ee4\u90fd\u8d85\u7ea7\u5b9e\u7528\uff0c\u8fd8\u8bf7\u8bfb\u8005\u7528\u5fc3\u5b66\u4e60\uff0c\u52a0\u4ee5\u638c\u63e1\u3002<\/p>\n

1\uff0eifconfig\u547d\u4ee4<\/strong><\/p>\n

ifconfig\u547d\u4ee4\u7528\u4e8e\u83b7\u53d6\u7f51\u5361\u914d\u7f6e\u4e0e\u7f51\u7edc\u72b6\u6001\u7b49\u4fe1\u606f\uff0c\u683c\u5f0f\u4e3a\u201cifconfig [\u7f51\u7edc\u8bbe\u5907] [\u53c2\u6570]\u201d\u3002<\/p>\n

\u4f7f\u7528ifconfig\u547d\u4ee4\u6765\u67e5\u770b\u672c\u673a\u5f53\u524d\u7684\u7f51\u5361\u914d\u7f6e\u4e0e\u7f51\u7edc\u72b6\u6001\u7b49\u4fe1\u606f\u65f6\uff0c\u5176\u5b9e\u4e3b\u8981\u67e5\u770b\u7684\u5c31\u662f\u7f51\u5361\u540d\u79f0\u3001inet\u53c2\u6570\u540e\u9762\u7684IP\u5730\u5740\u3001ether\u53c2\u6570\u540e\u9762\u7684\u7f51\u5361\u7269\u7406\u5730\u5740\uff08\u53c8\u79f0\u4e3aMAC\u5730\u5740\uff09\uff0c\u4ee5\u53caRX\u3001TX\u7684\u63a5\u6536\u6570\u636e\u5305\u4e0e\u53d1\u9001\u6570\u636e\u5305\u7684\u4e2a\u6570\u53ca\u7d2f\u8ba1\u6d41\u91cf\uff08\u5373\u4e0b\u9762\u52a0\u7c97\u7684\u4fe1\u606f\u5185\u5bb9\uff09\uff1a<\/p>\n

[root@linuxprobe ~]# ifconfig\r\neno16777728<\/strong>: flags=4163\u00a0 mtu 1500\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inet 192.168.10.10<\/strong>\u00a0 netmask 255.255.255.0\u00a0 broadcast 192.168.10.255\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inet6 fe80::20c:29ff:fec4:a409\u00a0 prefixlen 64\u00a0 scopeid 0x20\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ether 00:0c:29:c4:a4:09<\/strong>\u00a0 txqueuelen 1000\u00a0 (Ethernet)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RX packets 36\u00a0 bytes 3176 (3.1 KiB)<\/strong>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RX errors 0\u00a0 dropped 0\u00a0 overruns 0\u00a0 frame 0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TX packets 38\u00a0 bytes 4757 (4.6 KiB)<\/strong>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TX errors 0\u00a0 dropped 0 overruns 0\u00a0 carrier 0\u00a0 collisions 0\r\n\r\nlo: flags=73\u00a0 mtu 65536\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inet 127.0.0.1\u00a0 netmask 255.0.0.0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inet6 ::1\u00a0 prefixlen 128\u00a0 scopeid 0x10\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 loop\u00a0 txqueuelen 0\u00a0 (Local Loopback)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RX packets 386\u00a0 bytes 32780 (32.0 KiB)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RX errors 0\u00a0 dropped 0\u00a0 overruns 0\u00a0 frame 0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TX packets 386\u00a0 bytes 32780 (32.0 KiB)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TX errors 0\u00a0 dropped 0 overruns 0\u00a0 carrier 0\u00a0 collisions 0\r\n<\/pre>\n

2\uff0euname\u547d\u4ee4<\/strong><\/p>\n

uname\u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u7cfb\u7edf\u5185\u6838\u4e0e\u7cfb\u7edf\u7248\u672c\u7b49\u4fe1\u606f\uff0c\u683c\u5f0f\u4e3a\u201cuname [-a]\u201d\u3002<\/p>\n

\u5728\u4f7f\u7528uname\u547d\u4ee4\u65f6\uff0c\u4e00\u822c\u4f1a\u56fa\u5b9a\u642d\u914d\u4e0a-a\u53c2\u6570\u6765\u5b8c\u6574\u5730\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u7684\u5185\u6838\u540d\u79f0\u3001\u4e3b\u673a\u540d\u3001\u5185\u6838\u53d1\u884c\u7248\u672c\u3001\u8282\u70b9\u540d\u3001\u7cfb\u7edf\u65f6\u95f4\u3001\u786c\u4ef6\u540d\u79f0\u3001\u786c\u4ef6\u5e73\u53f0\u3001\u5904\u7406\u5668\u7c7b\u578b\u4ee5\u53ca\u64cd\u4f5c\u7cfb\u7edf\u540d\u79f0\u7b49\u4fe1\u606f\u3002<\/p>\n

[root@linuxprobe ~]# uname -a\r\nLinux lrxjmw.cn 3.10.0-123.el7.x86_64 #1 SMP Mon May 5 11:16:57 EDT 2017 x86_64 x86_64 x86_64 GNU\/Linux\r\n<\/pre>\n

\u987a\u5e26\u4e00\u63d0\uff0c\u5982\u679c\u8981\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5219\u9700\u8981\u67e5\u770bredhat-release\u6587\u4ef6\uff0c\u5176\u547d\u4ee4\u4ee5\u53ca\u76f8\u5e94\u7684\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n

[root@linuxprobe ~]# cat \/etc\/redhat-release\r\nRed Hat Enterprise Linux Server release 7.0 (Maipo)\r\n<\/pre>\n

3\uff0euptime\u547d\u4ee4<\/strong><\/p>\n

uptime\u7528\u4e8e\u67e5\u770b\u7cfb\u7edf\u7684\u8d1f\u8f7d\u4fe1\u606f\uff0c\u683c\u5f0f\u4e3auptime\u3002<\/p>\n

uptime\u547d\u4ee4\u771f\u7684\u5f88\u68d2\uff0c\u5b83\u53ef\u4ee5\u663e\u793a\u5f53\u524d\u7cfb\u7edf\u65f6\u95f4\u3001\u7cfb\u7edf\u5df2\u8fd0\u884c\u65f6\u95f4\u3001\u542f\u7528\u7ec8\u7aef\u6570\u91cf\u4ee5\u53ca\u5e73\u5747\u8d1f\u8f7d\u503c\u7b49\u4fe1\u606f\u3002\u5e73\u5747\u8d1f\u8f7d\u503c\u6307\u7684\u662f\u7cfb\u7edf\u5728\u6700\u8fd11\u5206\u949f\u30015\u5206\u949f\u300115\u5206\u949f\u5185\u7684\u538b\u529b\u60c5\u51b5\uff08\u4e0b\u9762\u52a0\u7c97\u7684\u4fe1\u606f\u90e8\u5206\uff09\uff1b\u8d1f\u8f7d\u503c\u8d8a\u4f4e\u8d8a\u597d\uff0c\u5c3d\u91cf\u4e0d\u8981\u957f\u671f\u8d85\u8fc71\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u4e0d\u8981\u8d85\u8fc75\u3002<\/p>\n

[root@linuxprobe ~]# uptime\r\n22:49:55 up 10 min, 2 users, load average: 0.01, 0.19, 0.18\r\n<\/strong><\/pre>\n

4\uff0efree\u547d\u4ee4<\/strong><\/p>\n

free\u7528\u4e8e\u663e\u793a\u5f53\u524d\u7cfb\u7edf\u4e2d\u5185\u5b58\u7684\u4f7f\u7528\u91cf\u4fe1\u606f\uff0c\u683c\u5f0f\u4e3a\u201cfree [-h]\u201d\u3002<\/p>\n

\u4e3a\u4e86\u4fdd\u8bc1Linux\u7cfb\u7edf\u4e0d\u4f1a\u56e0\u8d44\u6e90\u8017\u5c3d\u800c\u7a81\u7136\u5b95\u673a\uff0c\u8fd0\u7ef4\u4eba\u5458\u9700\u8981\u65f6\u523b\u5173\u6ce8\u5185\u5b58\u7684\u4f7f\u7528\u91cf\u3002\u5728\u4f7f\u7528free\u547d\u4ee4\u65f6\uff0c\u53ef\u4ee5\u7ed3\u5408\u4f7f\u7528-h\u53c2\u6570\u4ee5\u66f4\u4eba\u6027\u5316\u7684\u65b9\u5f0f\u8f93\u51fa\u5f53\u524d\u5185\u5b58\u7684\u5b9e\u65f6\u4f7f\u7528\u91cf\u4fe1\u606f\u3002\u88682-8\u6240\u793a\u4e3a\u5728\u5218\u9044\u8001\u5e08\u7684\u7535\u8111\u4e0a\u6267\u884cfree -h\u547d\u4ee4\u4e4b\u540e\u7684\u8f93\u51fa\u4fe1\u606f\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8f93\u51fa\u4fe1\u606f\u4e2d\u7684\u4e2d\u6587\u6ce8\u91ca\u662f\u4f5c\u8005\u81ea\u884c\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u5b9e\u9645\u8f93\u51fa\u65f6\u6ca1\u6709\u76f8\u5e94\u7684\u53c2\u6570\u89e3\u91ca\u3002<\/p>\n

[root@linuxprobe ~]# free -h<\/pre>\n

\u88682-8\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u6267\u884cfree -h\u547d\u4ee4\u540e\u7684\u8f93\u51fa\u4fe1\u606f<\/p>\n\n\n\n\n\n\n
<\/td>\n\u5185\u5b58\u603b\u91cf<\/td>\n\u5df2\u7528\u91cf<\/td>\n\u7a7a\u95f2\u91cf<\/td>\n\u5171\u4eab\u4f7f\u7528\u7684\u5185\u5b58\u91cf<\/td>\n\u7f13\u5b58\u7684\u5185\u5b58\u91cf<\/td>\n\u53ef\u7528\u91cf<\/td>\n<\/tr>\n
<\/td>\ntotal<\/td>\nused<\/td>\nfree<\/td>\nshared<\/td>\nbuff\/cache<\/td>\navailable<\/td>\n<\/tr>\n
Mem:<\/td>\n1.9Gi<\/td>\n1.5Gi<\/td>\n126Mi<\/td>\n16Mi<\/td>\n487Mi<\/td>\n437Mi<\/td>\n<\/tr>\n
Swap:<\/td>\n2.0Gi<\/td>\n56Mi<\/td>\n1.9Gi<\/td>\n<\/td>\n<\/td>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

5\uff0ewho\u547d\u4ee4<\/strong><\/p>\n

who\u7528\u4e8e\u67e5\u770b\u5f53\u524d\u767b\u5165\u4e3b\u673a\u7684\u7528\u6237\u7ec8\u7aef\u4fe1\u606f\uff0c\u683c\u5f0f\u4e3a\u201cwho [\u53c2\u6570]\u201d\u3002<\/p>\n

\u8fd9\u4e09\u4e2a\u7b80\u5355\u7684\u5b57\u6bcd\u53ef\u4ee5\u5feb\u901f\u663e\u793a\u51fa\u6240\u6709\u6b63\u5728\u767b\u5f55\u672c\u673a\u7684\u7528\u6237\u7684\u540d\u79f0\u4ee5\u53ca\u4ed6\u4eec\u6b63\u5728\u5f00\u542f\u7684\u7ec8\u7aef\u4fe1\u606f\u3002\u88682-9\u6240\u793a\u4e3a\u6267\u884cwho\u547d\u4ee4\u540e\u7684\u7ed3\u679c\u3002<\/p>\n

[root@linuxprobe ~]# who\r\n<\/pre>\n

\u88682-9\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u6267\u884cwho\u547d\u4ee4\u7684\u7ed3\u679c<\/p>\n\n\n\n\n\n
\u767b\u5f55\u7684\u7528\u6237\u540d<\/td>\n\u7ec8\u7aef\u8bbe\u5907<\/td>\n\u767b\u5f55\u5230\u7cfb\u7edf\u7684\u65f6\u95f4<\/td>\n<\/tr>\n
root<\/td>\nseat0<\/td>\n2025-05-18 02:31 (login screen)<\/td>\n<\/tr>\n
root<\/td>\ntty2<\/td>\n2025-05-18 02:31 (tty2)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

6\uff0elast\u547d\u4ee4<\/strong><\/p>\n

last\u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u6240\u6709\u7cfb\u7edf\u7684\u767b\u5f55\u8bb0\u5f55\uff0c\u683c\u5f0f\u4e3a\u201clast [\u53c2\u6570]\u201d\u3002<\/p>\n

\u4f7f\u7528last\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u672c\u673a\u7684\u767b\u5f55\u8bb0\u5f55\u3002\u4f46\u662f\uff0c\u7531\u4e8e\u8fd9\u4e9b\u4fe1\u606f\u90fd\u662f\u4ee5\u65e5\u5fd7\u6587\u4ef6\u7684\u5f62\u5f0f\u4fdd\u5b58\u5728\u7cfb\u7edf\u4e2d\uff0c\u56e0\u6b64\u9ed1\u5ba2\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u5bf9\u5185\u5bb9\u8fdb\u884c\u7be1\u6539\u3002\u5343\u4e07\u4e0d\u8981\u5355\u7eaf\u4ee5\u8be5\u547d\u4ee4\u7684\u8f93\u51fa\u4fe1\u606f\u800c\u5224\u65ad\u7cfb\u7edf\u6709\u65e0\u88ab\u6076\u610f\u5165\u4fb5\uff01<\/p>\n

[root@linuxprobe\u00a0~]#\u00a0last\r\nroot\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pts\/0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Mon\u00a0Aug\u00a0\u00a024\u00a017:52\u00a0\u00a0\u00a0still\u00a0\u00a0logged\u00a0in\r\nroot\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Mon\u00a0Aug\u00a0\u00a024\u00a017:52\u00a0\u00a0\u00a0still\u00a0\u00a0logged\u00a0in\r\n(unknown\u00a0\u00a0\u00a0:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Mon\u00a0Aug\u00a0\u00a024\u00a017:50\u00a0-\u00a017:52\u00a0\u00a0\u00a0(00:02)\r\nreboot\u00a0\u00a0\u00a0\u00a0\u00a0system\u00a0boot\u00a03.10.0-123.el7.x\u00a0Tue\u00a0Aug\u00a0\u00a025\u00a001:49\u00a0-\u00a018:17\u00a0\u00a0\u00a0(-7:-32)\r\nroot\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pts\/0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Mon\u00a0Aug\u00a0\u00a024\u00a015:40\u00a0-\u00a008:54\u00a0\u00a0\u00a0(7+17:14)\r\nroot\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pts\/0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Fri\u00a0Jul\u00a0\u00a010\u00a010:49\u00a0-\u00a015:37\u00a0\u00a0\u00a0(45+04:47)\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u767b\u5f55\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

7\uff0ehistory\u547d\u4ee4<\/strong><\/p>\n

history\u547d\u4ee4\u7528\u4e8e\u663e\u793a\u5386\u53f2\u6267\u884c\u8fc7\u7684\u547d\u4ee4\uff0c\u683c\u5f0f\u4e3a\u201chistory [-c]\u201d\u3002<\/p>\n

history\u547d\u4ee4\u5e94\u8be5\u662f\u4f5c\u8005\u6700\u559c\u6b22\u7684\u547d\u4ee4\u3002\u6267\u884chistory\u547d\u4ee4\u80fd\u663e\u793a\u51fa\u5f53\u524d\u7528\u6237\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e2d\u6267\u884c\u8fc7\u7684\u6700\u8fd11000\u6761\u547d\u4ee4\u8bb0\u5f55\u3002\u5982\u679c\u89c9\u5f971000\u4e0d\u591f\u7528\uff0c\u8fd8\u53ef\u4ee5\u81ea\u5b9a\u4e49\/etc\/profile\u6587\u4ef6\u4e2d\u7684HISTSIZE\u53d8\u91cf\u503c\u3002\u5728\u4f7f\u7528history\u547d\u4ee4\u65f6\uff0c\u5982\u679c\u4f7f\u7528-c\u53c2\u6570\u5219\u4f1a\u6e05\u7a7a\u6240\u6709\u7684\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u3002\u8fd8\u53ef\u4ee5\u4f7f\u7528\u201c!\u7f16\u7801\u6570\u5b57\u201d\u7684\u65b9\u5f0f\u6765\u91cd\u590d\u6267\u884c\u67d0\u4e00\u6b21\u7684\u547d\u4ee4\u3002\u603b\u4e4b\uff0chistory\u547d\u4ee4\u6709\u5f88\u591a\u6709\u8da3\u7684\u73a9\u6cd5\u7b49\u5f85\u60a8\u53bb\u5f00\u53d1\u3002<\/p>\n

[root@linuxprobe ~]# history\r\n1 tar xzvf VMwareTools-9.9.0-2304977.tar.gz\r\n2 cd vmware-tools-distrib\/\r\n3 ls\r\n4 .\/vmware-install.pl -d\r\n5 reboot\r\n6 df -h\r\n7 cd \/run\/media\/\r\n8 ls\r\n9 cd root\/\r\n10 ls\r\n11 cd VMware\\ Tools\/\r\n12 ls\r\n13 cp VMwareTools-9.9.0-2304977.tar.gz \/home\r\n14 cd \/home\r\n15 ls<\/strong>\r\n16 tar xzvf VMwareTools-9.9.0-2304977.tar.gz\r\n17 cd vmware-tools-distrib\/\r\n18 ls\r\n19 .\/vmware-install.pl -d\r\n20 reboot\r\n21 history\r\n[root@linuxprobe ~]# !15\r\nanaconda-ks.cfg\u00a0 Documents\u00a0 initial-setup-ks.cfg\u00a0 Pictures\u00a0 Templates\r\nDesktop\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Downloads\u00a0 Music\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Public\u00a0\u00a0\u00a0 Videos<\/pre>\n

\u5386\u53f2\u547d\u4ee4\u4f1a\u88ab\u4fdd\u5b58\u5230\u7528\u6237\u5bb6\u76ee\u5f55\u4e2d\u7684.bash_history\u6587\u4ef6\u4e2d\u3002Linux\u7cfb\u7edf\u4e2d\u4ee5\u70b9\uff08.\uff09\u5f00\u5934\u7684\u6587\u4ef6\u5747\u4ee3\u8868\u9690\u85cf\u6587\u4ef6\uff0c\u8fd9\u4e9b\u6587\u4ef6\u5927\u591a\u6570\u4e3a\u7cfb\u7edf\u670d\u52a1\u6587\u4ef6\uff0c\u53ef\u4ee5\u7528cat\u547d\u4ee4\u67e5\u770b\u5176\u6587\u4ef6\u5185\u5bb9\u3002<\/p>\n

[root@linuxprobe ~]# cat ~\/.bash_history\r\n<\/pre>\n

\u8981\u6e05\u7a7a\u5f53\u524d\u7528\u6237\u5728\u672c\u673a\u4e0a\u6267\u884c\u7684Linux\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4fe1\u606f\uff0c\u53ef\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n

[root@linuxprobe ~]# history -c\r\n<\/pre>\n

8\uff0esosreport\u547d\u4ee4<\/strong><\/p>\n

sosreport\u547d\u4ee4\u7528\u4e8e\u6536\u96c6\u7cfb\u7edf\u914d\u7f6e\u53ca\u67b6\u6784\u4fe1\u606f\u5e76\u8f93\u51fa\u8bca\u65ad\u6587\u6863\uff0c\u683c\u5f0f\u4e3asosreport\u3002<\/p>\n

\u5f53Linux\u7cfb\u7edf\u51fa\u73b0\u6545\u969c\u9700\u8981\u8054\u7cfb\u6280\u672f\u652f\u6301\u4eba\u5458\u65f6\uff0c\u5927\u591a\u6570\u65f6\u5019\u90fd\u8981\u5148\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u6765\u7b80\u5355\u6536\u96c6\u7cfb\u7edf\u7684\u8fd0\u884c\u72b6\u6001\u548c\u670d\u52a1\u914d\u7f6e\u4fe1\u606f\uff0c\u4ee5\u4fbf\u8ba9\u6280\u672f\u652f\u6301\u4eba\u5458\u80fd\u591f\u8fdc\u7a0b\u89e3\u51b3\u4e00\u4e9b\u5c0f\u95ee\u9898\uff0c\u4ea6\u6216\u8ba9\u4ed6\u4eec\u80fd\u63d0\u524d\u4e86\u89e3\u67d0\u4e9b\u590d\u6742\u95ee\u9898\u3002\u5728\u4e0b\u9762\u7684\u8f93\u51fa\u4fe1\u606f\u4e2d\uff0c\u52a0\u7c97\u7684\u90e8\u5206\u662f\u6536\u96c6\u597d\u7684\u8d44\u6599\u538b\u7f29\u6587\u4ef6\u4ee5\u53ca\u6821\u9a8c\u7801\uff0c\u5c06\u5176\u53d1\u9001\u7ed9\u6280\u672f\u652f\u6301\u4eba\u5458\u5373\u53ef\uff1a<\/p>\n

[root@linuxprobe ~]# sosreport\r\nsosreport (version 3.0)\r\nThis command will collect diagnostic and configuration information from\r\nthis Red Hat Enterprise Linux system and installed applications.\r\n\r\nAn archive containing the collected information will be generated in\r\n\/var\/tmp and may be provided to a Red Hat support representative.\r\nAny information provided to Red Hat will be treated in accordance with\r\nthe published support policies at:\r\n\r\nhttps:\/\/access.redhat.com\/support\/\r\n\r\nThe generated archive may contain data considered sensitive and its\r\ncontent should be reviewed by the originating organization before being\r\npassed to any third party.\r\n\r\nNo changes will be made to system configuration.\r\nPress ENTER to continue, or CTRL-C to quit. \u6b64\u5904\u6572\u51fb\u56de\u8f66\u6765\u786e\u8ba4\u6536\u96c6\u4fe1\u606f<\/strong>\r\n\r\nPlease enter your first initial and last name [lrxjmw.cn]:\u6b64\u5904\u6572\u51fb\u56de\u8f66\u6765\u786e\u8ba4\u4e3b\u673a<\/strong>\u7f16\u53f7<\/strong>\r\nPlease enter the case number that you are generating this report for:\u6b64\u5904\u6572\u51fb\u56de\u8f66\u6765\u786e\u8ba4\u4e3b\u673a<\/strong>\u7f16\u53f7<\/strong>\r\nRunning plugins. Please wait ...\r\nRunning 70\/70: yum...\r\nCreating compressed archive...\r\nYour sosreport has been generated and saved in:\r\n\r\n\/var\/tmp\/sosreport-lrxjmw.cn-20170905230631.tar.xz<\/strong>\r\nThe checksum is: 79436cdf791327040efde48c452c6322<\/strong>\r\nPlease send this file to your support representative.\r\n<\/pre>\n
2.5 \u5de5\u4f5c\u76ee\u5f55\u5207\u6362\u547d\u4ee4<\/strong><\/span><\/h5>\n

\u5de5\u4f5c\u76ee\u5f55\u6307\u7684\u662f\u7528\u6237\u5f53\u524d\u5728\u7cfb\u7edf\u4e2d\u6240\u5904\u7684\u4f4d\u7f6e\u3002\u7531\u4e8e\u5de5\u4f5c\u76ee\u5f55\u4f1a\u7275\u6d89\u7cfb\u7edf\u5b58\u50a8\u7ed3\u6784\u76f8\u5173\u7684\u77e5\u8bc6\uff0c\u56e0\u6b64\u7b2c6\u7ae0\u5c06\u8be6\u7ec6\u8bb2\u89e3\u8fd9\u90e8\u5206\u5185\u5bb9\u3002\u8bfb\u8005\u53ea\u9700\u7b80\u5355\u4e86\u89e3\u4e00\u4e0b\u8fd9\u91cc\u7684\u64cd\u4f5c\u5b9e\u9a8c\u5373\u53ef\uff0c\u5982\u679c\u4e0d\u80fd\u5b8c\u5168\u638c\u63e1\u4e5f\u6ca1\u6709\u5173\u7cfb\uff0c\u6bd5\u7adfLinux\u7cfb\u7edf\u7684\u77e5\u8bc6\u4f53\u7cfb\u592a\u8fc7\u5e9e\u5927\uff0c\u6bcf\u4e00\u4f4d\u521d\u5b66\u4eba\u5458\u90fd\u9700\u8981\u7ecf\u5386\u8fd9\u4e48\u4e00\u6bb5\u65f6\u671f\u3002<\/p>\n

1\uff0epwd\u547d\u4ee4<\/strong><\/p>\n

pwd\u547d\u4ee4\u7528\u4e8e\u663e\u793a\u7528\u6237\u5f53\u524d\u6240\u5904\u7684\u5de5\u4f5c\u76ee\u5f55\uff0c\u683c\u5f0f\u4e3a\u201cpwd [\u9009\u9879]\u201d\u3002<\/p>\n

[root@linuxprobe etc]# pwd\r\n\/etc\r\n<\/pre>\n

2\uff0ecd\u547d\u4ee4<\/strong><\/p>\n

cd\u547d\u4ee4\u7528\u4e8e\u5207\u6362\u5de5\u4f5c\u8def\u5f84\uff0c\u683c\u5f0f\u4e3a\u201ccd [\u76ee\u5f55\u540d\u79f0]\u201d\u3002<\/p>\n

\u8fd9\u4e2a\u547d\u4ee4\u5e94\u8be5\u662f\u6700\u5e38\u7528\u7684\u4e00\u4e2aLinux\u547d\u4ee4\u4e86\u3002\u53ef\u4ee5\u901a\u8fc7cd\u547d\u4ee4\u8fc5\u901f\u3001\u7075\u6d3b\u5730\u5207\u6362\u5230\u4e0d\u540c\u7684\u5de5\u4f5c\u76ee\u5f55\u3002\u9664\u4e86\u5e38\u89c1\u7684\u5207\u6362\u76ee\u5f55\u65b9\u5f0f\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u201ccd -\u201d\u547d\u4ee4\u8fd4\u56de\u5230\u4e0a\u4e00\u6b21\u6240\u5904\u7684\u76ee\u5f55\uff0c\u4f7f\u7528\u201ccd..\u201d\u547d\u4ee4\u8fdb\u5165\u4e0a\u7ea7\u76ee\u5f55\uff0c\u4ee5\u53ca\u4f7f\u7528\u201ccd ~\u201d\u547d\u4ee4\u5207\u6362\u5230\u5f53\u524d\u7528\u6237\u7684\u5bb6\u76ee\u5f55\uff0c\u4ea6\u6216\u4f7f\u7528\u201ccd ~username\u201d\u5207\u6362\u5230\u5176\u4ed6\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u201ccd \u8def\u5f84\u201d\u7684\u65b9\u5f0f\u5207\u6362\u8fdb\/etc\u76ee\u5f55\u4e2d\uff1a<\/p>\n

[root@linuxprobe ~]# cd \/etc\r\n<\/pre>\n

\u540c\u6837\u7684\u9053\u7406\uff0c\u53ef\u4f7f\u7528\u4e0b\u8ff0\u547d\u4ee4\u5207\u6362\u5230\/bin\u76ee\u5f55\u4e2d\uff1a<\/p>\n

[root@linuxprobe etc]# cd \/bin\r\n<\/pre>\n

\u6b64\u65f6\uff0c\u8981\u8fd4\u56de\u5230\u4e0a\u4e00\u6b21\u7684\u76ee\u5f55\uff08\u5373\/etc\u76ee\u5f55\uff09\uff0c\u53ef\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n

[root@linuxprobe bin]# cd -\r\n\/etc\r\n[root@linuxprobe\u00a0etc]#<\/pre>\n

\u8fd8\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u5feb\u901f\u5207\u6362\u5230\u7528\u6237\u7684\u5bb6\u76ee\u5f55\uff1a<\/p>\n

[root@linuxprobe etc]# cd ~\r\n[root@linuxprobe ~]#\r\n<\/pre>\n

3\uff0els\u547d\u4ee4<\/strong><\/p>\n

ls\u547d\u4ee4\u7528\u4e8e\u663e\u793a\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u4fe1\u606f\uff0c\u683c\u5f0f\u4e3a\u201cls [\u9009\u9879] [\u6587\u4ef6] \u201d\u3002<\/p>\n

\u6240\u5904\u7684\u5de5\u4f5c\u76ee\u5f55\u4e0d\u540c\uff0c\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u80af\u5b9a\u4e5f\u4e0d\u540c\u3002\u4f7f\u7528ls\u547d\u4ee4\u7684\u201c-a\u201d\u53c2\u6570\u770b\u5230\u5168\u90e8\u6587\u4ef6\uff08\u5305\u62ec\u9690\u85cf\u6587\u4ef6\uff09\uff0c\u4f7f\u7528\u201c-l\u201d\u53c2\u6570\u53ef\u4ee5\u67e5\u770b\u6587\u4ef6\u7684\u5c5e\u6027\u3001\u5927\u5c0f\u7b49\u8be6\u7ec6\u4fe1\u606f\u3002\u5c06\u8fd9\u4e24\u4e2a\u53c2\u6570\u6574\u5408\u4e4b\u540e\uff0c\u518d\u6267\u884cls\u547d\u4ee4\u5373\u53ef\u67e5\u770b\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u5e76\u8f93\u51fa\u8fd9\u4e9b\u6587\u4ef6\u7684\u5c5e\u6027\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# ls -al\r\ntotal 60\r\ndr-xr-x---. 14 root root 4096 May\u00a0 4 07:56 .\r\ndrwxr-xr-x. 17 root root 4096 May\u00a0 4 15:55 ..\r\n-rw-------.\u00a0 1 root root 1213 May\u00a0 4 15:44 anaconda-ks.cfg\r\n-rw-------.\u00a0 1 root root\u00a0 957 May\u00a0 4 07:54 .bash_history\r\n-rw-r--r--.\u00a0 1 root root\u00a0\u00a0 18 Dec 28\u00a0 2013 .bash_logout\r\n-rw-r--r--.\u00a0 1 root root\u00a0 176 Dec 28\u00a0 2013 .bash_profile\r\n-rw-r--r--.\u00a0 1 root root\u00a0 176 Dec 28\u00a0 2013 .bashrc\r\ndrwx------. 10 root root 4096 May\u00a0 4 07:56 .cache\r\ndrwx------. 15 root root 4096 May\u00a0 4 07:49 .config\r\n-rw-r--r--.\u00a0 1 root root\u00a0 100 Dec 28\u00a0 2013 .cshrc\r\ndrwx------.\u00a0 3 root root\u00a0\u00a0 24 May\u00a0 4 07:46 .dbus\r\ndrwxr-xr-x.\u00a0 2 root root\u00a0\u00a0\u00a0 6 May\u00a0 4 07:49 Desktop\r\ndrwxr-xr-x.\u00a0 2 root root\u00a0\u00a0\u00a0 6 May\u00a0 4 07:49 Documents\r\ndrwxr-xr-x.\u00a0 2 root root\u00a0\u00a0\u00a0 6 May\u00a0 4 07:49 Downloads\r\n-rw-------.\u00a0 1 root root\u00a0\u00a0 16 May\u00a0 4 07:49 .esd_auth\r\n-rw-------.\u00a0 1 root root\u00a0 628 May\u00a0 4 07:56 .ICEauthority\r\n-rw-r--r--.\u00a0 1 root root 1264 May\u00a0 4 07:48 initial-setup-ks.cfg\r\ndrwx------.\u00a0 3 root root\u00a0\u00a0 18 May\u00a0 4 07:49 .local\r\ndrwxr-xr-x.\u00a0 2 root root\u00a0\u00a0\u00a0 6 May\u00a0 4 07:49 Music\r\ndrwxr-xr-x.\u00a0 2 root root\u00a0\u00a0\u00a0 6 May\u00a0 4 07:49 Pictures\r\ndrwxr-xr-x.\u00a0 2 root root\u00a0\u00a0\u00a0 6 May\u00a0 4 07:49 Public\r\n-rw-r--r--.\u00a0 1 root root\u00a0 129 Dec 28\u00a0 2013 .tcshrc\r\ndrwxr-xr-x.\u00a0 2 root root\u00a0\u00a0\u00a0 6 May\u00a0 4 07:49 Templates\r\ndrwxr-xr-x.\u00a0 2 root root\u00a0\u00a0\u00a0 6 May\u00a0 4 07:49 Videos\r\n-rw-------.\u00a0 1 root root 1962 May\u00a0 4 07:54 .viminfo\r\n<\/pre>\n

\u5982\u679c\u60f3\u8981\u67e5\u770b\u76ee\u5f55\u5c5e\u6027\u4fe1\u606f\uff0c\u5219\u9700\u8981\u989d\u5916\u6dfb\u52a0\u4e00\u4e2a-d\u53c2\u6570\u3002\u4f8b\u5982\uff0c\u53ef\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u67e5\u770b\/etc\u76ee\u5f55\u7684\u6743\u9650\u4e0e\u5c5e\u6027\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# ls -ld \/etc\r\ndrwxr-xr-x. 132 root root 8192 Jul 10 10:48 \/etc\r\n<\/pre>\n
2.6\u00a0\u6587\u672c\u6587\u4ef6\u7f16\u8f91\u547d\u4ee4<\/strong><\/span><\/h5>\n

\u901a\u8fc7\u524d\u9762\u51e0\u4e2a\u5c0f\u8282\u7684\u5b66\u4e60\uff0c\u8bfb\u8005\u5e94\u8be5\u57fa\u672c\u638c\u63e1\u4e86\u5207\u6362\u5de5\u4f5c\u76ee\u5f55\u53ca\u5bf9\u6587\u4ef6\u7684\u7ba1\u7406\u65b9\u6cd5\u3002Linux\u7cfb\u7edf\u4e2d\u201c\u4e00\u5207\u90fd\u662f\u6587\u4ef6\u201d\uff0c\u800c\u5bf9\u670d\u52a1\u7a0b\u5e8f\u8fdb\u884c\u914d\u7f6e\u81ea\u7136\u4e5f\u5c31\u662f\u7f16\u8f91\u7a0b\u5e8f\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u5982\u679c\u4e0d\u80fd\u719f\u7ec3\u5730\u67e5\u9605\u7cfb\u7edf\u6216\u670d\u52a1\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u90a3\u4ee5\u540e\u5de5\u4f5c\u65f6\u53ef\u5c31\u771f\u7684\u8981\u5c34\u5c2c\u4e86\u3002\u672c\u8282\u5c06\u8bb2\u89e3\u51e0\u6761\u7528\u4e8e\u67e5\u770b\u6587\u672c\u6587\u4ef6\u5185\u5bb9\u7684\u547d\u4ee4\u3002\u81f3\u4e8e\u7f16\u8f91\u5668\u4f7f\u7528\u8d77\u6765\u6bd4\u8f83\u590d\u6742\uff0c\u56e0\u6b64\u5c06\u653e\u5230\u7b2c4\u7ae0\u4e0eShell\u811a\u672c\u5185\u5bb9\u4e00\u8d77\u8bb2\u89e3\u3002<\/p>\n

1\uff0ecat\u547d\u4ee4<\/strong><\/p>\n

cat\u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u7eaf\u6587\u672c\u6587\u4ef6\uff08\u5185\u5bb9\u8f83\u5c11\u7684\uff09\uff0c\u683c\u5f0f\u4e3a\u201ccat [\u9009\u9879] [\u6587\u4ef6]\u201d\u3002<\/p>\n

Linux\u7cfb\u7edf\u4e2d\u6709\u591a\u4e2a\u7528\u4e8e\u67e5\u770b\u6587\u672c\u5185\u5bb9\u7684\u547d\u4ee4\uff0c\u6bcf\u4e2a\u547d\u4ee4\u90fd\u6709\u81ea\u5df1\u7684\u7279\u70b9\uff0c\u6bd4\u5982\u8fd9\u4e2acat\u547d\u4ee4\u5c31\u662f\u7528\u4e8e\u67e5\u770b\u5185\u5bb9\u8f83\u5c11\u7684\u7eaf\u6587\u672c\u6587\u4ef6\u7684\u3002cat\u8fd9\u4e2a\u547d\u4ee4\u4e5f\u5f88\u597d\u8bb0\uff0c\u56e0\u4e3acat\u5728\u82f1\u8bed\u4e2d\u662f\u201c\u732b\u201d\u7684\u610f\u601d\uff0c\u5c0f\u732b\u54aa\u662f\u4e0d\u662f\u7ed9\u60a8\u4e00\u79cd\u5a07\u5c0f\u3001\u53ef\u7231\u7684\u611f\u89c9\u5462\uff1f<\/p>\n

\u5982\u679c\u5728\u67e5\u770b\u6587\u672c\u5185\u5bb9\u65f6\u8fd8\u60f3\u987a\u4fbf\u663e\u793a\u884c\u53f7\u7684\u8bdd\uff0c\u4e0d\u59a8\u5728cat\u547d\u4ee4\u540e\u9762\u8ffd\u52a0\u4e00\u4e2a-n\u53c2\u6570\uff1a<\/p>\n

[root@linuxprobe ~]# cat -n initial-setup-ks.cfg \r\n\u00a0\u00a0\u00a0\u00a0 1\u00a0\u00a0 \u00a0#version=RHEL7\r\n\u00a0\u00a0\u00a0\u00a0 2\u00a0\u00a0 \u00a0# X Window System configuration information\r\n\u00a0\u00a0\u00a0\u00a0 3\u00a0\u00a0 \u00a0xconfig\u00a0 --startxonboot\r\n\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0 5\u00a0\u00a0 \u00a0# License agreement\r\n\u00a0\u00a0\u00a0\u00a0 6\u00a0\u00a0 \u00a0eula --agreed\r\n\u00a0\u00a0\u00a0\u00a0 7\u00a0\u00a0 \u00a0# System authorization information\r\n\u00a0\u00a0\u00a0\u00a0 8\u00a0\u00a0 \u00a0auth --enableshadow --passalgo=sha512\r\n\u00a0\u00a0\u00a0\u00a0 9\u00a0\u00a0 \u00a0# Use CDROM installation media\r\n\u00a0\u00a0\u00a0 10\u00a0\u00a0 \u00a0cdrom\r\n\u00a0\u00a0\u00a0 11\u00a0\u00a0 \u00a0# Run the Setup Agent on first boot\r\n\u00a0\u00a0\u00a0 12\u00a0\u00a0 \u00a0firstboot --enable\r\n\u00a0\u00a0\u00a0 13\u00a0\u00a0 \u00a0# Keyboard layouts\r\n\u00a0\u00a0\u00a0 14\u00a0\u00a0 \u00a0keyboard --vckeymap=us --xlayouts='us'\r\n\u00a0\u00a0\u00a0 15\u00a0\u00a0 \u00a0# System language\r\n\u00a0\u00a0\u00a0 16\u00a0\u00a0 \u00a0lang en_US.UTF-8\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

cat\u547d\u4ee4\u8be6\u89e3\uff1ahttps:\/\/www.linuxcool.com\/cat<\/a><\/p>\n

\n

2\uff0emore\u547d\u4ee4<\/strong><\/p>\n

more\u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u7eaf\u6587\u672c\u6587\u4ef6\uff08\u5185\u5bb9\u8f83\u591a\u7684\uff09\uff0c\u683c\u5f0f\u4e3a\u201cmore [\u9009\u9879]\u6587\u4ef6\u201d\u3002<\/p>\n

\u5982\u679c\u9700\u8981\u9605\u8bfb\u957f\u7bc7\u5c0f\u8bf4\u6216\u8005\u975e\u5e38\u957f\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u90a3\u4e48\u201c\u5c0f\u732b\u54aa\u201d\u53ef\u5c31\u771f\u7684\u4e0d\u9002\u5408\u4e86\u3002\u56e0\u4e3a\u4e00\u65e6\u4f7f\u7528cat\u547d\u4ee4\u9605\u8bfb\u957f\u7bc7\u7684\u6587\u672c\u5185\u5bb9\uff0c\u4fe1\u606f\u5c31\u4f1a\u5728\u5c4f\u5e55\u4e0a\u5feb\u901f\u7ffb\u6eda\uff0c\u5bfc\u81f4\u81ea\u5df1\u8fd8\u6ca1\u6709\u6765\u5f97\u53ca\u770b\u5230\uff0c\u5185\u5bb9\u5c31\u5df2\u7ecf\u7ffb\u7bc7\u4e86\u3002\u56e0\u6b64\u5bf9\u4e8e\u957f\u7bc7\u7684\u6587\u672c\u5185\u5bb9\uff0c\u63a8\u8350\u4f7f\u7528more\u547d\u4ee4\u6765\u67e5\u770b\u3002more\u547d\u4ee4\u4f1a\u5728\u6700\u4e0b\u9762\u4f7f\u7528\u767e\u5206\u6bd4\u7684\u5f62\u5f0f\u6765\u63d0\u793a\u60a8\u5df2\u7ecf\u9605\u8bfb\u4e86\u591a\u5c11\u5185\u5bb9\u3002\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u7a7a\u683c\u952e\u6216\u56de\u8f66\u952e\u5411\u4e0b\u7ffb\u9875\uff1a<\/p>\n

[root@linuxprobe ~]# more initial-setup-ks.cfg \r\n#version=RHEL7\r\n# X Window System configuration information\r\nxconfig\u00a0 --startxonboot\r\n\r\n# License agreement\r\neula --agreed\r\n# System authorization information\r\nauth --enableshadow --passalgo=sha512\r\n# Use CDROM installation media\r\ncdrom\r\n# Run the Setup Agent on first boot\r\nfirstboot --enable\r\n# Keyboard layouts\r\nkeyboard --vckeymap=us --xlayouts='us'\r\n# System language\r\nlang en_US.UTF-8\r\n\r\nignoredisk --only-use=sda\r\n# Network information\r\nnetwork\u00a0 --bootproto=dhcp --device=eno16777728 --onboot=off --ipv6=auto\r\nnetwork\u00a0 --bootproto=dhcp --hostname=lrxjmw.cn\r\n--More--(43%)<\/span><\/pre>\n

3\uff0ehead\u547d\u4ee4<\/strong><\/p>\n

head\u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u7eaf\u6587\u672c\u6587\u6863\u7684\u524dN\u884c\uff0c\u683c\u5f0f\u4e3a\u201chead [\u9009\u9879] [\u6587\u4ef6]\u201d\u3002<\/p>\n

\u5728\u9605\u8bfb\u6587\u672c\u5185\u5bb9\u65f6\uff0c\u8c01\u4e5f\u96be\u4ee5\u4fdd\u8bc1\u4f1a\u6309\u7167\u4ece\u5934\u5230\u5c3e\u7684\u987a\u5e8f\u5f80\u4e0b\u770b\u5b8c\u6574\u4e2a\u6587\u4ef6\u3002\u5982\u679c\u53ea\u60f3\u67e5\u770b\u6587\u672c\u4e2d\u524d20\u884c\u7684\u5185\u5bb9\uff0c\u8be5\u600e\u4e48\u529e\u5462\uff1fhead\u547d\u4ee4\u53ef\u4ee5\u6d3e\u4e0a\u7528\u573a\u4e86\uff1a<\/p>\n

[root@linuxprobe ~]# head -n 20\u00a0 initial-setup-ks.cfg \r\n#version=RHEL7\r\n# X Window System configuration information\r\nxconfig\u00a0 --startxonboot\r\n\r\n# License agreement\r\neula --agreed\r\n# System authorization information\r\nauth --enableshadow --passalgo=sha512\r\n# Use CDROM installation media\r\ncdrom\r\n# Run the Setup Agent on first boot\r\nfirstboot --enable\r\n# Keyboard layouts\r\nkeyboard --vckeymap=us --xlayouts='us'\r\n# System language\r\nlang en_US.UTF-8\r\n\r\nignoredisk --only-use=sda\r\n# Network information\r\nnetwork\u00a0 --bootproto=dhcp --device=eno16777728 --onboot=off --ipv6=auto\r\n[root@linuxprobe ~]#<\/pre>\n

4\uff0etail\u547d\u4ee4<\/strong><\/p>\n

tail\u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u7eaf\u6587\u672c\u6587\u6863\u7684\u540eN\u884c\u6216\u6301\u7eed\u5237\u65b0\u5185\u5bb9\uff0c\u683c\u5f0f\u4e3a\u201ctail [\u9009\u9879] [\u6587\u4ef6]\u201d\u3002<\/p>\n

\u6211\u4eec\u53ef\u80fd\u8fd8\u4f1a\u9047\u5230\u53e6\u5916\u4e00\u79cd\u60c5\u51b5\uff0c\u6bd4\u5982\u9700\u8981\u67e5\u770b\u6587\u672c\u5185\u5bb9\u7684\u6700\u540e20\u884c\uff0c\u8fd9\u65f6\u5c31\u9700\u8981\u7528\u5230tail\u547d\u4ee4\u4e86\u3002tail\u547d\u4ee4\u7684\u64cd\u4f5c\u65b9\u6cd5\u4e0ehead\u547d\u4ee4\u975e\u5e38\u76f8\u4f3c\uff0c\u53ea\u9700\u8981\u6267\u884c\u201ctail -n 20 \u6587\u4ef6\u540d\u201d\u547d\u4ee4\u5c31\u53ef\u4ee5\u8fbe\u5230\u8fd9\u6837\u7684\u6548\u679c\u3002tail\u547d\u4ee4\u6700\u5f3a\u608d\u7684\u529f\u80fd\u662f\u53ef\u4ee5\u6301\u7eed\u5237\u65b0\u4e00\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u5f53\u60f3\u8981\u5b9e\u65f6\u67e5\u770b\u6700\u65b0\u65e5\u5fd7\u6587\u4ef6\u65f6\uff0c\u8fd9\u7279\u522b\u6709\u7528\uff0c\u6b64\u65f6\u7684\u547d\u4ee4\u683c\u5f0f\u4e3a\u201ctail -f \u6587\u4ef6\u540d\u201d\uff1a<\/p>\n<\/div>\n

[root@linuxprobe\u00a0~]# tail -f \/var\/log\/messages\r\nMay\u00a0 4 07:56:38 localhost gnome-session: Window manager warning: Log level 16: STACK_OP_ADD: window 0x1e00001 already in stack\r\nMay\u00a0 4 07:56:38 localhost gnome-session: Window manager warning: Log level 16: STACK_OP_ADD: window 0x1e00001 already in stack\r\nMay\u00a0 4 07:56:38 localhost vmusr[12982]: [ warning] [Gtk] gtk_disable_setlocale() must be called before gtk_init()\r\nMay\u00a0 4 07:56:50 localhost systemd-logind: Removed session c1.\r\nAug\u00a0 1 01:05:31 localhost systemd: Time has been changed\r\nAug\u00a0 1 01:05:31 localhost systemd: Started LSB: Bring up\/down networking.\r\nAug\u00a0 1 01:08:56 localhost dbus-daemon: dbus[1124]: [system] Activating service name='com.redhat.SubscriptionManager' (using servicehelper)\r\nAug\u00a0 1 01:08:56 localhost dbus[1124]: [system] Activating service name='com.redhat.SubscriptionManager' (using servicehelper)\r\nAug\u00a0 1 01:08:57 localhost dbus-daemon: dbus[1124]: [system] Successfully activated service 'com.redhat.SubscriptionManager'\r\nAug\u00a0 1 01:08:57 localhost dbus[1124]: [system] Successfully activated service 'com.redhat.SubscriptionManager'\r\n<\/pre>\n

5\uff0etr\u547d\u4ee4<\/strong><\/p>\n

tr\u547d\u4ee4\u7528\u4e8e\u66ff\u6362\u6587\u672c\u6587\u4ef6\u4e2d\u7684\u5b57\u7b26\uff0c\u683c\u5f0f\u4e3a\u201ctr [\u539f\u59cb\u5b57\u7b26] [\u76ee\u6807\u5b57\u7b26]\u201d\u3002<\/p>\n

\u5728\u5f88\u591a\u65f6\u5019\uff0c\u6211\u4eec\u60f3\u8981\u5feb\u901f\u5730\u66ff\u6362\u6587\u672c\u4e2d\u7684\u4e00\u4e9b\u8bcd\u6c47\uff0c\u53c8\u6216\u8005\u628a\u6574\u4e2a\u6587\u672c\u5185\u5bb9\u90fd\u8fdb\u884c\u66ff\u6362\uff0c\u5982\u679c\u8fdb\u884c\u624b\u5de5\u66ff\u6362\uff0c\u96be\u514d\u5de5\u4f5c\u91cf\u592a\u5927\uff0c\u5c24\u5176\u662f\u9700\u8981\u5904\u7406\u5927\u6279\u91cf\u7684\u5185\u5bb9\u65f6\uff0c\u8fdb\u884c\u624b\u5de5\u66ff\u6362\u66f4\u662f\u4e0d\u73b0\u5b9e\u3002\u8fd9\u65f6\uff0c\u5c31\u53ef\u4ee5\u5148\u4f7f\u7528cat\u547d\u4ee4\u8bfb\u53d6\u5f85\u5904\u7406\u7684\u6587\u672c\uff0c\u7136\u540e\u901a\u8fc7\u7ba1\u9053\u7b26\uff08\u8be6\u89c1\u7b2c3\u7ae0\uff09\u628a\u8fd9\u4e9b\u6587\u672c\u5185\u5bb9\u4f20\u9012\u7ed9tr\u547d\u4ee4\u8fdb\u884c\u66ff\u6362\u64cd\u4f5c\u5373\u53ef\u3002\u4f8b\u5982\uff0c\u628a\u67d0\u4e2a\u6587\u672c\u5185\u5bb9\u4e2d\u7684\u82f1\u6587\u5168\u90e8\u66ff\u6362\u4e3a\u5927\u5199\uff1a<\/p>\n

[root@linuxprobe ~]# cat anaconda-ks.cfg | tr [a-z] [A-Z]\r\n#VERSION=RHEL7\r\n# SYSTEM AUTHORIZATION INFORMATION\r\nAUTH --ENABLESHADOW --PASSALGO=SHA512\r\n\r\n# USE CDROM INSTALLATION MEDIA\r\nCDROM\r\n# RUN THE SETUP AGENT ON FIRST BOOT\r\nFIRSTBOOT --ENABLE\r\nIGNOREDISK --ONLY-USE=SDA\r\n# KEYBOARD LAYOUTS\r\nKEYBOARD --VCKEYMAP=US --XLAYOUTS='US'\r\n# SYSTEM LANGUAGE\r\nLANG EN_US.UTF-8\r\n\r\n# NETWORK INFORMATION\r\nNETWORK --BOOTPROTO=DHCP --DEVICE=ENO16777728 --ONBOOT=OFF --IPV6=AUTO\r\nNETWORK --HOSTNAME=LOCALHOST.LOCALDOMAIN\r\n# ROOT PASSWORD\r\nROOTPW --ISCRYPTED $6$PDJJF42G8C6PL069$II.PX\/YFAQPO0ENW2PA7MOMKJLYOAE2ZJMZ2UZJ7BH3UO4OWTR1.WK\/HXZ3XIGMZGJPCS\/MGPYSSOI8HPCT8B\/\r\n# SYSTEM TIMEZONE\r\nTIMEZONE AMERICA\/NEW_YORK --ISUTC\r\nUSER --NAME=LINUXPROBE --PASSWORD=$6$A9V3INSTNBWEIR7D$JEGFYWBCDOOOKJ9SODECCDO.ZLF4OSH2AZ2SS2R05B6LZ2A0V2K.RJWSBALL2FEKQVGF640OA\/TOK6J.7GUTO\/ --ISCRYPTED --GECOS=\"LINUXPROBE\"\r\n# X WINDOW SYSTEM CONFIGURATION INFORMATION\r\nXCONFIG --STARTXONBOOT\r\n# SYSTEM BOOTLOADER CONFIGURATION\r\nBOOTLOADER --LOCATION=MBR --BOOT-DRIVE=SDA\r\nAUTOPART --TYPE=LVM\r\n# PARTITION CLEARING INFORMATION\r\nCLEARPART --NONE --INITLABEL \r\n\r\n%PACKAGES\r\n@BASE\r\n@CORE\r\n@DESKTOP-DEBUGGING\r\n@DIAL-UP\r\n@FONTS\r\n@GNOME-DESKTOP\r\n@GUEST-AGENTS\r\n@GUEST-DESKTOP-AGENTS\r\n@INPUT-METHODS\r\n@INTERNET-BROWSER\r\n@MULTIMEDIA\r\n@PRINT-CLIENT\r\n@X11\r\n\r\n%END\r\n<\/pre>\n

6\uff0ewc\u547d\u4ee4<\/strong><\/p>\n

wc\u547d\u4ee4\u7528\u4e8e\u7edf\u8ba1\u6307\u5b9a\u6587\u672c\u7684\u884c\u6570\u3001\u5b57\u6570\u3001\u5b57\u8282\u6570\uff0c\u683c\u5f0f\u4e3a\u201cwc [\u53c2\u6570] \u6587\u672c\u201d\u3002<\/p>\n

\u6bcf\u6b21\u6211\u5728\u8bfe\u5802\u4e0a\u8bb2\u5230\u8fd9\u4e2a\u547d\u4ee4\u65f6\uff0c\u603b\u6709\u540c\u5b66\u4f1a\u8054\u60f3\u5230\u4e00\u79cd\u516c\u5171\u8bbe\u65bd\uff0c\u5176\u5b9e\u8fd9\u4e24\u8005\u6beb\u65e0\u5173\u8054\u3002Linux\u7cfb\u7edf\u4e2d\u7684wc\u547d\u4ee4\u7528\u4e8e\u7edf\u8ba1\u6587\u672c\u7684\u884c\u6570\u3001\u5b57\u6570\u3001\u5b57\u8282\u6570\u7b49\u3002\u5982\u679c\u4e3a\u4e86\u65b9\u4fbf\u81ea\u5df1\u8bb0\u4f4f\u8fd9\u4e2a\u547d\u4ee4\u7684\u4f5c\u7528\uff0c\u4e5f\u53ef\u4ee5\u8054\u60f3\u5230\u4e0a\u5395\u6240\u65f6\u597d\u65e0\u804a\uff0c\u65e0\u804a\u5230\u6570\u5b8c\u4e86\u624b\u4e2d\u7684\u5982\u5395\u8bfb\u7269\u4e0a\u6709\u591a\u5c11\u884c\u5b57\u3002wc\u7684\u53c2\u6570\u4ee5\u53ca\u76f8\u5e94\u7684\u4f5c\u7528\u5982\u88682-10\u6240\u793a\u3002<\/p>\n

\u88682-10\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 wc\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-l<\/td>\n\u53ea\u663e\u793a\u884c\u6570<\/td>\n<\/tr>\n
-w<\/td>\n\u53ea\u663e\u793a\u5355\u8bcd\u6570<\/td>\n<\/tr>\n
-c<\/td>\n\u53ea\u663e\u793a\u5b57\u8282\u6570<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\uff0cpasswd\u662f\u7528\u4e8e\u4fdd\u5b58\u7cfb\u7edf\u8d26\u6237\u4fe1\u606f\u7684\u6587\u4ef6\uff0c\u8981\u7edf\u8ba1\u5f53\u524d\u7cfb\u7edf\u4e2d\u6709\u591a\u5c11\u4e2a\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u8fdb\u884c\u67e5\u8be2\uff0c\u662f\u4e0d\u662f\u5f88\u795e\u5947\uff1a<\/p>\n

[root@linuxprobe ~]# wc -l \/etc\/passwd\r\n38 \/etc\/passwd\r\n<\/pre>\n

7\uff0estat\u547d\u4ee4<\/strong><\/p>\n

stat\u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u6587\u4ef6\u7684\u5177\u4f53\u5b58\u50a8\u4fe1\u606f\u548c\u65f6\u95f4\u7b49\u4fe1\u606f\uff0c\u683c\u5f0f\u4e3a\u201cstat \u6587\u4ef6\u540d\u79f0\u201d\u3002<\/p>\n

stat\u547d\u4ee4\u53ef\u4ee5\u7528\u4e8e\u67e5\u770b\u6587\u4ef6\u7684\u5b58\u50a8\u4fe1\u606f\u548c\u65f6\u95f4\u7b49\u4fe1\u606f\uff0c\u547d\u4ee4stat anaconda-ks.cfg\u4f1a\u663e\u793a\u51fa\u6587\u4ef6\u7684\u4e09\u79cd\u65f6\u95f4\u72b6\u6001\uff08\u5df2\u52a0\u7c97\uff09\uff1aAccess\u3001Modify\u3001Change\u3002\u8fd9\u4e09\u79cd\u65f6\u95f4\u7684\u533a\u522b\u5c06\u5728\u4e0b\u9762\u7684touch\u547d\u4ee4\u4e2d\u8be6\u7ec6\u8be6\u89e3\uff1a<\/p>\n

[root@linuxprobe\u00a0~]# stat anaconda-ks.cfg\r\nFile: \u2018anaconda-ks.cfg\u2019\r\nSize: 1213 Blocks: 8 IO Block: 4096 regular file\r\nDevice: fd00h\/64768d Inode: 68912908 Links: 1\r\nAccess: (0600\/-rw-------) Uid: ( 0\/ root) Gid: ( 0\/ root)\r\nContext: system_u:object_r:admin_home_t:s0\r\nAccess<\/strong>: 2017-07-14 01:46:18.721255659 -0400\r\nModify<\/strong>: 2017-05-04 15:44:36.916027026 -0400\r\nChange<\/strong>: 2017-05-04 15:44:36.916027026 -0400\r\nBirth: -\r\n<\/pre>\n

8\uff0ecut\u547d\u4ee4<\/strong><\/p>\n

cut\u547d\u4ee4\u7528\u4e8e\u6309\u201c\u5217\u201d\u63d0\u53d6\u6587\u672c\u5b57\u7b26\uff0c\u683c\u5f0f\u4e3a\u201ccut [\u53c2\u6570] \u6587\u672c\u201d\u3002<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u5982\u4f55\u51c6\u786e\u5730\u63d0\u53d6\u51fa\u6700\u60f3\u8981\u7684\u6570\u636e\uff0c\u8fd9\u4e5f\u662f\u6211\u4eec\u5e94\u8be5\u91cd\u70b9\u5b66\u4e60\u7684\u5185\u5bb9\u3002\u4e00\u822c\u800c\u8a00\uff0c\u6309\u57fa\u4e8e\u201c\u884c\u201d\u7684\u65b9\u5f0f\u6765\u63d0\u53d6\u6570\u636e\u662f\u6bd4\u8f83\u7b80\u5355\u7684\uff0c\u53ea\u9700\u8981\u8bbe\u7f6e\u597d\u8981\u641c\u7d22\u7684\u5173\u952e\u8bcd\u5373\u53ef\u3002\u4f46\u662f\u5982\u679c\u6309\u5217\u641c\u7d22\uff0c\u4e0d\u4ec5\u8981\u4f7f\u7528-f\u53c2\u6570\u6765\u8bbe\u7f6e\u9700\u8981\u770b\u7684\u5217\u6570\uff0c\u8fd8\u9700\u8981\u4f7f\u7528-d\u53c2\u6570\u6765\u8bbe\u7f6e\u95f4\u9694\u7b26\u53f7\u3002passwd\u5728\u4fdd\u5b58\u7528\u6237\u6570\u636e\u4fe1\u606f\u65f6\uff0c\u7528\u6237\u4fe1\u606f\u7684\u6bcf\u4e00\u9879\u503c\u4e4b\u95f4\u662f\u91c7\u7528\u5192\u53f7\u6765\u95f4\u9694\u7684\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u4f7f\u7528\u4e0b\u8ff0\u547d\u4ee4\u5c1d\u8bd5\u63d0\u53d6\u51fapasswd\u6587\u4ef6\u4e2d\u7684\u7528\u6237\u540d\u4fe1\u606f\uff0c\u5373\u63d0\u53d6\u4ee5\u5192\u53f7\uff08\uff1a\uff09\u4e3a\u95f4\u9694\u7b26\u53f7\u7684\u7b2c\u4e00\u5217\u5185\u5bb9\uff1a<\/p>\n

[root@linuxprobe ~]# head -n 2 \/etc\/passwd\r\nroot<\/strong>:x:0:0:root:\/root:\/bin\/bash\r\nbin<\/strong>:x:1:1:bin:\/bin:\/sbin\/nologin\r\n[root@linuxprobe ~]# cut -d: -f1 \/etc\/passwd\r\nroot\r\nbin\r\ndaemon\r\nadm\r\nlp\r\nsync\r\nshutdown\r\nhalt\r\nmail\r\noperator\r\ngames\r\nftp\r\nnobody\r\ndbus\r\npolkitd\r\nunbound\r\ncolord\r\nusbmuxd\r\navahi\r\navahi-autoipd\r\nlibstoragemgmt\r\nsaslauth\r\nqemu\r\nrpc\r\nrpcuser\r\nnfsnobody\r\nrtkit\r\nradvd\r\nntp\r\nchrony\r\nabrt\r\npulse\r\ngdm\r\ngnome-initial-setup\r\npostfix\r\nsshd\r\ntcpdump\r\nlinuxprobe\r\n<\/pre>\n

9\uff0ediff\u547d\u4ee4<\/strong><\/p>\n

diff\u547d\u4ee4\u7528\u4e8e\u6bd4\u8f83\u591a\u4e2a\u6587\u672c\u6587\u4ef6\u7684\u5dee\u5f02\uff0c\u683c\u5f0f\u4e3a\u201cdiff [\u53c2\u6570] \u6587\u4ef6\u201d\u3002<\/p>\n

\u5728\u4f7f\u7528diff\u547d\u4ee4\u65f6\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u4f7f\u7528--brief\u53c2\u6570\u6765\u786e\u8ba4\u4e24\u4e2a\u6587\u4ef6\u662f\u5426\u4e0d\u540c\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528-c\u53c2\u6570\u6765\u8be6\u7ec6\u6bd4\u8f83\u51fa\u591a\u4e2a\u6587\u4ef6\u7684\u5dee\u5f02\u4e4b\u5904\uff0c\u8fd9\u7edd\u5bf9\u662f\u5224\u65ad\u6587\u4ef6\u662f\u5426\u88ab\u7be1\u6539\u7684\u6709\u529b\u795e\u5668\u3002\u4f8b\u5982\uff0c\u5148\u4f7f\u7528cat\u547d\u4ee4\u5206\u522b\u67e5\u770bdiff_A.txt\u548cdiff_B.txt\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u7136\u540e\u8fdb\u884c\u6bd4\u8f83\uff1a<\/p>\n

[root@linuxprobe ~]# cat diff_A.txt\r\nWelcome to lrxjmw.cn\r\nRed Hat certified\r\nFree Linux Lessons\r\nProfessional guidance\r\nLinux Course\r\n[root@linuxprobe ~]# cat diff_B.txt\r\nWelcome tooo lrxjmw.cn\r\n\r\nRed Hat certified\r\nFree Linux LeSSonS\r\n\/\/\/\/\/\/\/\/.....\/\/\/\/\/\/\/\/\r\nProfessional guidance\r\nLinux Course<\/pre>\n

\u63a5\u4e0b\u6765\u4f7f\u7528diff --brief\u547d\u4ee4\u663e\u793a\u6bd4\u8f83\u540e\u7684\u7ed3\u679c\uff0c\u5224\u65ad\u6587\u4ef6\u662f\u5426\u76f8\u540c\uff1a<\/p>\n

[root@linuxprobe ~]# diff --brief diff_A.txt diff_B.txt\r\nFiles diff_A.txt and diff_B.txt differ\r\n<\/pre>\n

\u6700\u540e\u4f7f\u7528\u5e26\u6709-c\u53c2\u6570\u7684diff\u547d\u4ee4\u6765\u63cf\u8ff0\u6587\u4ef6\u5185\u5bb9\u5177\u4f53\u7684\u4e0d\u540c\uff1a<\/p>\n

[root@linuxprobe ~]# diff -c diff_A.txt diff_B.txt\r\n*** diff_A.txt 2017-08-30 18:07:45.230864626 +0800\r\n--- diff_B.txt 2017-08-30 18:08:52.203860389 +0800\r\n***************\r\n*** 1,5 ****\r\n! Welcome to lrxjmw.cn\r\nRed Hat certified\r\n! Free Linux Lessons\r\nProfessional guidance\r\nLinux Course\r\n--- 1,7 ----\r\n! Welcome tooo lrxjmw.cn\r\n!\r\nRed Hat certified\r\n! Free Linux LeSSonS\r\n! \/\/\/\/\/\/\/\/.....\/\/\/\/\/\/\/\/\r\nProfessional guidance\r\nLinux Course\r\n<\/pre>\n
2.7\u00a0\u6587\u4ef6\u76ee\u5f55\u7ba1\u7406\u547d\u4ee4<\/strong><\/span><\/h5>\n

\u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u4eec\u5b66\u4e60Linux\u547d\u4ee4\u5c31\u50cf\u662f\u5728\u592f\u5b9e\u5730\u57fa\uff0c\u867d\u7136\u8868\u9762\u4e0a\u6682\u65f6\u8fd8\u770b\u4e0d\u5230\u6210\u679c\uff0c\u4f46\u5176\u5b9e\u5927\u5bb6\u7684\u5185\u529f\u5df2\u7ecf\u76f8\u5f53\u96c4\u539a\u4e86\u3002\u5728Linux\u7cfb\u7edf\u7684\u65e5\u5e38\u8fd0\u7ef4\u5de5\u4f5c\u4e2d\uff0c\u8fd8\u9700\u8981\u638c\u63e1\u5bf9\u6587\u4ef6\u7684\u521b\u5efa\u3001\u4fee\u6539\u3001\u590d\u5236\u3001\u526a\u5207\u3001\u66f4\u540d\u4e0e\u5220\u9664\u7b49\u64cd\u4f5c\u3002<\/p>\n

1\uff0etouch\u547d\u4ee4<\/strong><\/p>\n

touch\u547d\u4ee4\u7528\u4e8e\u521b\u5efa\u7a7a\u767d\u6587\u4ef6\u6216\u8bbe\u7f6e\u6587\u4ef6\u7684\u65f6\u95f4\uff0c\u683c\u5f0f\u4e3a\u201ctouch [\u9009\u9879] [\u6587\u4ef6]\u201d\u3002<\/p>\n

\u5728\u521b\u5efa\u7a7a\u767d\u7684\u6587\u672c\u6587\u4ef6\u65b9\u9762\uff0c\u8fd9\u4e2atouch\u547d\u4ee4\u76f8\u5f53\u7b80\u6377\uff0c\u7b80\u6377\u5230\u6ca1\u6709\u5fc5\u8981\u94fa\u5f00\u53bb\u8bb2\u3002\u6bd4\u5982\uff0ctouch linuxprobe\u547d\u4ee4\u53ef\u4ee5\u521b\u5efa\u51fa\u4e00\u4e2a\u540d\u4e3alinuxprobe\u7684\u7a7a\u767d\u6587\u672c\u6587\u4ef6\u3002\u5bf9touch\u547d\u4ee4\u6765\u8bb2\uff0c\u6709\u96be\u5ea6\u7684\u64cd\u4f5c\u4e3b\u8981\u662f\u4f53\u73b0\u5728\u8bbe\u7f6e\u6587\u4ef6\u5185\u5bb9\u7684\u4fee\u6539\u65f6\u95f4\uff08mtime\uff09\u3001\u6587\u4ef6\u6743\u9650\u6216\u5c5e\u6027\u7684\u66f4\u6539\u65f6\u95f4\uff08ctime\uff09\u4e0e\u6587\u4ef6\u7684\u8bfb\u53d6\u65f6\u95f4\uff08atime\uff09\u4e0a\u9762\u3002touch\u547d\u4ee4\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528\u5982\u88682-11\u6240\u793a\u3002<\/p>\n

\u88682-11\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 touch\u547d\u4ee4\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528<\/p>\n

\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-a<\/td>\n\u4ec5\u4fee\u6539\u201c\u8bfb\u53d6\u65f6\u95f4\u201d\uff08atime\uff09<\/td>\n<\/tr>\n
-m<\/td>\n\u4ec5\u4fee\u6539\u201c\u4fee\u6539\u65f6\u95f4\u201d\uff08mtime\uff09<\/td>\n<\/tr>\n
-d<\/td>\n\u540c\u65f6\u4fee\u6539atime\u4e0emtime<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/div>\n

\n

\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5148\u4f7f\u7528ls\u547d\u4ee4\u67e5\u770b\u4e00\u4e2a\u6587\u4ef6\u7684\u4fee\u6539\u65f6\u95f4\uff0c\u7136\u540e\u4fee\u6539\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6700\u540e\u518d\u901a\u8fc7touch\u547d\u4ee4\u628a\u4fee\u6539\u540e\u7684\u6587\u4ef6\u65f6\u95f4\u8bbe\u7f6e\u6210\u4fee\u6539\u4e4b\u524d\u7684\u65f6\u95f4\uff08\u5f88\u591a\u9ed1\u5ba2\u5c31\u662f\u8fd9\u6837\u505a\u7684\u5462\uff09\uff1a<\/p>\n<\/div>\n

[root@linuxprobe ~]# ls -l anaconda-ks.cfg \r\n-rw-------. 1 root root 1213 May\u00a0 4 15:44<\/strong> anaconda-ks.cfg\r\n[root@linuxprobe\u00a0~]# echo \"Visit the lrxjmw.cn to learn linux skills\" >> anaconda-ks.cfg\r\n[root@linuxprobe\u00a0~]# ls -l anaconda-ks.cfg\r\n-rw-------. 1 root root 1260 Aug\u00a0 2 01:26<\/strong> anaconda-ks.cfg\r\n[root@linuxprobe\u00a0~]# touch -d \"2017-05-04 15:44\" anaconda-ks.cfg \r\n[root@linuxprobe\u00a0~]# ls -l anaconda-ks.cfg \r\n-rw-------. 1 root root 1260 May\u00a0 4 15:44<\/strong> anaconda-ks.cfg<\/pre>\n

2\uff0emkdir\u547d\u4ee4<\/strong><\/p>\n

mkdir\u547d\u4ee4\u7528\u4e8e\u521b\u5efa\u7a7a\u767d\u7684\u76ee\u5f55\uff0c\u683c\u5f0f\u4e3a\u201cmkdir [\u9009\u9879] \u76ee\u5f55\u201d\u3002<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6587\u4ef6\u5939\u662f\u6700\u5e38\u89c1\u7684\u6587\u4ef6\u7c7b\u578b\u4e4b\u4e00\u3002\u9664\u4e86\u80fd\u521b\u5efa\u5355\u4e2a\u7a7a\u767d\u76ee\u5f55\u5916\uff0cmkdir\u547d\u4ee4\u8fd8\u53ef\u4ee5\u7ed3\u5408-p\u53c2\u6570\u6765\u9012\u5f52\u521b\u5efa\u51fa\u5177\u6709\u5d4c\u5957\u53e0\u5c42\u5173\u7cfb\u7684\u6587\u4ef6\u76ee\u5f55\u3002<\/p>\n

[root@linuxprobe ~]# mkdir linuxprobe\r\n[root@linuxprobe ~]# cd linuxprobe\r\n[root@linuxprobe linuxprobe]# mkdir -p a\/b\/c\/d\/e\r\n[root@linuxprobe linuxprobe]# cd a\r\n[root@linuxprobe a]# cd b\r\n[root@linuxprobe b]#\r\n<\/pre>\n

3\uff0ecp\u547d\u4ee4<\/strong><\/p>\n

cp\u547d\u4ee4\u7528\u4e8e\u590d\u5236\u6587\u4ef6\u6216\u76ee\u5f55\uff0c\u683c\u5f0f\u4e3a\u201ccp [\u9009\u9879] \u6e90\u6587\u4ef6 \u76ee\u6807\u6587\u4ef6\u201d\u3002\u5927\u5bb6\u5bf9\u6587\u4ef6\u590d\u5236\u64cd\u4f5c\u5e94\u8be5\u4e0d\u964c\u751f\uff0c\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u590d\u5236\u64cd\u4f5c\u5177\u4f53\u5206\u4e3a3\u79cd\u60c5\u51b5\uff1a<\/p>\n

\u5982\u679c\u76ee\u6807\u6587\u4ef6\u662f\u76ee\u5f55\uff0c\u5219\u4f1a\u628a\u6e90\u6587\u4ef6\u590d\u5236\u5230\u8be5\u76ee\u5f55\u4e2d\uff1b<\/p>\n

\u5982\u679c\u76ee\u6807\u6587\u4ef6\u4e5f\u662f\u666e\u901a\u6587\u4ef6\uff0c\u5219\u4f1a\u8be2\u95ee\u662f\u5426\u8981\u8986\u76d6\u5b83\uff1b<\/p>\n

\u5982\u679c\u76ee\u6807\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5219\u6267\u884c\u6b63\u5e38\u7684\u590d\u5236\u64cd\u4f5c\u3002<\/p><\/blockquote>\n

cp\u547d\u4ee4\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528\u5982\u88682-12\u6240\u793a\u3002<\/p>\n

\u88682-12\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cp\u547d\u4ee4\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-p<\/td>\n\u4fdd\u7559\u539f\u59cb\u6587\u4ef6\u7684\u5c5e\u6027<\/td>\n<\/tr>\n
-d<\/td>\n\u82e5\u5bf9\u8c61\u4e3a\u201c\u94fe\u63a5\u6587\u4ef6\u201d\uff0c\u5219\u4fdd\u7559\u8be5\u201c\u94fe\u63a5\u6587\u4ef6\u201d\u7684\u5c5e\u6027<\/td>\n<\/tr>\n
-r<\/td>\n\u9012\u5f52\u6301\u7eed\u590d\u5236\uff08\u7528\u4e8e\u76ee\u5f55\uff09<\/td>\n<\/tr>\n
-i<\/td>\n\u82e5\u76ee\u6807\u6587\u4ef6\u5b58\u5728\u5219\u8be2\u95ee\u662f\u5426\u8986\u76d6<\/td>\n<\/tr>\n
-a<\/td>\n\u76f8\u5f53\u4e8e-pdr\uff08p\u3001d\u3001r\u4e3a\u4e0a\u8ff0\u53c2\u6570\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u63a5\u4e0b\u6765\uff0c\u4f7f\u7528touch\u521b\u5efa\u4e00\u4e2a\u540d\u4e3ainstall.log\u7684\u666e\u901a\u7a7a\u767d\u6587\u4ef6\uff0c\u7136\u540e\u5c06\u5176\u590d\u5236\u4e3a\u4e00\u4efd\u540d\u4e3ax.log\u7684\u5907\u4efd\u6587\u4ef6\uff0c\u6700\u540e\u518d\u4f7f\u7528ls\u547d\u4ee4\u67e5\u770b\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\uff1a<\/p>\n

[root@linuxprobe ~]# touch install.log\r\n[root@linuxprobe ~]# cp install.log x.log\r\n[root@linuxprobe ~]# ls\r\ninstall.log x.log\r\n<\/pre>\n

4\uff0emv\u547d\u4ee4<\/strong><\/p>\n

mv\u547d\u4ee4\u7528\u4e8e\u526a\u5207\u6587\u4ef6\u6216\u5c06\u6587\u4ef6\u91cd\u547d\u540d\uff0c\u683c\u5f0f\u4e3a\u201cmv [\u9009\u9879] \u6e90\u6587\u4ef6 [\u76ee\u6807\u8def\u5f84|\u76ee\u6807\u6587\u4ef6\u540d]\u201d\u3002<\/p>\n

\u526a\u5207\u64cd\u4f5c\u4e0d\u540c\u4e8e\u590d\u5236\u64cd\u4f5c\uff0c\u56e0\u4e3a\u5b83\u4f1a\u9ed8\u8ba4\u628a\u6e90\u6587\u4ef6\u5220\u9664\u6389\uff0c\u53ea\u4fdd\u7559\u526a\u5207\u540e\u7684\u6587\u4ef6\u3002\u5982\u679c\u5728\u540c\u4e00\u4e2a\u76ee\u5f55\u4e2d\u5bf9\u4e00\u4e2a\u6587\u4ef6\u8fdb\u884c\u526a\u5207\u64cd\u4f5c\uff0c\u5176\u5b9e\u4e5f\u5c31\u662f\u5bf9\u5176\u8fdb\u884c\u91cd\u547d\u540d\uff1a<\/p>\n

[root@linuxprobe ~]# mv x.log linux.log\r\n[root@linuxprobe\u00a0~]#\u00a0ls\r\ninstall.log\u00a0linux.log<\/pre>\n

5\uff0erm\u547d\u4ee4<\/strong><\/p>\n

rm\u547d\u4ee4\u7528\u4e8e\u5220\u9664\u6587\u4ef6\u6216\u76ee\u5f55\uff0c\u683c\u5f0f\u4e3a\u201crm [\u9009\u9879] \u6587\u4ef6\u201d\u3002<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\u5220\u9664\u6587\u4ef6\u65f6\uff0c\u7cfb\u7edf\u4f1a\u9ed8\u8ba4\u5411\u60a8\u8be2\u95ee\u662f\u5426\u8981\u6267\u884c\u5220\u9664\u64cd\u4f5c\uff0c\u5982\u679c\u4e0d\u60f3\u603b\u662f\u770b\u5230\u8fd9\u79cd\u53cd\u590d\u7684\u786e\u8ba4\u4fe1\u606f\uff0c\u53ef\u5728rm\u547d\u4ee4\u540e\u8ddf\u4e0a-f\u53c2\u6570\u6765\u5f3a\u5236\u5220\u9664\u3002\u53e6\u5916\uff0c\u60f3\u8981\u5220\u9664\u4e00\u4e2a\u76ee\u5f55\uff0c\u9700\u8981\u5728rm\u547d\u4ee4\u540e\u9762\u52a0\u4e00\u4e2a-r\u53c2\u6570\u624d\u53ef\u4ee5\uff0c\u5426\u5219\u5220\u9664\u4e0d\u6389\u3002\u6211\u4eec\u6765\u5c1d\u8bd5\u5220\u9664\u524d\u9762\u521b\u5efa\u7684install.log\u548clinux.log\u6587\u4ef6\uff1a<\/p>\n

[root@linuxprobe ~]# rm install.log\r\nrm: remove regular empty file \u2018install.log\u2019? y\r\n[root@linuxprobe ~]# rm -f linux.log\r\n[root@linuxprobe ~]# ls\r\n[root@linuxprobe ~]#<\/pre>\n

6\uff0edd\u547d\u4ee4<\/strong><\/p>\n

dd\u547d\u4ee4\u7528\u4e8e\u6309\u7167\u6307\u5b9a\u5927\u5c0f\u548c\u4e2a\u6570\u7684\u6570\u636e\u5757\u6765\u590d\u5236\u6587\u4ef6\u6216\u8f6c\u6362\u6587\u4ef6\uff0c\u683c\u5f0f\u4e3a\u201cdd [\u53c2\u6570]\u201d\u3002<\/p>\n

dd\u547d\u4ee4\u662f\u4e00\u4e2a\u6bd4\u8f83\u91cd\u8981\u800c\u4e14\u6bd4\u8f83\u6709\u7279\u8272\u7684\u4e00\u4e2a\u547d\u4ee4\uff0c\u5b83\u80fd\u591f\u8ba9\u7528\u6237\u6309\u7167\u6307\u5b9a\u5927\u5c0f\u548c\u4e2a\u6570\u7684\u6570\u636e\u5757\u6765\u590d\u5236\u6587\u4ef6\u7684\u5185\u5bb9\u3002\u5f53\u7136\u5982\u679c\u613f\u610f\u7684\u8bdd\uff0c\u8fd8\u53ef\u4ee5\u5728\u590d\u5236\u8fc7\u7a0b\u4e2d\u8f6c\u6362\u5176\u4e2d\u7684\u6570\u636e\u3002Linux\u7cfb\u7edf\u4e2d\u6709\u4e00\u4e2a\u540d\u4e3a\/dev\/zero\u7684\u8bbe\u5907\u6587\u4ef6\uff0c\u6bcf\u6b21\u5728\u8bfe\u5802\u4e0a\u89e3\u91ca\u5b83\u65f6\u90fd\u5145\u6ee1\u54f2\u5b66\u7406\u8bba\u7684\u8272\u5f69\u3002\u56e0\u4e3a\u8fd9\u4e2a\u6587\u4ef6\u4e0d\u4f1a\u5360\u7528\u7cfb\u7edf\u5b58\u50a8\u7a7a\u95f4\uff0c\u4f46\u5374\u53ef\u4ee5\u63d0\u4f9b\u65e0\u7a77\u65e0\u5c3d\u7684\u6570\u636e\uff0c\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528\u5b83\u4f5c\u4e3add\u547d\u4ee4\u7684\u8f93\u5165\u6587\u4ef6\uff0c\u6765\u751f\u6210\u4e00\u4e2a\u6307\u5b9a\u5927\u5c0f\u7684\u6587\u4ef6\u3002dd\u547d\u4ee4\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528\u5982\u88682-13\u6240\u793a\u3002<\/p>\n

\u88682-13\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 dd\u547d\u4ee4\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
if<\/td>\n\u8f93\u5165\u7684\u6587\u4ef6\u540d\u79f0<\/td>\n<\/tr>\n
of<\/td>\n\u8f93\u51fa\u7684\u6587\u4ef6\u540d\u79f0<\/td>\n<\/tr>\n
bs<\/td>\n\u8bbe\u7f6e\u6bcf\u4e2a\u201c\u5757\u201d\u7684\u5927\u5c0f<\/td>\n<\/tr>\n
count<\/td>\n\u8bbe\u7f6e\u8981\u590d\u5236\u201c\u5757\u201d\u7684\u4e2a\u6570<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u4f8b\u5982\u6211\u4eec\u53ef\u4ee5\u7528dd\u547d\u4ee4\u4ece\/dev\/zero\u8bbe\u5907\u6587\u4ef6\u4e2d\u53d6\u51fa\u4e00\u4e2a\u5927\u5c0f\u4e3a560MB\u7684\u6570\u636e\u5757\uff0c\u7136\u540e\u4fdd\u5b58\u6210\u540d\u4e3a560_file\u7684\u6587\u4ef6\u3002\u5728\u7406\u89e3\u4e86\u8fd9\u4e2a\u547d\u4ee4\u540e\uff0c\u4ee5\u540e\u5c31\u80fd\u968f\u610f\u521b\u5efa\u4efb\u610f\u5927\u5c0f\u7684\u6587\u4ef6\u4e86\uff1a<\/p>\n

[root@linuxprobe ~]# dd if=\/dev\/zero of=560_file count=1 bs=560M\r\n1+0 records in\r\n1+0 records out\r\n587202560 bytes (587 MB) copied, 27.1755 s, 21.6 MB\/s\r\n<\/pre>\n

dd\u547d\u4ee4\u7684\u529f\u80fd\u4e5f\u7edd\u4e0d\u4ec5\u9650\u4e8e\u590d\u5236\u6587\u4ef6\u8fd9\u4e48\u7b80\u5355\u3002\u5982\u679c\u60a8\u60f3\u628a\u5149\u9a71\u8bbe\u5907\u4e2d\u7684\u5149\u76d8\u5236\u4f5c\u6210iso\u683c\u5f0f\u7684\u955c\u50cf\u6587\u4ef6\uff0c\u5728Windows\u7cfb\u7edf\u4e2d\u9700\u8981\u501f\u52a9\u4e8e\u7b2c\u4e09\u65b9\u8f6f\u4ef6\u624d\u80fd\u505a\u5230\uff0c\u4f46\u5728Linux\u7cfb\u7edf\u4e2d\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528dd\u547d\u4ee4\u6765\u538b\u5236\u51fa\u5149\u76d8\u955c\u50cf\u6587\u4ef6\uff0c\u5c06\u5b83\u53d8\u6210\u4e00\u4e2a\u53ef\u7acb\u5373\u4f7f\u7528\u7684iso\u955c\u50cf\uff1a<\/p>\n

[root@linuxprobe ~]# dd if=\/dev\/cdrom of=RHEL-server-7.0-x86_64-lrxjmw.cn.iso\r\n7311360+0 records in\r\n7311360+0 records out\r\n3743416320 bytes (3.7 GB) copied, 370.758 s, 10.1 MB\/s\r\n<\/pre>\n

\u8003\u8651\u5230\u6709\u4e9b\u8bfb\u8005\u4f1a\u7ea0\u7ed3bs\u5757\u5927\u5c0f\u4e0ecount\u5757\u4e2a\u6570\u7684\u5173\u7cfb\uff0c\u4e0b\u9762\u4e3e\u4e00\u4e2a\u5403\u8d27\u7684\u4f8b\u5b50\u8fdb\u884c\u89e3\u91ca\u3002\u5047\u8bbe\u5c0f\u660e\u7684\u996d\u91cf\uff08\u5373\u9700\u6c42\uff09\u662f\u4e00\u4e2a\u56fa\u5b9a\u7684\u503c\uff0c\u7528\u6765\u76db\u996d\u7684\u52fa\u5b50\u7684\u5927\u5c0f\u5373bs\u5757\u5927\u5c0f\uff0c\u800c\u7528\u52fa\u5b50\u76db\u996d\u7684\u6b21\u6570\u5373count\u5757\u4e2a\u6570\u3002\u5c0f\u660e\u8981\u60f3\u5403\u9971\uff08\u6ee1\u8db3\u9700\u6c42\uff09\uff0c\u5219\u9700\u8981\u5728\u52fa\u5b50\u5927\u5c0f\uff08bs\u5757\u5927\u5c0f\uff09\u4e0e\u7528\u52fa\u5b50\u76db\u996d\u7684\u6b21\u6570\uff08count\u5757\u4e2a\u6570\uff09\u4e4b\u95f4\u8fdb\u884c\u5e73\u8861\u3002\u52fa\u5b50\u8d8a\u5927\uff0c\u7528\u52fa\u5b50\u76db\u996d\u7684\u6b21\u6570\u5c31\u8d8a\u5c11\u3002\u7531\u4e0a\u53ef\u89c1\uff0cbs\u4e0ecount\u90fd\u662f\u7528\u6765\u6307\u5b9a\u5bb9\u91cf\u7684\u5927\u5c0f\uff0c\u53ea\u8981\u80fd\u6ee1\u8db3\u9700\u6c42\uff0c\u53ef\u968f\u610f\u7ec4\u5408\u642d\u914d\u65b9\u5f0f\u3002<\/p>\n

7\uff0efile\u547d\u4ee4<\/strong><\/p>\n

file\u547d\u4ee4\u7528\u4e8e\u67e5\u770b\u6587\u4ef6\u7684\u7c7b\u578b\uff0c\u683c\u5f0f\u4e3a\u201cfile \u6587\u4ef6\u540d\u201d\u3002<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u7531\u4e8e\u6587\u672c\u3001\u76ee\u5f55\u3001\u8bbe\u5907\u7b49\u6240\u6709\u8fd9\u4e9b\u4e00\u5207\u90fd\u7edf\u79f0\u4e3a\u6587\u4ef6\uff0c\u800c\u6211\u4eec\u53c8\u4e0d\u80fd\u5355\u51ed\u540e\u7f00\u5c31\u77e5\u9053\u5177\u4f53\u7684\u6587\u4ef6\u7c7b\u578b\uff0c\u8fd9\u65f6\u5c31\u9700\u8981\u4f7f\u7528file\u547d\u4ee4\u6765\u67e5\u770b\u6587\u4ef6\u7c7b\u578b\u4e86\u3002<\/p>\n

[root@linuxprobe ~]# file anaconda-ks.cfg \r\nanaconda-ks.cfg: ASCII text\r\n[root@linuxprobe ~]# file \/dev\/sda\r\n\/dev\/sda: block special<\/pre>\n

\u51fa\u73b0\u95ee\u9898?\u5927\u80c6\u63d0\u95ee!<\/strong><\/span><\/p>\n

\u56e0\u8bfb\u8005\u4eec\u786c\u4ef6\u4e0d\u540c\u6216\u64cd\u4f5c\u9519\u8bef\u90fd\u53ef\u80fd\u5bfc\u81f4\u5b9e\u9a8c\u914d\u7f6e\u51fa\u9519\uff0c\u8bf7\u8010\u5fc3\u518d\u4ed4\u7ec6\u770b\u770b\u64cd\u4f5c\u6b65\u9aa4\u5427\uff0c\u4e0d\u8981\u6c14\u9981~<\/p>\n

Linux\u6280\u672f\u4ea4\u6d41\u8bf7\u52a0A\u7fa4\uff1a560843(\u6ee1<\/span><\/strong>)\uff0cB\u7fa4\uff1a340829(\u63a8\u8350<\/span><\/strong>)\uff0cC\u7fa4\uff1a463590\uff08\u63a8\u8350<\/span><\/strong>\uff09\uff0c\u70b9\u6b64\u67e5\u770b\u5168\u56fd\u7fa4<\/a>\u3002<\/p>\n

*\u672c\u7fa4\u7279\u8272\uff1a\u901a\u8fc7\u53e3\u4ee4\u9a8c\u8bc1\u786e\u4fdd\u6bcf\u4e00\u4e2a\u7fa4\u5458\u90fd\u662f\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7684\u8bfb\u8005\uff0c\u7b54\u7591\u66f4\u6709\u9488\u5bf9\u6027\uff0c\u4e0d\u5b9a\u671f\u514d\u8d39\u9886\u53d6\u5b9a\u5236\u793c\u54c1\u3002<\/p><\/blockquote>\n

\n
2.8 \u6253\u5305\u538b\u7f29\u4e0e\u641c\u7d22\u547d\u4ee4<\/strong><\/span><\/h5>\n

\u5728\u7f51\u7edc\u4e0a\uff0c\u4eba\u4eec\u8d8a\u6765\u8d8a\u503e\u5411\u4e8e\u4f20\u8f93\u538b\u7f29\u683c\u5f0f\u7684\u6587\u4ef6\uff0c\u539f\u56e0\u662f\u538b\u7f29\u6587\u4ef6\u4f53\u79ef\u5c0f\uff0c\u5728\u7f51\u901f\u76f8\u540c\u7684\u60c5\u51b5\u4e0b\uff0c\u4f20\u8f93\u65f6\u95f4\u77ed\u3002\u4e0b\u9762\u5c06\u5b66\u4e60\u5982\u4f55\u5728Linux\u7cfb\u7edf\u4e2d\u5bf9\u6587\u4ef6\u8fdb\u884c\u6253\u5305\u538b\u7f29\u4e0e\u89e3\u538b\uff0c\u4ee5\u53ca\u8ba9\u7528\u6237\u57fa\u4e8e\u5173\u952e\u8bcd\u5728\u6587\u672c\u6587\u4ef6\u4e2d\u641c\u7d22\u76f8\u5339\u914d\u7684\u4fe1\u606f\u3001\u5728\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u4e2d\u57fa\u4e8e\u6307\u5b9a\u7684\u540d\u79f0\u6216\u5c5e\u6027\u641c\u7d22\u7279\u5b9a\u6587\u4ef6\u3002\u672c\u8282\u867d\u7136\u53ea\u67093\u6761\u547d\u4ee4\uff0c\u4f46\u662f\u5176\u529f\u80fd\u90fd\u6bd4\u8f83\u590d\u6742\u800c\u4e14\u53c2\u6570\u5f88\u591a\uff0c\u56e0\u6b64\u653e\u5230\u4e86\u672c\u7ae0\u6700\u540e\u8bb2\u89e3\u3002<\/p>\n

1\uff0etar\u547d\u4ee4<\/strong><\/p>\n

tar\u547d\u4ee4\u7528\u4e8e\u5bf9\u6587\u4ef6\u8fdb\u884c\u6253\u5305\u538b\u7f29\u6216\u89e3\u538b\uff0c\u683c\u5f0f\u4e3a\u201ctar [\u9009\u9879] [\u6587\u4ef6]\u201d\u3002<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u5e38\u89c1\u7684\u6587\u4ef6\u683c\u5f0f\u6bd4\u8f83\u591a\uff0c\u5176\u4e2d\u4e3b\u8981\u4f7f\u7528\u7684\u662f.tar\u6216.tar.gz\u6216.tar.bz2\u683c\u5f0f\uff0c\u6211\u4eec\u4e0d\u7528\u62c5\u5fc3\u683c\u5f0f\u592a\u591a\u800c\u8bb0\u4e0d\u4f4f\uff0c\u5176\u5b9e\u8fd9\u4e9b\u683c\u5f0f\u5927\u90e8\u5206\u90fd\u662f\u7531tar\u547d\u4ee4\u6765\u751f\u6210\u7684\u3002\u5218\u9044\u8001\u5e08\u5c06\u8bb2\u89e3\u6700\u91cd\u8981\u7684\u51e0\u4e2a\u53c2\u6570\uff0c\u4ee5\u65b9\u4fbf\u5927\u5bb6\u7406\u89e3\u3002tar\u547d\u4ee4\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528\u5982\u88682-14\u6240\u793a\u3002<\/p>\n

\u88682-14\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tar\u547d\u4ee4\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-c<\/td>\n\u521b\u5efa\u538b\u7f29\u6587\u4ef6<\/td>\n<\/tr>\n
-x<\/td>\n\u89e3\u5f00\u538b\u7f29\u6587\u4ef6<\/td>\n<\/tr>\n
-t<\/td>\n\u67e5\u770b\u538b\u7f29\u5305\u5185\u6709\u54ea\u4e9b\u6587\u4ef6<\/td>\n<\/tr>\n
-z<\/td>\n\u7528Gzip\u538b\u7f29\u6216\u89e3\u538b<\/td>\n<\/tr>\n
-j<\/td>\n\u7528bzip2\u538b\u7f29\u6216\u89e3\u538b<\/td>\n<\/tr>\n
-v<\/td>\n\u663e\u793a\u538b\u7f29\u6216\u89e3\u538b\u7684\u8fc7\u7a0b<\/td>\n<\/tr>\n
-f<\/td>\n\u76ee\u6807\u6587\u4ef6\u540d<\/td>\n<\/tr>\n
-p<\/td>\n\u4fdd\u7559\u539f\u59cb\u7684\u6743\u9650\u4e0e\u5c5e\u6027<\/td>\n<\/tr>\n
-P<\/td>\n\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\u6765\u538b\u7f29<\/td>\n<\/tr>\n
-C<\/td>\n\u6307\u5b9a\u89e3\u538b\u5230\u7684\u76ee\u5f55<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u9996\u5148\uff0c-c\u53c2\u6570\u7528\u4e8e\u521b\u5efa\u538b\u7f29\u6587\u4ef6\uff0c-x\u53c2\u6570\u7528\u4e8e\u89e3\u538b\u6587\u4ef6\uff0c\u56e0\u6b64\u8fd9\u4e24\u4e2a\u53c2\u6570\u4e0d\u80fd\u540c\u65f6\u4f7f\u7528\u3002\u5176\u6b21\uff0c-z\u53c2\u6570\u6307\u5b9a\u4f7f\u7528Gzip\u683c\u5f0f\u6765\u538b\u7f29\u6216\u89e3\u538b\u6587\u4ef6\uff0c-j\u53c2\u6570\u6307\u5b9a\u4f7f\u7528bzip2\u683c\u5f0f\u6765\u538b\u7f29\u6216\u89e3\u538b\u6587\u4ef6\u3002\u7528\u6237\u4f7f\u7528\u65f6\u5219\u662f\u6839\u636e\u6587\u4ef6\u7684\u540e\u7f00\u6765\u51b3\u5b9a\u5e94\u4f7f\u7528\u4f55\u79cd\u683c\u5f0f\u53c2\u6570\u8fdb\u884c\u89e3\u538b\u3002\u5728\u6267\u884c\u67d0\u4e9b\u538b\u7f29\u6216\u89e3\u538b\u64cd\u4f5c\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u82b1\u8d39\u6570\u4e2a\u5c0f\u65f6\uff0c\u5982\u679c\u5c4f\u5e55\u4e00\u76f4\u6ca1\u6709\u8f93\u51fa\uff0c\u60a8\u4e00\u65b9\u9762\u4e0d\u597d\u5224\u65ad\u6253\u5305\u7684\u8fdb\u5ea6\u60c5\u51b5\uff0c\u53e6\u4e00\u65b9\u9762\u4e5f\u4f1a\u6000\u7591\u7535\u8111\u6b7b\u673a\u4e86\uff0c\u56e0\u6b64\u975e\u5e38\u63a8\u8350\u4f7f\u7528-v\u53c2\u6570\u5411\u7528\u6237\u4e0d\u65ad\u663e\u793a\u538b\u7f29\u6216\u89e3\u538b\u7684\u8fc7\u7a0b\u3002-C\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u8981\u89e3\u538b\u5230\u54ea\u4e2a\u6307\u5b9a\u7684\u76ee\u5f55\u3002-f\u53c2\u6570\u7279\u522b\u91cd\u8981\uff0c\u5b83\u5fc5\u987b\u653e\u5230\u53c2\u6570\u7684\u6700\u540e\u4e00\u4f4d\uff0c\u4ee3\u8868\u8981\u538b\u7f29\u6216\u89e3\u538b\u7684\u8f6f\u4ef6\u5305\u540d\u79f0\u3002\u5218\u9044\u8001\u5e08\u4e00\u822c\u4f7f\u7528\u201ctar -czvf \u538b\u7f29\u5305\u540d\u79f0.tar.gz \u8981\u6253\u5305\u7684\u76ee\u5f55\u201d\u547d\u4ee4\u628a\u6307\u5b9a\u7684\u6587\u4ef6\u8fdb\u884c\u6253\u5305\u538b\u7f29\uff1b\u76f8\u5e94\u7684\u89e3\u538b\u547d\u4ee4\u4e3a\u201ctar -xzvf \u538b\u7f29\u5305\u540d\u79f0.tar.gz\u201d\u3002\u4e0b\u9762\u6211\u4eec\u6765\u9010\u4e2a\u6f14\u793a\u4e0b\u6253\u5305\u538b\u7f29\u4e0e\u89e3\u538b\u7684\u64cd\u4f5c\u3002\u5148\u4f7f\u7528tar\u547d\u4ee4\u628a\/etc\u76ee\u5f55\u901a\u8fc7gzip\u683c\u5f0f\u8fdb\u884c\u6253\u5305\u538b\u7f29\uff0c\u5e76\u628a\u6587\u4ef6\u547d\u540d\u4e3aetc.tar.gz\uff1a<\/p>\n

[root@linuxprobe ~]# tar czvf etc.tar.gz \/etc\r\ntar: Removing leading `\/' from member names\r\n\/etc\/\r\n\/etc\/fstab\r\n\/etc\/crypttab\r\n\/etc\/mtab\r\n\/etc\/fonts\/\r\n\/etc\/fonts\/conf.d\/\r\n\/etc\/fonts\/conf.d\/65-0-madan.conf\r\n\/etc\/fonts\/conf.d\/59-liberation-sans.conf\r\n\/etc\/fonts\/conf.d\/90-ttf-arphic-uming-embolden.conf\r\n\/etc\/fonts\/conf.d\/59-liberation-mono.conf\r\n\/etc\/fonts\/conf.d\/66-sil-nuosu.conf\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u538b\u7f29\u8fc7\u7a0b\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u63a5\u4e0b\u6765\u5c06\u6253\u5305\u540e\u7684\u538b\u7f29\u5305\u6587\u4ef6\u6307\u5b9a\u89e3\u538b\u5230\/root\/etc\u76ee\u5f55\u4e2d\uff08\u5148\u4f7f\u7528mkdir\u547d\u4ee4\u6765\u521b\u5efa\/root\/etc\u76ee\u5f55\uff09\uff1a<\/p>\n

[root@linuxprobe ~]# mkdir \/root\/etc\r\n[root@linuxprobe ~]# tar xzvf etc.tar.gz -C \/root\/etc\r\netc\/\r\netc\/fstab\r\netc\/crypttab\r\netc\/mtab\r\netc\/fonts\/\r\netc\/fonts\/conf.d\/\r\netc\/fonts\/conf.d\/65-0-madan.conf\r\netc\/fonts\/conf.d\/59-liberation-sans.conf\r\netc\/fonts\/conf.d\/90-ttf-arphic-uming-embolden.conf\r\netc\/fonts\/conf.d\/59-liberation-mono.conf\r\netc\/fonts\/conf.d\/66-sil-nuosu.conf\r\netc\/fonts\/conf.d\/65-1-vlgothic-gothic.conf\r\netc\/fonts\/conf.d\/65-0-lohit-bengali.conf\r\netc\/fonts\/conf.d\/20-unhint-small-dejavu-sans.conf\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u89e3\u538b\u8fc7\u7a0b\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

2\uff0egrep\u547d\u4ee4<\/strong><\/p>\n

grep\u547d\u4ee4\u7528\u4e8e\u5728\u6587\u672c\u4e2d\u6267\u884c\u5173\u952e\u8bcd\u641c\u7d22\uff0c\u5e76\u663e\u793a\u5339\u914d\u7684\u7ed3\u679c\uff0c\u683c\u5f0f\u4e3a\u201cgrep [\u9009\u9879] [\u6587\u4ef6]\u201d\u3002grep\u547d\u4ee4\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528\u5982\u88682-15\u6240\u793a\u3002<\/p>\n

\u88682-15\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 grep\u547d\u4ee4\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-b<\/td>\n\u5c06\u53ef\u6267\u884c\u6587\u4ef6(binary)\u5f53\u4f5c\u6587\u672c\u6587\u4ef6\uff08text\uff09\u6765\u641c\u7d22<\/td>\n<\/tr>\n
-c<\/td>\n\u4ec5\u663e\u793a\u627e\u5230\u7684\u884c\u6570<\/td>\n<\/tr>\n
-i<\/td>\n\u5ffd\u7565\u5927\u5c0f\u5199<\/td>\n<\/tr>\n
-n<\/td>\n\u663e\u793a\u884c\u53f7<\/td>\n<\/tr>\n
-v<\/td>\n\u53cd\u5411\u9009\u62e9\u2014\u2014\u4ec5\u5217\u51fa\u6ca1\u6709\u201c\u5173\u952e\u8bcd\u201d\u7684\u884c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n<\/div>\n

grep\u547d\u4ee4\u662f\u7528\u9014\u6700\u5e7f\u6cdb\u7684\u6587\u672c\u641c\u7d22\u5339\u914d\u5de5\u5177\uff0c\u867d\u7136\u6709\u5f88\u591a\u53c2\u6570\uff0c\u4f46\u662f\u5927\u591a\u6570\u57fa\u672c\u4e0a\u90fd\u7528\u4e0d\u5230\u3002\u5218\u9044\u8001\u5e08\u5728\u603b\u7ed3\u4e86\u8fd110\u5e74\u7684\u8fd0\u7ef4\u5de5\u4f5c\u548c\u57f9\u8bad\u6559\u5b66\u7684\u7ecf\u9a8c\u540e\uff0c\u63d0\u51fa\u7684\u672c\u4e66\u7684\u5199\u4f5c\u7406\u5ff5\u201c\u53bb\u6389\u4e0d\u5b9e\u7528\u201d\u7edd\u5bf9\u4e0d\u662f\u4fe1\u53e3\u5f00\u6cb3\u3002\u5982\u679c\u4e00\u540dIT\u57f9\u8bad\u8bb2\u5e08\u7684\u6c34\u5e73\u53ea\u80fd\u505c\u7559\u5728\u201c\u6280\u672f\u7684\u642c\u8fd0\u5de5\u201d\u5c42\u9762\uff0c\u800c\u4e0d\u80fd\u5bf9\u4f18\u8d28\u6280\u672f\u77e5\u8bc6\u8fdb\u884c\u63d0\u70bc\u603b\u7ed3\uff0c\u90a3\u5bf9\u4ed6\u7684\u5b66\u751f\u6765\u8bb2\u7edd\u975e\u597d\u4e8b\u3002\u6211\u4eec\u5728\u8fd9\u91cc\u53ea\u8bb2\u4e24\u4e2a\u6700\u6700\u5e38\u7528\u7684\u53c2\u6570\uff1a-n\u53c2\u6570\u7528\u6765\u663e\u793a\u641c\u7d22\u5230\u4fe1\u606f\u7684\u884c\u53f7\uff1b-v\u53c2\u6570\u7528\u4e8e\u53cd\u9009\u4fe1\u606f\uff08\u5373\u6ca1\u6709\u5305\u542b\u5173\u952e\u8bcd\u7684\u6240\u6709\u4fe1\u606f\u884c\uff09\u3002\u8fd9\u4e24\u4e2a\u53c2\u6570\u51e0\u4e4e\u80fd\u5b8c\u6210\u60a8\u65e5\u540e80%\u7684\u5de5\u4f5c\u9700\u8981\uff0c\u81f3\u4e8e\u5176\u4ed6\u4e0a\u767e\u4e2a\u53c2\u6570\uff0c\u5373\u4f7f\u4ee5\u540e\u5728\u5de5\u4f5c\u671f\u95f4\u9047\u5230\u4e86\uff0c\u518d\u4f7f\u7528man grep\u547d\u4ee4\u67e5\u8be2\u4e5f\u6765\u5f97\u53ca\u3002<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\/etc\/passwd\u6587\u4ef6\u662f\u4fdd\u5b58\u7740\u6240\u6709\u7684\u7528\u6237\u4fe1\u606f\uff0c\u800c\u4e00\u65e6\u7528\u6237\u7684\u767b\u5f55\u7ec8\u7aef\u88ab\u8bbe\u7f6e\u6210\/sbin\/nologin\uff0c\u5219\u4e0d\u518d\u5141\u8bb8\u767b\u5f55\u7cfb\u7edf\uff0c\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528grep\u547d\u4ee4\u6765\u67e5\u627e\u51fa\u5f53\u524d\u7cfb\u7edf\u4e2d\u4e0d\u5141\u8bb8\u767b\u5f55\u7cfb\u7edf\u7684\u6240\u6709\u7528\u6237\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# grep \/sbin\/nologin \/etc\/passwd\r\nbin:x:1:1:bin:\/bin:\/sbin\/nologin\r\ndaemon:x:2:2:daemon:\/sbin:\/sbin\/nologin\r\nadm:x:3:4:adm:\/var\/adm:\/sbin\/nologin\r\nlp:x:4:7:lp:\/var\/spool\/lpd:\/sbin\/nologin\r\nmail:x:8:12:mail:\/var\/spool\/mail:\/sbin\/nologin\r\noperator:x:11:0:operator:\/root:\/sbin\/nologin\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u8fc7\u7a0b\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n

3\uff0efind\u547d\u4ee4<\/strong><\/p>\n

find\u547d\u4ee4\u7528\u4e8e\u6309\u7167\u6307\u5b9a\u6761\u4ef6\u6765\u67e5\u627e\u6587\u4ef6\uff0c\u683c\u5f0f\u4e3a\u201cfind [\u67e5\u627e\u8def\u5f84] \u5bfb\u627e\u6761\u4ef6 \u64cd\u4f5c\u201d\u3002<\/p>\n

\u672c\u4e66\u4e2d\u66fe\u7ecf\u591a\u6b21\u63d0\u5230\u201cLinux\u7cfb\u7edf\u4e2d\u7684\u4e00\u5207\u90fd\u662f\u6587\u4ef6\u201d\uff0c\u63a5\u4e0b\u6765\u5c31\u8981\u89c1\u8bc1\u8fd9\u53e5\u8bdd\u7684\u5206\u91cf\u4e86\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u641c\u7d22\u5de5\u4f5c\u4e00\u822c\u90fd\u662f\u901a\u8fc7find\u547d\u4ee4\u6765\u5b8c\u6210\u7684\uff0c\u5b83\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u6587\u4ef6\u7279\u6027\u4f5c\u4e3a\u5bfb\u627e\u6761\u4ef6\uff08\u5982\u6587\u4ef6\u540d\u3001\u5927\u5c0f\u3001\u4fee\u6539\u65f6\u95f4\u3001\u6743\u9650\u7b49\u4fe1\u606f\uff09\uff0c\u4e00\u65e6\u5339\u914d\u6210\u529f\u5219\u9ed8\u8ba4\u5c06\u4fe1\u606f\u663e\u793a\u5230\u5c4f\u5e55\u4e0a\u3002find\u547d\u4ee4\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528\u5982\u88682-16\u6240\u793a\u3002<\/p>\n

\u88682-16\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 find\u547d\u4ee4\u4e2d\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-name<\/td>\n\u5339\u914d\u540d\u79f0<\/td>\n<\/tr>\n
-perm<\/td>\n\u5339\u914d\u6743\u9650\uff08mode\u4e3a\u5b8c\u5168\u5339\u914d\uff0c-mode\u4e3a\u5305\u542b\u5373\u53ef\uff09<\/td>\n<\/tr>\n
-user <\/td>\n\u5339\u914d\u6240\u6709\u8005<\/td>\n<\/tr>\n
-group<\/td>\n\u5339\u914d\u6240\u6709\u7ec4<\/td>\n<\/tr>\n
-mtime -n +n<\/td>\n\u5339\u914d\u4fee\u6539\u5185\u5bb9\u7684\u65f6\u95f4\uff08-n\u6307n\u5929\u4ee5\u5185\uff0c+n\u6307n\u5929\u4ee5\u524d\uff09<\/td>\n<\/tr>\n
-atime -n +n<\/td>\n\u5339\u914d\u8bbf\u95ee\u6587\u4ef6\u7684\u65f6\u95f4\uff08-n\u6307n\u5929\u4ee5\u5185\uff0c+n\u6307n\u5929\u4ee5\u524d\uff09<\/td>\n<\/tr>\n
-ctime -n +n<\/td>\n\u5339\u914d\u4fee\u6539\u6587\u4ef6\u6743\u9650\u7684\u65f6\u95f4\uff08-n\u6307n\u5929\u4ee5\u5185\uff0c+n\u6307n\u5929\u4ee5\u524d\uff09<\/td>\n<\/tr>\n
-nouser<\/td>\n\u5339\u914d\u65e0\u6240\u6709\u8005\u7684\u6587\u4ef6<\/td>\n<\/tr>\n
-nogroup<\/td>\n\u5339\u914d\u65e0\u6240\u6709\u7ec4\u7684\u6587\u4ef6<\/td>\n<\/tr>\n
-newer f1 !f2<\/td>\n\u5339\u914d\u6bd4\u6587\u4ef6f1\u65b0\u4f46\u6bd4f2\u65e7\u7684\u6587\u4ef6<\/td>\n<\/tr>\n
-type b\/d\/c\/p\/l\/f<\/td>\n\u5339\u914d\u6587\u4ef6\u7c7b\u578b\uff08\u540e\u9762\u7684\u5b57\u6bcd\u4f9d\u6b21\u8868\u793a\u5757\u8bbe\u5907\u3001\u76ee\u5f55\u3001\u5b57\u7b26\u8bbe\u5907\u3001\u7ba1\u9053\u3001\u94fe\u63a5\u6587\u4ef6\u3001\u6587\u672c\u6587\u4ef6\uff09<\/td>\n<\/tr>\n
-size<\/td>\n\u5339\u914d\u6587\u4ef6\u7684\u5927\u5c0f\uff08+50KB\u4e3a\u67e5\u627e\u8d85\u8fc750KB\u7684\u6587\u4ef6\uff0c\u800c-50KB\u4e3a\u67e5\u627e\u5c0f\u4e8e50KB\u7684\u6587\u4ef6\uff09<\/td>\n<\/tr>\n
-prune<\/td>\n\u5ffd\u7565\u67d0\u4e2a\u76ee\u5f55<\/td>\n<\/tr>\n
-exec \u2026\u2026 {}\\;<\/td>\n\u540e\u9762\u53ef\u8ddf\u7528\u4e8e\u8fdb\u4e00\u6b65\u5904\u7406\u641c\u7d22\u7ed3\u679c\u7684\u547d\u4ee4\uff08\u4e0b\u6587\u4f1a\u6709\u6f14\u793a\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u8fd9\u91cc\u9700\u8981\u91cd\u70b9\u8bb2\u89e3\u4e00\u4e0b-exec\u53c2\u6570\u91cd\u8981\u7684\u4f5c\u7528\u3002\u8fd9\u4e2a\u53c2\u6570\u7528\u4e8e\u628afind\u547d\u4ee4\u641c\u7d22\u5230\u7684\u7ed3\u679c\u4ea4\u7531\u7d27\u968f\u5176\u540e\u7684\u547d\u4ee4\u4f5c\u8fdb\u4e00\u6b65\u5904\u7406\uff0c\u5b83\u5341\u5206\u7c7b\u4f3c\u4e8e\u7b2c3\u7ae0\u5c06\u8981\u8bb2\u89e3\u7684\u7ba1\u9053\u7b26\u6280\u672f\uff0c\u5e76\u4e14\u7531\u4e8efind\u547d\u4ee4\u5bf9\u53c2\u6570\u7684\u7279\u6b8a\u8981\u6c42\uff0c\u56e0\u6b64\u867d\u7136exec\u662f\u957f\u683c\u5f0f\u5f62\u5f0f\uff0c\u4f46\u4f9d\u7136\u53ea\u9700\u8981\u4e00\u4e2a\u51cf\u53f7\uff08-\uff09\u3002<\/p>\n

\u6839\u636e\u6587\u4ef6\u7cfb\u7edf\u5c42\u6b21\u6807\u51c6\uff08Filesystem Hierarchy Standard\uff09\u534f\u8bae\uff0cLinux\u7cfb\u7edf\u4e2d\u7684\u914d\u7f6e\u6587\u4ef6\u4f1a\u4fdd\u5b58\u5230\/etc\u76ee\u5f55\u4e2d\uff08\u8be6\u89c1\u7b2c6\u7ae0\uff09\u3002\u5982\u679c\u8981\u60f3\u83b7\u53d6\u5230\u8be5\u76ee\u5f55\u4e2d\u6240\u6709\u4ee5host\u5f00\u5934\u7684\u6587\u4ef6\u5217\u8868\uff0c\u53ef\u4ee5\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n

[root@linuxprobe ~]# find \/etc -name \"host*\" -print\r\n\/etc\/avahi\/hosts\r\n\/etc\/host.conf\r\n\/etc\/hosts\r\n\/etc\/hosts.allow\r\n\/etc\/hosts.deny\r\n\/etc\/selinux\/targeted\/modules\/active\/modules\/hostname.pp\r\n\/etc\/hostname<\/pre>\n
\n
\n

\u5982\u679c\u8981\u5728\u6574\u4e2a\u7cfb\u7edf\u4e2d\u641c\u7d22\u6743\u9650\u4e2d\u5305\u62ecSUID\u6743\u9650\u7684\u6240\u6709\u6587\u4ef6\uff08\u8be6\u89c1\u7b2c5\u7ae0\uff09\uff0c\u53ea\u9700\u4f7f\u7528-4000\u5373\u53ef\uff1a<\/p>\n<\/div>\n

[root@linuxprobe ~]# find \/ -perm -4000 -print\r\n\/usr\/bin\/fusermount\r\n\/usr\/bin\/su\r\n\/usr\/bin\/umount\r\n\/usr\/bin\/passwd\r\n\/usr\/sbin\/userhelper\r\n\/usr\/sbin\/usernetctl\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u8fdb\u9636\u5b9e\u9a8c\uff1a\u5728\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u4e2d\u627e\u51fa\u6240\u6709\u5f52\u5c5e\u4e8elinuxprobe\u7528\u6237\u7684\u6587\u4ef6\u5e76\u590d\u5236\u5230\/root\/findresults\u76ee\u5f55\u3002<\/p>\n

\u8be5\u5b9e\u9a8c\u7684\u91cd\u70b9\u662f\u201c-exec {}\u00a0\u00a0 \\;\u201d\u53c2\u6570\uff0c\u5176\u4e2d\u7684{}\u8868\u793afind\u547d\u4ee4\u641c\u7d22\u51fa\u7684\u6bcf\u4e00\u4e2a\u6587\u4ef6\uff0c\u5e76\u4e14\u547d\u4ee4\u7684\u7ed3\u5c3e\u5fc5\u987b\u662f\u201c\\;\u201d\u3002\u5b8c\u6210\u8be5\u5b9e\u9a8c\u7684\u5177\u4f53\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n

[root@linuxprobe\u00a0~]#\u00a0find\u00a0\/\u00a0-user\u00a0linuxprobe\u00a0-exec\u00a0cp\u00a0-a\u00a0{}\u00a0\/root\/findresults\/\u00a0\\;<\/p><\/blockquote>\n

\u5728\u672c\u7ae0\u6700\u540e\uff0c\u5218\u9044\u8001\u5e08\u518d\u591a\u63d0\u51e0\u53e5\uff1a\u5f88\u591a\u8bfb\u8005\u521d\u6b21\u63a5\u89e6\u5230\u672c\u4e66\u65f6\u90fd\u62c5\u5fc3\u56e0\u4e3a\u81ea\u5df1\u7684\u82f1\u8bed\u57fa\u7840\u4e0d\u597d\u800c\u5bfc\u81f4\u5b66\u4e0d\u4f1aLinux\u7cfb\u7edf\uff0c\u5176\u5b9e\u5927\u53ef\u4e0d\u5fc5\u62c5\u5fc3\uff0c\u56e0\u4e3a\u6211\u4eec\u7684\u56fe\u4e66\u3001\u57f9\u8bad\u8bfe\u7a0b\u751a\u81f3\u7ea2\u5e3d<\/a>\u8003\u9898\u90fd\u662f\u4e2d\u6587\u7684\u3002\u800c\u5728\u5b66\u4e60\u5b8c\u672c\u7ae0\u540e\u60a8\u4e5f\u4e00\u5b9a\u53d1\u73b0\u4e86\uff0c\u6211\u4eec\u4ee5\u540e\u8981\u4f7f\u7528\u7684\u662fLinux\u547d\u4ee4\uff0c\u800c\u7edd\u4e0d\u662f\u7eaf\u7cb9\u7684\u82f1\u8bed\u5355\u8bcd\uff0c\u5373\u4fbf\u5b83\u4eec\u7684\u62fc\u5199100%\u76f8\u540c\uff0c\u6700\u7ec8\u7528\u5904\u80af\u5b9a\u4e5f\u662f\u4e0d\u4e00\u6837\u7684\u3002\u56e0\u6b64\u5c31\u5b66\u4e60Linux\u7cfb\u7edf\u6280\u672f\u6765\u8bb2\uff0c\u60a8\u8ddf\u82f1\u8bed\u8fbe\u4eba\u7edd\u5bf9\u90fd\u662f\u7ad9\u5728\u540c\u4e00\u8d77\u8dd1\u7ebf\u4e0a\u7684\uff0c\u66f4\u4f55\u51b5\u8fd8\u6b63\u786e\u5730\u9009\u62e9\u4e86\u4e00\u672c\u9002\u5408\u60a8\u7684Linux\u6559\u6750\u3002\u4f11\u606f\u4e00\u4e0b\uff0c\u7136\u540e\u5f00\u59cb\u5b66\u4e60\u7b2c3\u7ae0\u5427\uff01<\/p>\n

\u51fa\u73b0\u95ee\u9898?\u5927\u80c6\u63d0\u95ee!<\/strong><\/span><\/p>\n

\u56e0\u8bfb\u8005\u4eec\u786c\u4ef6\u4e0d\u540c\u6216\u64cd\u4f5c\u9519\u8bef\u90fd\u53ef\u80fd\u5bfc\u81f4\u5b9e\u9a8c\u914d\u7f6e\u51fa\u9519\uff0c\u8bf7\u8010\u5fc3\u518d\u4ed4\u7ec6\u770b\u770b\u64cd\u4f5c\u6b65\u9aa4\u5427\uff0c\u4e0d\u8981\u6c14\u9981~<\/p>\n

Linux\u6280\u672f\u4ea4\u6d41\u8bf7\u52a0A\u7fa4\uff1a560843(\u6ee1<\/span><\/strong>)\uff0cB\u7fa4\uff1a340829(\u63a8\u8350<\/span><\/strong>)\uff0cC\u7fa4\uff1a463590\uff08\u63a8\u8350<\/span><\/strong>\uff09\uff0c\u70b9\u6b64\u67e5\u770b\u5168\u56fd\u7fa4<\/a>\u3002<\/p>\n

*\u672c\u7fa4\u7279\u8272\uff1a\u901a\u8fc7\u53e3\u4ee4\u9a8c\u8bc1\u786e\u4fdd\u6bcf\u4e00\u4e2a\u7fa4\u5458\u90fd\u662f\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7684\u8bfb\u8005\uff0c\u7b54\u7591\u66f4\u6709\u9488\u5bf9\u6027\uff0c\u4e0d\u5b9a\u671f\u514d\u8d39\u9886\u53d6\u5b9a\u5236\u793c\u54c1\u3002<\/p><\/blockquote>\n

\u672c\u7ae0\u8282\u7684\u590d\u4e60\u4f5c\u4e1a<\/span>(\u7b54\u6848\u5c31\u5728\u95ee\u9898\u7684\u4e0b\u4e00\u884c\u54e6\uff0c\u7528\u9f20\u6807\u9009\u4e2d\u5373\u53ef\u770b\u5230\u7684~)<\/strong><\/span><\/p>\n

1\uff0e\u5728RHEL 7\u7cfb\u7edf\u53ca\u4f17\u591a\u7684Linux\u7cfb\u7edf\u4e2d\uff0c\u6700\u5e38\u4f7f\u7528\u7684Shell\u7ec8\u7aef\u662f\u4ec0\u4e48\uff1f<\/p>\n

\u7b54\uff1a<\/strong>Bash\uff08Bourne-Again SHell\uff09\u89e3\u91ca\u5668\u3002<\/span><\/p>\n

2\uff0e\u6267\u884cLinux\u7cfb\u7edf\u547d\u4ee4\u65f6\uff0c\u6dfb\u52a0\u53c2\u6570\u7684\u76ee\u7684\u662f\u4ec0\u4e48\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u4e3a\u4e86\u8ba9Linux\u7cfb\u7edf\u547d\u4ee4\u80fd\u591f\u66f4\u8d34\u5408\u7528\u6237\u7684\u5b9e\u9645\u9700\u6c42\u8fdb\u884c\u5de5\u4f5c\u3002<\/span><\/p>\n

3\uff0eLinux\u7cfb\u7edf\u547d\u4ee4\u3001\u547d\u4ee4\u53c2\u6570\u53ca\u547d\u4ee4\u5bf9\u8c61\u4e4b\u95f4\uff0c\u666e\u904d\u5e94\u8be5\u4f7f\u7528\u4ec0\u4e48\u6765\u95f4\u9694\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u5e94\u8be5\u4f7f\u7528\u4e00\u4e2a\u6216\u591a\u4e2a\u7a7a\u683c\u8fdb\u884c\u95f4\u9694\u3002<\/span><\/p>\n

4\uff0e\u8bf7\u5199\u51fa\u7528echo\u547d\u4ee4\u628aSHELL\u53d8\u91cf\u503c\u8f93\u51fa\u5230\u5c4f\u5e55\u7ec8\u7aef\u7684\u547d\u4ee4\u3002<\/p>\n

\u7b54\uff1a<\/strong>echo $SHELL\u3002<\/span><\/p>\n

5\uff0e\u7b80\u8ff0Linux\u7cfb\u7edf\u4e2d5\u79cd\u8fdb\u7a0b\u7684\u540d\u79f0\u53ca\u542b\u4e49\u3002<\/p>\n

\u7b54\uff1a<\/strong>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6709\u4e0b\u97625\u79cd\u8fdb\u7a0b\u540d\u79f0\u3002<\/span><\/p>\n

R<\/strong>\uff08\u8fd0\u884c\uff09\uff1a<\/strong>\u8fdb\u7a0b\u6b63\u5728\u8fd0\u884c\u6216\u5728\u8fd0\u884c\u961f\u5217\u4e2d\u7b49\u5f85\u3002<\/span><\/p>\n

S<\/strong>\uff08\u4e2d\u65ad\uff09\uff1a<\/strong>\u8fdb\u7a0b\u5904\u4e8e\u4f11\u7720\u4e2d\uff0c\u5f53\u67d0\u4e2a\u6761\u4ef6\u5f62\u6210\u540e\u6216\u8005\u63a5\u6536\u5230\u4fe1\u53f7\u65f6\uff0c\u5219\u8131\u79bb\u8be5\u72b6\u6001\u3002<\/span><\/p>\n

D<\/strong>\uff08\u4e0d\u53ef\u4e2d\u65ad\uff09\uff1a<\/strong>\u8fdb\u7a0b\u4e0d\u54cd\u5e94\u7cfb\u7edf\u5f02\u6b65\u4fe1\u53f7\uff0c\u5373\u4fbf\u7528kill\u547d\u4ee4\u4e5f\u4e0d\u80fd\u5c06\u5176\u4e2d\u65ad\u3002<\/span><\/p>\n

Z<\/strong>\uff08\u50f5\u6b7b\uff09\uff1a<\/strong>\u8fdb\u7a0b\u5df2\u7ecf\u7ec8\u6b62\uff0c\u4f46\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u4f9d\u7136\u5b58\u5728, \u76f4\u5230\u7236\u8fdb\u7a0b\u8c03\u7528wait4()\u7cfb\u7edf\u51fd\u6570\u540e\u5c06\u8fdb\u7a0b\u91ca\u653e\u3002<\/span><\/p>\n

T<\/strong>\uff08\u505c\u6b62\uff09\uff1a<\/strong>\u8fdb\u7a0b\u6536\u5230\u505c\u6b62\u4fe1\u53f7\u540e\u505c\u6b62\u8fd0\u884c\u3002<\/span><\/p><\/blockquote>\n

6\uff0e\u8bf7\u5c1d\u8bd5\u4f7f\u7528Linux\u7cfb\u7edf\u547d\u4ee4\u5173\u95edPID\u4e3a5529\u7684\u670d\u52a1\u8fdb\u7a0b\u3002<\/p>\n

\u7b54\uff1a<\/strong>\u6267\u884ckill 5529\u547d\u4ee4\u5373\u53ef\uff1b\u82e5\u77e5\u9053\u670d\u52a1\u7684\u540d\u79f0\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528killall\u547d\u4ee4\u8fdb\u884c\u5173\u95ed\u3002<\/span><\/p>\n

7\uff0e\u4f7f\u7528ifconfig\u547d\u4ee4\u67e5\u770b\u7f51\u7edc\u72b6\u6001\u4fe1\u606f\u65f6\uff0c\u9700\u8981\u91cd\u70b9\u67e5\u770b\u76844\u9879\u4fe1\u606f\u5206\u522b\u662f\u4ec0\u4e48\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u8fd94\u9879\u91cd\u8981\u4fe1\u606f\u5206\u522b\u662f\u7f51\u5361\u540d\u79f0\u3001IP\u5730\u5740\u3001\u7f51\u5361\u7269\u7406\u5730\u5740\u4ee5\u53caRX\/TX\u7684\u6536\u53d1\u6d41\u91cf\u6570\u636e\u5927\u5c0f\u3002<\/span><\/p>\n

8\uff0e\u4f7f\u7528uptime\u547d\u4ee4\u67e5\u770b\u7cfb\u7edf\u8d1f\u8f7d\u65f6\uff0c\u5bf9\u5e94\u7684\u8d1f\u8f7d\u6570\u503c\u5982\u679c\u662f0.91\u30010.56\u30010.32\uff0c\u90a3\u4e48\u6700\u8fd115\u5206\u949f\u5185\u8d1f\u8f7d\u538b\u529b\u6700\u5927\u7684\u662f\u54ea\u4e2a\u65f6\u95f4\u6bb5\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u901a\u8fc7\u8d1f\u8f7d\u6570\u503c\u53ef\u4ee5\u770b\u51fa\uff0c\u6700\u8fd11\u5206\u949f\u5185\u7684\u8d1f\u8f7d\u538b\u529b\u662f\u6700\u5927\u7684\u3002<\/span><\/p>\n

9\uff0e\u4f7f\u7528history\u547d\u4ee4\u67e5\u770b\u5386\u53f2\u547d\u4ee4\u7684\u6267\u884c\u8bb0\u5f55\u65f6\uff0c\u547d\u4ee4\u524d\u9762\u7684\u6570\u5b57\u9664\u4e86\u6392\u5e8f\u5916\u8fd8\u6709\u4ec0\u4e48\u7528\u5904\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u8fd8\u53ef\u4ee5\u7528\u201c!\u6570\u5b57\u201d\u7684\u547d\u4ee4\u683c\u5f0f\u91cd\u590d\u6267\u884c\u67d0\u4e00\u6b21\u7684\u547d\u4ee4\u8bb0\u5f55\uff0c\u4ece\u800c\u907f\u514d\u4e86\u91cd\u590d\u8f93\u5165\u8f83\u957f\u547d\u4ee4\u7684\u9ebb\u70e6\u3002<\/span><\/p>\n

10\uff0e\u82e5\u60f3\u67e5\u770b\u7684\u6587\u4ef6\u5177\u6709\u8f83\u957f\u7684\u5185\u5bb9\uff0c\u90a3\u4e48\u4f7f\u7528cat\u3001more\u3001head\u3001tail\u4e2d\u7684\u54ea\u4e2a\u547d\u4ee4\u6700\u5408\u9002\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u6587\u4ef6\u5185\u5bb9\u8f83\u957f\uff0c\u4f7f\u7528more\u547d\u4ee4\uff1b\u53cd\u4e4b\u4f7f\u7528cat\u547d\u4ee4\u3002<\/span><\/p>\n

11\uff0e\u5728\u4f7f\u7528mkdir\u547d\u4ee4\u521b\u5efa\u6709\u5d4c\u5957\u5173\u7cfb\u7684\u76ee\u5f55\u65f6\uff0c\u5e94\u8be5\u52a0\u4e0a\u4ec0\u4e48\u53c2\u6570\u5462\uff1f<\/p>\n

\u00a0\u7b54\uff1a<\/strong>\u5e94\u8be5\u52a0\u4e0a-p\u9012\u5f52\u8fed\u4ee3\u53c2\u6570\uff0c\u4ece\u800c\u81ea\u52a8\u5316\u521b\u5efa\u6709\u5d4c\u5957\u5173\u7cfb\u7684\u76ee\u5f55\u3002<\/span><\/p>\n

12\uff0e\u5728\u4f7f\u7528rm\u547d\u4ee4\u5220\u9664\u6587\u4ef6\u6216\u76ee\u5f55\u65f6\uff0c\u53ef\u4f7f\u7528\u54ea\u4e2a\u53c2\u6570\u6765\u907f\u514d\u4e8c\u6b21\u786e\u8ba4\u5462\uff1f<\/p>\n

\u00a0\u7b54\uff1a<\/strong>\u53ef\u4f7f\u7528-f\u53c2\u6570\uff0c\u8fd9\u6837\u5373\u53ef\u65e0\u9700\u4e8c\u6b21\u786e\u8ba4\u3002<\/span><\/p>\n

13\uff0e\u82e5\u6709\u4e00\u4e2a\u540d\u4e3abackup.tar.gz\u7684\u538b\u7f29\u5305\u6587\u4ef6\uff0c\u90a3\u4e48\u89e3\u538b\u7684\u547d\u4ee4\u5e94\u8be5\u662f\u4ec0\u4e48\uff1f<\/p>\n

\u00a0\u7b54\uff1a<\/strong>\u5e94\u8be5\u7528tar\u547d\u4ee4\u8fdb\u884c\u89e3\u538b\uff0c\u6267\u884ctar -<\/strong>xzvf backup.tar.gz\u547d\u4ee4\u5373\u53ef\u3002<\/span><\/p>\n

14\uff0e\u4f7f\u7528grep\u547d\u4ee4\u5bf9\u67d0\u4e2a\u6587\u4ef6\u8fdb\u884c\u5173\u952e\u8bcd\u641c\u7d22\u65f6\uff0c\u82e5\u60f3\u8981\u8fdb\u884c\u6587\u4ef6\u5185\u5bb9\u53cd\u9009\uff0c\u5e94\u4f7f\u7528\u4ec0\u4e48\u53c2\u6570\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u53ef\u4f7f\u7528-v\u53c2\u6570\u6765\u8fdb\u884c\u5339\u914d\u5185\u5bb9\u7684\u53cd\u5411\u9009\u62e9\uff0c\u5373\u663e\u793a\u51fa\u4e0d\u5305\u542b\u67d0\u4e2a\u5173\u952e\u8bcd\u7684\u884c\u3002<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

\u7ea2\u5e3d\u67b6\u6784\u5e08\u8bb2\u8ff0Linux\u7cfb\u7edf\u5185\u6838\u3001Bash\u89e3\u91ca\u5668\uff0c\u6536\u5f55\u4e86\u4e0a\u767e\u4e2a\u6700\u5e38\u7528\u7684Linux\u7cfb\u7edf\u547d\u4ee4\u3001\u6700\u9ad8\u6548\u7387\u7684Linux\u547d\u4ee4\u53c2\u6570\u7ec4\u5408\u65b9\u5f0f\u4e0e\u6700\u5e38\u7528\u7684Linux\u547d\u4ee4\u6392\u9519\u5e2e\u52a9\u65b9\u6cd5\u3002<\/p>\n","protected":false},"author":1,"featured_media":12590,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[558],"tags":[],"class_list":["post-286","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rhel7"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"count":313,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"predecessor-version":[{"id":218010,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/286\/revisions\/218010"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/12590"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}