{"id":72,"date":"2020-02-18T17:37:01","date_gmt":"2020-02-18T09:37:01","guid":{"rendered":"https:\/\/liushiming.cn\/?p=72"},"modified":"2023-07-16T13:38:26","modified_gmt":"2023-07-16T05:38:26","slug":"linux-cookbook","status":"publish","type":"post","link":"https:\/\/liushiming.cn\/article\/linux-cookbook.html","title":{"rendered":"linux cookbook"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f8a4b9bc23e\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f8a4b9bc23e\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B_linux_%E7%89%88%E6%9C%AC\" >\u67e5\u770b linux \u7248\u672c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E4%BD%BF%E7%94%A8%E7%9A%84_shell\" >\u67e5\u770b\u4f7f\u7528\u7684 shell<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF\" >\u67e5\u770b\u7cfb\u7edf\u4fe1\u606f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E7%A1%AC%E4%BB%B6%E4%BF%A1%E6%81%AF\" >\u67e5\u770b\u786c\u4ef6\u4fe1\u606f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%B3%BB%E7%BB%9F%E6%97%B6%E9%97%B4_%E2%80%93_date\" >\u7cfb\u7edf\u65f6\u95f4 &#8211; date<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9C%AC%E5%9C%B0%E5%8C%96%E8%AE%BE%E7%BD%AE\" >\u672c\u5730\u5316\u8bbe\u7f6e<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%B3%BB%E7%BB%9F%E8%AF%AD%E8%A8%80_%E2%80%93_LANG\" >\u7cfb\u7edf\u8bed\u8a00 &#8211; LANG<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BF%AE%E6%94%B9%E7%B3%BB%E7%BB%9F%E8%AF%AD%E8%A8%80\" >\u4fee\u6539\u7cfb\u7edf\u8bed\u8a00<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BD%BF%E7%94%A8%E6%9C%AC%E6%9C%BA%E6%88%96%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%AF%AD%E8%A8%80\" >\u4f7f\u7528\u672c\u673a\u6216\u670d\u52a1\u5668\u8bed\u8a00<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%B8%BB%E6%9C%BA%E5%90%8D_%E2%80%93_hostnamectl\" >\u4e3b\u673a\u540d &#8211; hostnamectl<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E5%92%8C%E4%BF%AE%E6%94%B9%E4%B8%BB%E6%9C%BA%E5%90%8D\" >\u67e5\u770b\u548c\u4fee\u6539\u4e3b\u673a\u540d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BF%AE%E6%94%B9%E4%B8%BB%E6%9C%BA%E5%90%8D%E4%B8%B4%E6%97%B6%E4%BF%AE%E6%94%B9\" >\u4fee\u6539\u4e3b\u673a\u540d(\u4e34\u65f6\u4fee\u6539)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%91%BD%E4%BB%A4%E8%A1%8C%E6%8A%80%E5%B7%A7\" >\u547d\u4ee4\u884c\u6280\u5de7<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%A7%BB%E5%8A%A8\" >\u79fb\u52a8<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%89%AA%E5%88%87%E5%92%8C%E7%B2%98%E8%B4%B4\" >\u526a\u5207\u548c\u7c98\u8d34<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%90%9C%E7%B4%A2%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%8E%86%E5%8F%B2\" >\u641c\u7d22\u547d\u4ee4\u884c\u5386\u53f2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%90%9C%E7%B4%A2%E5%91%BD%E4%BB%A4\" >\u641c\u7d22\u547d\u4ee4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#sudo_%E8%BF%90%E8%A1%8C%E4%B8%8A%E4%B8%80%E4%B8%AA%E5%91%BD%E4%BB%A4\" >sudo \u8fd0\u884c\u4e0a\u4e00\u4e2a\u547d\u4ee4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#sudo_%E6%89%A7%E8%A1%8C%E4%B8%80%E4%B8%AA%E9%95%BF%E5%91%BD%E4%BB%A4\" >sudo \u6267\u884c\u4e00\u4e2a\u957f\u547d\u4ee4<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E7%B1%BB%E5%9E%8B_%E2%80%93_file\" >\u6587\u4ef6\u7c7b\u578b &#8211; file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E7%BB%9F%E8%AE%A1_%E2%80%93_wc\" >\u6587\u4ef6\u7edf\u8ba1 &#8211; wc<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%A3%81%E7%9B%98%E4%BD%BF%E7%94%A8%E6%83%85%E5%86%B5\" >\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E5%A4%A7%E5%B0%8F\" >\u6587\u4ef6\u5927\u5c0f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E6%89%93%E5%8D%B0\" >\u6587\u4ef6\u6253\u5370<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%BC%80%E5%A4%B4_%E2%80%93_head\" >\u5f00\u5934 &#8211; head<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9C%AB%E5%B0%BE_%E2%80%93_tail\" >\u672b\u5c3e &#8211; tail<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E7%AE%A1%E7%90%86\" >\u6587\u4ef6\u7ba1\u7406<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#linux_%E6%96%87%E4%BB%B6%E7%BB%93%E6%9E%84\" >linux \u6587\u4ef6\u7ed3\u6784<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E7%BB%93%E6%9E%84%E6%A0%87%E5%87%86\" >\u6587\u4ef6\u7ed3\u6784\u6807\u51c6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%89%93%E5%8D%B0%E5%BD%93%E5%89%8D%E5%B7%A5%E4%BD%9C%E7%9B%AE%E5%BD%95\" >\u6253\u5370\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%B0%E5%BB%BA%E7%9B%AE%E5%BD%95_%E2%80%93_mkdir\" >\u65b0\u5efa\u76ee\u5f55 &#8211; mkdir<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E5%88%97%E8%A1%A8_%E2%80%93_ls\" >\u6587\u4ef6\u5217\u8868 &#8211; ls<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%88%87%E6%8D%A2%E7%9B%AE%E5%BD%95\" >\u5207\u6362\u76ee\u5f55<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6_%E2%80%93_touch\" >\u65b0\u5efa\u6587\u4ef6 &#8211; touch<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%88%A0%E9%99%A4%E6%96%87%E4%BB%B6_%E2%80%93_rm\" >\u5220\u9664\u6587\u4ef6 &#8211; rm<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-36\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%A7%BB%E5%8A%A8%E6%96%87%E4%BB%B6_%E2%80%93_mv\" >\u79fb\u52a8\u6587\u4ef6 &#8211; mv<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-37\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E7%AE%A1%E7%90%86%E5%91%BD%E4%BB%A4\" >\u6587\u4ef6\u7ba1\u7406\u547d\u4ee4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-38\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E8%BD%AF%E9%93%BE%E6%8E%A5\" >\u6587\u4ef6\u8f6f\u94fe\u63a5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-39\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BF%AE%E6%94%B9%E6%96%87%E4%BB%B6%E6%89%80%E6%9C%89%E8%80%85\" >\u4fee\u6539\u6587\u4ef6\u6240\u6709\u8005<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-40\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BF%AE%E6%94%B9%E6%96%87%E4%BB%B6%E6%9D%83%E9%99%90\" >\u4fee\u6539\u6587\u4ef6\u6743\u9650<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-41\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%A1%AC%E7%9B%98%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%92%8C%E6%8C%82%E8%BD%BD\" >\u786c\u76d8\u683c\u5f0f\u5316\u548c\u6302\u8f7d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-42\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E8%BF%9C%E7%A8%8B%E6%96%87%E4%BB%B6%E4%BC%A0%E8%BE%93\" >\u8fdc\u7a0b\u6587\u4ef6\u4f20\u8f93<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-43\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86\" >\u7528\u6237\u7ba1\u7406<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-44\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%B7%BB%E5%8A%A0%E7%94%A8%E6%88%B7\" >\u6dfb\u52a0\u7528\u6237<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-45\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BF%AE%E6%94%B9%E7%94%A8%E6%88%B7\" >\u4fee\u6539\u7528\u6237<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-46\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A0%81_%E2%80%93_passwd\" >\u4fee\u6539\u5bc6\u7801 &#8211; passwd<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-47\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%88%87%E6%8D%A2%E7%94%A8%E6%88%B7\" >\u5207\u6362\u7528\u6237<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-48\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E9%94%81%E4%BD%8F%E7%94%A8%E6%88%B7\" >\u9501\u4f4f\u7528\u6237<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-49\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%88%A0%E9%99%A4%E7%94%A8%E6%88%B7%EF%BC%88%E8%BF%9E%E5%90%8C%E7%94%A8%E6%88%B7_home_%E7%9B%AE%E5%BD%95%EF%BC%89\" >\u5220\u9664\u7528\u6237\uff08\u8fde\u540c\u7528\u6237 home \u76ee\u5f55\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-50\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E5%BD%93%E5%89%8D%E7%99%BB%E5%BD%95%E7%94%A8%E6%88%B7\" >\u67e5\u770b\u5f53\u524d\u767b\u5f55\u7528\u6237<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-51\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E7%99%BB%E5%BD%95%E8%AE%B0%E5%BD%95\" >\u67e5\u770b\u767b\u5f55\u8bb0\u5f55<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-52\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%A6%81%E6%AD%A2%E7%94%A8%E6%88%B7_ssh_%E7%99%BB%E5%BD%95\" >\u7981\u6b62\u7528\u6237 ssh \u767b\u5f55<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-53\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%A6%81%E6%AD%A2%E5%AF%86%E7%A0%81%E7%99%BB%E5%BD%95%EF%BC%8C%E4%BB%85%E6%94%AF%E6%8C%81%E8%AF%81%E4%B9%A6\" >\u7981\u6b62\u5bc6\u7801\u767b\u5f55\uff0c\u4ec5\u652f\u6301\u8bc1\u4e66<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-54\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%B0%E5%BB%BA%E7%94%A8%E6%88%B7%E9%BB%98%E8%AE%A4%E4%BD%BF%E7%94%A8_zsh\" >\u65b0\u5efa\u7528\u6237\u9ed8\u8ba4\u4f7f\u7528 zsh<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-55\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9C%8D%E5%8A%A1%E7%AE%A1%E7%90%86\" >\u670d\u52a1\u7ba1\u7406<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-56\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85\" >\u8f6f\u4ef6\u5b89\u88c5<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-57\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%8C%85\" >\u4e8c\u8fdb\u5236\u5305<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-58\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%91%BD%E4%BB%A4%E6%9B%BF%E6%8D%A2\" >\u547d\u4ee4\u66ff\u6362<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-59\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%91%BD%E4%BB%A4%E5%8E%86%E5%8F%B2\" >\u547d\u4ee4\u5386\u53f2<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-60\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%89%93%E5%8D%B0%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%8E%86%E5%8F%B2\" >\u6253\u5370\u547d\u4ee4\u884c\u5386\u53f2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-61\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%89%A7%E8%A1%8C%E5%8E%86%E5%8F%B2%E5%91%BD%E4%BB%A4%E8%A1%8C\" >\u6267\u884c\u5386\u53f2\u547d\u4ee4\u884c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-62\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%90%9C%E7%B4%A2%E5%91%BD%E4%BB%A4%E5%8E%86%E5%8F%B2\" >\u641c\u7d22\u547d\u4ee4\u5386\u53f2<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-63\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%90%8E%E5%8F%B0%E8%BF%90%E8%A1%8C%E5%91%BD%E4%BB%A4\" >\u540e\u53f0\u8fd0\u884c\u547d\u4ee4<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-64\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#nohup_%E5%90%8E%E5%8F%B0%E8%BF%90%E8%A1%8C%E5%91%BD%E4%BB%A4\" >nohup \u540e\u53f0\u8fd0\u884c\u547d\u4ee4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-65\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%AE%88%E6%8A%A4%E8%BF%9B%E7%A8%8B\" >\u5b88\u62a4\u8fdb\u7a0b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-66\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#systemd\" >systemd<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-67\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%BD%91%E7%BB%9C\" >\u7f51\u7edc<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-68\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%BD%91%E7%BB%9C%E9%93%BE%E8%B7%AF%E6%B5%8B%E8%AF%95\" >\u7f51\u7edc\u94fe\u8def\u6d4b\u8bd5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-69\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E7%AB%AF%E5%8F%A3%E6%98%AF%E5%90%A6%E6%89%93%E5%BC%80\" >\u67e5\u770b\u7aef\u53e3\u662f\u5426\u6253\u5f00<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-70\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E9%98%BF%E9%87%8C%E4%BA%91%E5%AE%89%E5%85%A8%E7%BB%84%E7%AD%96%E7%95%A5\" >\u963f\u91cc\u4e91\u5b89\u5168\u7ec4\u7b56\u7565<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-71\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E9%98%B2%E7%81%AB%E5%A2%99\" >\u9632\u706b\u5899<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-72\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%BD%91%E7%BB%9C%E6%B5%8B%E8%AF%95\" >\u7f51\u7edc\u6d4b\u8bd5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-73\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E7%BD%91%E9%80%9F\" >\u67e5\u770b\u7f51\u901f<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-74\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%BC%96%E8%BE%91%E5%91%BD%E4%BB%A4%E8%A1%8C\" >\u7f16\u8f91\u547d\u4ee4\u884c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-75\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#bash_%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6\" >bash \u914d\u7f6e\u6587\u4ef6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-76\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\" >\u67e5\u770b\u73af\u5883\u53d8\u91cf<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-77\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#alias\" >alias<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-78\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#export\" >export<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-79\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#unset_%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\" >unset \u73af\u5883\u53d8\u91cf<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-80\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E5%8D%95%E4%B8%AA%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\" >\u67e5\u770b\u5355\u4e2a\u73af\u5883\u53d8\u91cf<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-81\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%B8%B8%E8%A7%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\" >\u5e38\u89c1\u73af\u5883\u53d8\u91cf<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-82\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#PATH\" >PATH<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-83\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E\" >\u53c2\u6570\u8bf4\u660e<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-84\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#export_%E4%BD%9C%E7%94%A8%E8%A7%A3%E6%9E%90\" >export \u4f5c\u7528\u89e3\u6790<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-85\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#append_to_the_PATH\" >append to the PATH<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-86\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%9B%BA%E5%8C%96%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\" >\u56fa\u5316\u73af\u5883\u53d8\u91cf<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-87\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%B1%80%E9%83%A8%E5%92%8C%E5%85%A8%E5%B1%80%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE\" >\u5c40\u90e8\u548c\u5168\u5c40\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-88\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E8%BF%9B%E7%A8%8B%E7%AE%A1%E7%90%86\" >\u8fdb\u7a0b\u7ba1\u7406<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-89\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E8%BF%9B%E7%A8%8B%E8%B5%84%E6%BA%90%E5%8D%A0%E7%94%A8\" >\u67e5\u770b\u8fdb\u7a0b\u8d44\u6e90\u5360\u7528<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-90\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E8%BF%9B%E7%A8%8B%E5%90%8E%E5%8F%B0%E8%BF%90%E8%A1%8C\" >\u8fdb\u7a0b\u540e\u53f0\u8fd0\u884c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-91\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E6%8C%87%E5%AE%9A%E8%BF%9B%E7%A8%8B\" >\u67e5\u770b\u6307\u5b9a\u8fdb\u7a0b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-92\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%89%93%E5%8D%B0%E5%BD%93%E5%89%8D%E8%BF%9B%E7%A8%8B_id\" >\u6253\u5370\u5f53\u524d\u8fdb\u7a0b id<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-93\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E8%AF%A2%E5%AD%90%E8%BF%9B%E7%A8%8B%E4%BF%A1%E6%81%AF\" >\u67e5\u8be2\u5b50\u8fdb\u7a0b\u4fe1\u606f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-94\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E8%BF%9B%E7%A8%8B%E5%89%8D%E5%8F%B0%E5%90%8E%E5%8F%B0%E8%BF%90%E8%A1%8C%E5%88%87%E6%8D%A2\" >\u8fdb\u7a0b\u524d\u53f0\/\u540e\u53f0\u8fd0\u884c\u5207\u6362<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-95\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#vim\" >vim<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-96\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%B3%BB%E7%BB%9F%E8%87%AA%E5%B8%A6%E6%95%99%E7%A8%8B\" >\u7cfb\u7edf\u81ea\u5e26\u6559\u7a0b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-97\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#vim_%E5%A4%8D%E5%88%B6%E5%86%85%E5%AE%B9%E5%88%B0_Mac_%E7%B3%BB%E7%BB%9F%E5%89%AA%E8%B4%B4%E6%9D%BF\" >vim \u590d\u5236\u5185\u5bb9\u5230 Mac \u7cfb\u7edf\u526a\u8d34\u677f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-98\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%86%99_read-only_%E6%96%87%E4%BB%B6\" >\u5199 read-only \u6587\u4ef6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-99\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%9B%B8%E5%AF%B9%E8%A1%8C%E5%8F%B7\" >\u76f8\u5bf9\u884c\u53f7<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-100\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#vscode_vim_%E6%8F%92%E4%BB%B6%E8%AE%BE%E7%BD%AE\" >vscode vim \u63d2\u4ef6\u8bbe\u7f6e<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-101\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#vim_normal_%E6%A8%A1%E5%BC%8F%E5%92%8C%E6%8F%92%E5%85%A5%E6%A8%A1%E5%BC%8F%E6%8C%87%E9%92%88%E5%BD%A2%E7%8A%B6\" >vim normal \u6a21\u5f0f\u548c\u63d2\u5165\u6a21\u5f0f\u6307\u9488\u5f62\u72b6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-102\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E5%88%97%E8%A1%A8\" >\u5e38\u7528\u547d\u4ee4\u5217\u8868<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-103\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#vim_%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81\" >vim \u4e2d\u6587\u4e71\u7801<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-104\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E8%8E%B7%E5%8F%96%E5%B8%AE%E5%8A%A9\" >\u83b7\u53d6\u5e2e\u52a9<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-105\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%90%9C%E7%B4%A2%E5%B8%AE%E5%8A%A9%E4%B8%BB%E9%A2%98\" >\u641c\u7d22\u5e2e\u52a9\u4e3b\u9898<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-106\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%B8%AE%E5%8A%A9%E5%88%86%E7%B1%BB\" >\u5e2e\u52a9\u5206\u7c7b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-107\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#pinfo\" >pinfo<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-108\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E8%BD%AF%E4%BB%B6%E5%8C%85%E6%96%87%E6%A1%A3\" >\u67e5\u770b\u8f6f\u4ef6\u5305\u6587\u6863<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-109\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%88%9B%E5%BB%BA%E3%80%81%E6%9F%A5%E7%9C%8B%E5%92%8C%E7%BC%96%E8%BE%91%E6%96%87%E6%9C%AC%E6%96%87%E4%BB%B6\" >\u521b\u5efa\u3001\u67e5\u770b\u548c\u7f16\u8f91\u6587\u672c\u6587\u4ef6<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-110\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%A0%87%E5%87%86%E8%BE%93%E5%85%A5%E3%80%81%E6%A0%87%E5%87%86%E8%BE%93%E5%87%BA%E3%80%81%E6%A0%87%E5%87%86%E9%94%99%E8%AF%AF\" >\u6807\u51c6\u8f93\u5165\u3001\u6807\u51c6\u8f93\u51fa\u3001\u6807\u51c6\u9519\u8bef<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-111\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#exit_code\" >exit code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-112\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E9%87%8D%E5%AE%9A%E5%90%91\" >\u91cd\u5b9a\u5411<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-113\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%AE%A1%E9%81%93\" >\u7ba1\u9053<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-114\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%94%A8%E6%88%B7%E5%92%8C%E7%BB%84\" >\u7528\u6237\u548c\u7ec4<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-115\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E5%BD%93%E5%89%8D%E7%94%A8%E6%88%B7%E4%BF%A1%E6%81%AF\" >\u67e5\u770b\u5f53\u524d\u7528\u6237\u4fe1\u606f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-116\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#passwd_%E6%96%87%E4%BB%B6%E6%A0%BC%E5%BC%8F\" >passwd \u6587\u4ef6\u683c\u5f0f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-117\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%9C%A8_passwd_%E6%96%87%E4%BB%B6%E4%B8%AD%E6%90%9C%E7%B4%A2%E7%94%A8%E6%88%B7\" >\u5728 passwd \u6587\u4ef6\u4e2d\u641c\u7d22\u7528\u6237<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-118\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E7%BB%84\" >\u7ec4<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-119\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%8C%85%E7%AE%A1%E7%90%86\" >\u5305\u7ba1\u7406<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-120\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9B%B4%E6%96%B0%E5%8C%85%E5%88%97%E8%A1%A8\" >\u66f4\u65b0\u5305\u5217\u8868<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-121\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9B%B4%E6%96%B0%E5%B7%B2%E5%AE%89%E8%A3%85%E7%9A%84%E5%8C%85\" >\u66f4\u65b0\u5df2\u5b89\u88c5\u7684\u5305<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-122\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%90%9C%E7%B4%A2%E5%8C%85\" >\u641c\u7d22\u5305<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-123\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E5%8C%85%E4%BF%A1%E6%81%AF\" >\u67e5\u770b\u5305\u4fe1\u606f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-124\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BB%8E%E5%BA%93%E4%B8%AD%E5%AE%89%E8%A3%85%E5%8C%85\" >\u4ece\u5e93\u4e2d\u5b89\u88c5\u5305<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-125\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BB%8E%E6%9C%AC%E5%9C%B0%E5%AE%89%E8%A3%85%E5%8C%85\" >\u4ece\u672c\u5730\u5b89\u88c5\u5305<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-126\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%88%A0%E9%99%A4%E4%B8%80%E4%B8%AA%E6%88%96%E5%A4%9A%E4%B8%AA%E5%8C%85\" >\u5220\u9664\u4e00\u4e2a\u6216\u591a\u4e2a\u5305<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-127\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9F%A5%E7%9C%8B%E5%B8%AE%E5%8A%A9\" >\u67e5\u770b\u5e2e\u52a9<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-128\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#apt_vs_apt-get\" >apt vs apt-get<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-129\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%9B%B4%E5%A4%9A%E8%B5%84%E6%BA%90\" >\u66f4\u591a\u8d44\u6e90<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-130\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%B8%B8%E7%94%A8_bash_%E5%91%BD%E4%BB%A4\" >\u5e38\u7528 bash \u547d\u4ee4<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-131\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#find\" >find<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-132\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#sed\" >sed<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-133\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#awk\" >awk<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-134\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#http_%E6%96%87%E4%BB%B6%E6%9C%8D%E5%8A%A1%E5%99%A8\" >http \u6587\u4ef6\u670d\u52a1\u5668<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-135\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E4%B8%8B%E8%BD%BD\" >\u6587\u4ef6\u4e0b\u8f7d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-136\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%96%87%E4%BB%B6%E5%8E%8B%E7%BC%A9%E5%92%8C%E8%A7%A3%E5%8E%8B\" >\u6587\u4ef6\u538b\u7f29\u548c\u89e3\u538b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-137\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%AE%9E%E7%94%A8%E6%8A%80%E5%B7%A7\" >\u5b9e\u7528\u6280\u5de7<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-138\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%88%A0%E9%99%A4%E9%98%BF%E9%87%8C%E4%BA%91%E7%9B%BE\" >\u5220\u9664\u963f\u91cc\u4e91\u76fe<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-139\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#ubuntu_%E5%AE%89%E8%A3%85_mysql\" >ubuntu \u5b89\u88c5 mysql<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-140\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E9%85%8D%E7%BD%AE_mysql\" >\u914d\u7f6e mysql<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-141\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#mysql_%E5%BC%80%E5%90%AF%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5\" >mysql \u5f00\u542f\u8fdc\u7a0b\u8fde\u63a5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-142\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#ubuntu_%E4%B8%8B_terminal_%E5%A4%8D%E5%88%B6%E7%B2%98%E8%B4%B4%E5%91%BD%E4%BB%A4%E5%BF%AB%E6%8D%B7%E9%94%AE%E8%AE%BE%E7%BD%AE\" >ubuntu \u4e0b terminal \u590d\u5236\/\u7c98\u8d34\u547d\u4ee4\u5feb\u6377\u952e\u8bbe\u7f6e<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-143\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#ssh_%E9%85%8D%E7%BD%AE%E5%85%8D%E5%AF%86%E7%A0%81%E8%BF%9C%E7%A8%8B%E7%99%BB%E9%99%86\" >ssh \u914d\u7f6e\u514d\u5bc6\u7801\u8fdc\u7a0b\u767b\u9646<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-144\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#ssh_%E4%BF%9D%E6%8C%81%E8%BF%9E%E6%8E%A5\" >ssh \u4fdd\u6301\u8fde\u63a5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-145\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#mac_%E4%B8%AD%E5%91%BD%E4%BB%A4%E8%A1%8C%E8%B0%83%E7%94%A8%E8%B5%B7_vscode_%E6%89%93%E5%BC%80%E7%9B%AE%E5%BD%95%E6%96%87%E4%BB%B6\" >mac \u4e2d\u547d\u4ee4\u884c\u8c03\u7528\u8d77 vscode \u6253\u5f00\u76ee\u5f55\/\u6587\u4ef6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-146\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1\" >\u5f00\u673a\u542f\u52a8\u670d\u52a1<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-147\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BD%BF%E7%94%A8_nginx_%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86%E6%9C%AC%E5%9C%B0%E7%AB%AF%E5%8F%A3\" >\u4f7f\u7528 nginx \u53cd\u5411\u4ee3\u7406\u672c\u5730\u7aef\u53e3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-148\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%9C%A8%E5%91%BD%E4%BB%A4%E8%A1%8C%E4%B8%AD%E8%B0%83%E7%94%A8_sublime_text_%E7%BC%96%E8%BE%91%E6%96%87%E6%9C%AC\" >\u5728\u547d\u4ee4\u884c\u4e2d\u8c03\u7528 sublime text \u7f16\u8f91\u6587\u672c<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-149\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E9%9A%90%E8%97%8F%E8%BA%AB%E4%BB%BD\" >\u9690\u85cf\u8eab\u4efd<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-150\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#troubleshooting\" >troubleshooting<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-151\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%AD%97%E7%AC%A6%E7%BC%96%E7%A0%81%E9%97%AE%E9%A2%98\" >\u5b57\u7b26\u7f16\u7801\u95ee\u9898<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-152\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#ssh_connection_refused\" >ssh connection refused<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-153\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#vi_%E7%BC%96%E8%BE%91%EF%BC%8C%E4%B8%8A%E4%B8%8B%E5%B7%A6%E5%8F%B3%E7%AE%AD%E5%A4%B4%E5%8F%98%E6%88%90_ABCDdelete_%E9%94%AE%E6%97%A0%E6%B3%95%E5%88%A0%E9%99%A4%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95\" >vi \u7f16\u8f91\uff0c\u4e0a\u4e0b\u5de6\u53f3\u7bad\u5934\u53d8\u6210 ABCD\/delete \u952e\u65e0\u6cd5\u5220\u9664\u89e3\u51b3\u529e\u6cd5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-154\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%85%B3%E9%97%AD_ubuntu_%E5%9B%BE%E5%BD%A2%E7%95%8C%E9%9D%A2\" >\u5173\u95ed ubuntu \u56fe\u5f62\u754c\u9762<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-155\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%85%B3%E9%97%AD_centos_%E5%9B%BE%E5%BD%A2%E7%95%8C%E9%9D%A2\" >\u5173\u95ed centos \u56fe\u5f62\u754c\u9762<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-156\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E6%98%BE%E7%A4%BA%E5%BD%93%E5%89%8D%E4%B8%BB%E6%9C%BA%E7%9A%84%E4%BF%A1%E6%81%AF\" >\u663e\u793a\u5f53\u524d\u4e3b\u673a\u7684\u4fe1\u606f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-157\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E4%BF%AE%E6%94%B9_hostname\" >\u4fee\u6539 hostname<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-158\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%B0%86%E8%BF%9C%E7%A8%8B%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E6%96%87%E4%BB%B6%E5%A4%8D%E5%88%B6%E5%88%B0%E6%9C%AC%E5%9C%B0%E5%89%AA%E8%B4%B4%E6%9D%BF\" >\u5c06\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u6587\u4ef6\u590d\u5236\u5230\u672c\u5730\u526a\u8d34\u677f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-159\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#%E5%8D%87%E7%BA%A7_vim\" >\u5347\u7ea7 vim<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-160\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#spacevim_%E5%AD%97%E4%BD%93%E9%97%AE%E9%A2%98\" >spacevim \u5b57\u4f53\u95ee\u9898<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-161\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#man_cant_set_the_locale_make_sure_LC_and_LANG_are_correct\" >man: can&#8217;t set the locale; make sure $LC&#95;&#42; and $LANG are correct<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-162\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#reference\" >reference<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-163\" href=\"https:\/\/liushiming.cn\/article\/linux-cookbook.html\/#bash_reference\" >bash reference<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B_linux_%E7%89%88%E6%9C%AC\"><\/span>\u67e5\u770b linux \u7248\u672c<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u65b9\u6cd5\u4e00<\/p>\n<pre><code class=\"language-zsh \">$ cat \/etc\/issue\nDebian GNU\/Linux 9 \\n \\l\n<\/code><\/pre>\n<p>\u65b9\u6cd5\u4e8c<\/p>\n<pre><code class=\"language-zsh \">$cat \/etc\/issue.net\nDebian GNU\/Linux 9\n<\/code><\/pre>\n<p>\u65b9\u6cd5\u4e09<\/p>\n<pre><code class=\"language-zsh \">$ uname -a\nLinux 1de774242804 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 GNU\/Linux\n<\/code><\/pre>\n<p>\u65b9\u6cd5\u56db<\/p>\n<pre><code class=\"language-zsh \">$ cat \/proc\/version\nLinux version 4.9.125-linuxkit (root@659b6d51c354) (gcc version 6.4.0 (Alpine 6.4.0) ) #1 SMP Fri Sep 7 08:20:28 UTC 2018\n<\/code><\/pre>\n<p>\u65b9\u6cd5\u4e94(Mac \u548c Ubuntu\/centos \u6d4b\u8bd5\u53ef\u884c)<\/p>\n<pre><code class=\"language-zsh \">$ echo $OSTYPE\ndarwin18.0\n\n$ echo $OSTYPE\nlinux-gnu\n\n$ echo $OSTYPE\nlinux-gnu\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E4%BD%BF%E7%94%A8%E7%9A%84_shell\"><\/span>\u67e5\u770b\u4f7f\u7528\u7684 shell<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u65b9\u6cd5\u4e00\uff1a\u67e5\u770b\\$SHELL \u73af\u5883\u53d8\u91cf<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  ~ echo $SHELL\n\/bin\/zsh\n<\/code><\/pre>\n<p>\u65b9\u6cd5\u4e8c:echo \\$0, \u636e\u8bf4\u4e0d\u662f\u5bf9\u6240\u6709 shell \u90fd\u652f\u6301<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  ~ echo $0\n-zsh\n<\/code><\/pre>\n<p>\u65b9\u6cd5\u4e09\uff1a\u6572\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u547d\u4ee4\uff0c\u67e5\u770b\u63d0\u793a<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  ~ tom\nzsh: command not found: tom\n<\/code><\/pre>\n<p>\u67e5\u770b\u7cfb\u7edf\u652f\u6301\u7684 shell<\/p>\n<pre><code class=\"language-bash \">root@sz \u279c  ~ cat \/etc\/shells\n# \/etc\/shells: valid login shells\n\/bin\/sh\n\/bin\/dash\n\/bin\/bash\n\/bin\/rbash\n\/bin\/zsh\n\/usr\/bin\/zsh\n\/usr\/bin\/tmux\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF\"><\/span>\u67e5\u770b\u7cfb\u7edf\u4fe1\u606f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u4f7f\u7528<code>uname<\/code>\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u7cfb\u7edf\u4fe1\u606f\uff0c\u4e86\u89e3\u7cfb\u7edf\u4fe1\u606f\u5bf9\u5b89\u88c5\u8f6f\u4ef6\u5f88\u6709\u5e2e\u52a9\uff0c\u5b89\u88c5\u8f6f\u4ef6\u65f6\u5fc5\u987b\u77e5\u9053\u662f\u88c5 32 \u4f4d\u8fd8\u662f 64 \u4f4d\uff0c\u662f x86 \u67b6\u6784\u8fd8\u662f i686 \u67b6\u6784\uff0c\u8bf8\u5982\u6b64\u7c7b\u3002<br \/>\nmac \u793a\u4f8b<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  ~ uname -a\nDarwin pro 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2\/RELEASE_X86_64 x86_64\n<\/code><\/pre>\n<p>ubuntu \u793a\u4f8b<\/p>\n<pre><code class=\"language-bash \">root@MNG-BC \u279c  ~ uname -a\nLinux MNG-BC 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU\/Linux\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E7%A1%AC%E4%BB%B6%E4%BF%A1%E6%81%AF\"><\/span>\u67e5\u770b\u786c\u4ef6\u4fe1\u606f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><code>lshw<\/code>\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u786c\u4ef6\u4fe1\u606f<\/p>\n<p><code>lscpu<\/code>\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b cpu \u4fe1\u606f<\/p>\n<pre><code class=\"language-bash \">root@MNG-BC \u279c  ~ lscpu\nArchitecture:          x86_64\nCPU op-mode(s):        32-bit, 64-bit\nByte Order:            Little Endian\nCPU(s):                12\nOn-line CPU(s) list:   0-11\nThread(s) per core:    2\nCore(s) per socket:    6\nSocket(s):             1\nNUMA node(s):          1\nVendor ID:             GenuineIntel\nCPU family:            6\nModel:                 85\nModel name:            Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz\nStepping:              4\nCPU MHz:               2499.998\nBogoMIPS:              4999.99\nHypervisor vendor:     KVM\nVirtualization type:   full\nL1d cache:             32K\nL1i cache:             32K\nL2 cache:              1024K\nL3 cache:              33792K\nNUMA node0 CPU(s):     0-11\nFlags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ibrs ibpb stibp kaiser fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f rdseed adx smap avx512cd xsaveopt xsavec xgetbv1\n<\/code><\/pre>\n<p><code>cat \/proc\/cupinfo<\/code>\u53ef\u4ee5\u67e5\u770b cpu \u4fe1\u606f\uff0c\u6bcf\u4e00\u4e2a\u6838\u5fc3\u90fd\u4f1a\u5217\u51fa\u6765\uff0c\u4ee5<code>core id<\/code>\u533a\u5206<\/p>\n<pre><code class=\"language-bash \">root@MNG-BC \u279c  ~ cat \/proc\/cpuinfo\nprocessor       : 0\nvendor_id       : GenuineIntel\ncpu family      : 6\nmodel           : 85\nmodel name      : Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz\nstepping        : 4\nmicrocode       : 0x1\ncpu MHz         : 2499.998\ncache size      : 33792 KB\nphysical id     : 0\nsiblings        : 12\ncore id         : 0\ncpu cores       : 6\napicid          : 0\ninitial apicid  : 0\nfpu             : yes\nfpu_exception   : yes\ncpuid level     : 13\nwp              : yes\nflags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ibrs ibpb stibp kaiser fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f rdseed adx smap avx512cd xsaveopt xsavec xgetbv1\nbugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf\nbogomips        : 4999.99\nclflush size    : 64\ncache_alignment : 64\naddress sizes   : 46 bits physical, 48 bits virtual\npower management:\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E7%B3%BB%E7%BB%9F%E6%97%B6%E9%97%B4_%E2%80%93_date\"><\/span>\u7cfb\u7edf\u65f6\u95f4 &#8211; date<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-bash \">[shiming@red-hat-enterprise-linux ~]$ date        #\u6253\u5370\u7cfb\u7edf\u65f6\u95f4\n2018\u5e74 07\u6708 25\u65e5 \u661f\u671f\u4e09 19:38:53 CST\n[shiming@red-hat-enterprise-linux ~]$ date +%x    #\u6253\u5370\u65e5\u671f\n2018\u5e7407\u670825\u65e5\n[shiming@red-hat-enterprise-linux ~]$ date --utc  #\u6253\u5370UTCtime\n2018\u5e74 07\u6708 25\u65e5 \u661f\u671f\u4e09 11:55:17 UTC\n[shiming@red-hat-enterprise-linux ~]$ date +%T    #\u6253\u5370hh:mm:ss time\n19:56:57\n[shiming@red-hat-enterprise-linux ~]$ date +%s    #\u6253\u5370unix\u65f6\u95f4\u6233\uff0c\u7cbe\u786e\u5230\u79d2\n1532519829\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%9C%AC%E5%9C%B0%E5%8C%96%E8%AE%BE%E7%BD%AE\"><\/span>\u672c\u5730\u5316\u8bbe\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><code>locale<\/code>\u547d\u4ee4<br \/>\nlocale &#8211; description of multilanguage support<br \/>\nA locale is a set of language and cultural rules.<\/p>\n<p>http:\/\/man7.org\/linux\/man-pages\/man7\/locale.7.html<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E7%B3%BB%E7%BB%9F%E8%AF%AD%E8%A8%80_%E2%80%93_LANG\"><\/span>\u7cfb\u7edf\u8bed\u8a00 &#8211; LANG<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BF%AE%E6%94%B9%E7%B3%BB%E7%BB%9F%E8%AF%AD%E8%A8%80\"><\/span>\u4fee\u6539\u7cfb\u7edf\u8bed\u8a00<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@red-hat-enterprise-linux ~]$ cat \/etc\/locale.conf  #\u67e5\u770blinux\u7cfb\u7edf\u8bed\u8a00\u8bbe\u7f6e\nLANG=en_US.UTF-8                                            #\u4fee\u6539\u8bed\u8a00\u53ea\u9700\u4fee\u6539\u8fd9\u884c\n[shiming@red-hat-enterprise-linux ~]$ echo $LANG            #\u67e5\u770bssh\u8bed\u8a00\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\nzh_CN.UTF-8                   #\u7cfb\u7edf\u4e3a\u82f1\u6587\uff0c\u4f46ssh\u8bbe\u7f6e\u4e3a\u4e2d\u6587\uff0c\u6240\u4ee5\u901a\u8fc7ssh\u8fdc\u7a0b\u8fde\u63a5\u8fd8\u662f\u4f1a\u663e\u793a\u4e2d\u6587\n[shiming@red-hat-enterprise-linux ~]$ LANG=en_US.UTF-8      #\u901a\u8fc7\u7ed9LANG\u8d4b\u503c\u6539\u53d8ssh\u8bed\u8a00\uff08\u8fd9\u6837\u53ea\u662f\u4e34\u65f6\u4fee\u6539\uff0c\u4e0b\u6b21ssh\u767b\u5f55\u65f6\u8fd8\u662f\u4f1a\u663e\u793a\u4e2d\u6587\uff09\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8%E6%9C%AC%E6%9C%BA%E6%88%96%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%AF%AD%E8%A8%80\"><\/span>\u4f7f\u7528\u672c\u673a\u6216\u670d\u52a1\u5668\u8bed\u8a00<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>mac \u4e3a\u4f8b\uff0c\u5728\u672c\u673a\u4e2d vi \/etc\/ssh\/ssh_config,\u5982\u679c\u5e0c\u671b\u5728 ssh \u8fde\u63a5\u4e2d\u4f20\u5165 loacle \u73af\u5883\u53d8\u91cf\uff0c\u5219\u653e\u5f00\u6ce8\u91ca\uff0c\u5426\u5219\u7528#\u53f7\u6ce8\u91ca\u4ee5\u4e0b\u884c\uff08\u4f7f\u7528\u670d\u52a1\u5668\u7684\u7cfb\u7edf\u8bed\u8a00\uff09<\/p>\n<pre><code class=\"language-text \">       SendEnv LANG LC_*\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E4%B8%BB%E6%9C%BA%E5%90%8D_%E2%80%93_hostnamectl\"><\/span>\u4e3b\u673a\u540d &#8211; hostnamectl<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>redhat \u4e2d\u6709\u4e09\u79cd\u4e3b\u673a\u540d\u7c7b\u578b\uff1a&#8211;pretty, &#8211;static, and &#8211;transient\uff0c <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/access.redhat.com\/documentation\/en-us\/red_hat_enterprise_linux\/7\/html\/networking_guide\/sec_configuring_host_names_using_hostnamectl\">\u53c2\u8003 1<\/a> and <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/access.redhat.com\/documentation\/en-us\/red_hat_enterprise_linux\/7\/html\/networking_guide\/ch-configure_host_names\">\u53c2\u8003 2<\/a><\/p>\n<table>\n<thead>\n<tr>\n<th>Hostname Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Static<\/td>\n<td>Assigned by the system admin<\/td>\n<\/tr>\n<tr>\n<td>Transient\/Dynamic<\/td>\n<td>Assigned by DHCP or mDNS server at runtime<\/td>\n<\/tr>\n<tr>\n<td>Pretty<\/td>\n<td>Assigned by the system admin. Its can be used as Description like \u201cOracle DB server\u201d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E5%92%8C%E4%BF%AE%E6%94%B9%E4%B8%BB%E6%9C%BA%E5%90%8D\"><\/span>\u67e5\u770b\u548c\u4fee\u6539\u4e3b\u673a\u540d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@red-hat-enterprise-linux ~]$ hostnamectl          #\u67e5\u770b\u6240\u6709\u4e3b\u673a\u540d\n[shiming@red-hat-enterprise-linux ~]$ hostnamectl set-hostname redhat  #\u4fee\u6539\u4e3b\u673a\u540d\uff08\u4e09\u4e2a\u4e3b\u673a\u540d\u90fd\u6539\u4e3aredhat\uff09\n[shiming@redhat ~]$                              #\u4fee\u6539\u540e\u91cd\u542f\uff0c\u4e3b\u673a\u540d\u53d8\u4e86\n<\/code><\/pre>\n<p>\u6ce8\u610f\uff1a<code>\/etc\/hosts<\/code>\u6587\u4ef6\u4e2d\u6620\u5c04\u7684 hostname \u8981\u81ea\u5df1\u624b\u52a8\u4fee\u6539<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BF%AE%E6%94%B9%E4%B8%BB%E6%9C%BA%E5%90%8D%E4%B8%B4%E6%97%B6%E4%BF%AE%E6%94%B9\"><\/span>\u4fee\u6539\u4e3b\u673a\u540d(\u4e34\u65f6\u4fee\u6539)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@red-hat-enterprise-linux ~]$ hostname            #\u67e5\u770b\u4e3b\u673a\u540d\nred-hat-enterprise-linux.shared\n[shiming@red-hat-enterprise-linux ~]$ hostname redhat     #\u4fee\u6539\u4e3b\u673a\u540d\u4e3aredhat\nhostname: you must be root to change the host name        #\u8981root\u6743\u9650\u624d\u80fd\u4fee\u6539\n[shiming@red-hat-enterprise-linux ~]$ sudo hostname redhat #\u4f7f\u7528\u7ba1\u7406\u5458\u6743\u9650\u4fee\u6539\n[sudo] password for shiming:\n[shiming@red-hat-enterprise-linux ~]$ hostname            #\u67e5\u770b\u4fee\u6539\u540e\u7684\u4e3b\u673a\u540d\nredhat\n                                                          #\u91cd\u542f\u4e3b\u673a\u540d\u4e0d\u53d8\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E5%91%BD%E4%BB%A4%E8%A1%8C%E6%8A%80%E5%B7%A7\"><\/span>\u547d\u4ee4\u884c\u6280\u5de7<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E7%A7%BB%E5%8A%A8\"><\/span>\u79fb\u52a8<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5728\u6572\u51fb\u547d\u4ee4\u884c\u65f6\uff0c\u53ef\u4ee5\u7528\u5230\u4ee5\u4e0b\u5feb\u6377\u952e\u63d0\u9ad8\u6548\u7387<br \/>\nctrl + a \u79fb\u5230\u884c\u9996<br \/>\nctrl + e \u79fb\u5230\u884c\u5c3e<br \/>\nmeta + f \u5411\u524d\u79fb\u4e00\u4e2a word<br \/>\nmtea + b \u5411\u540e\u79fb\u4e00\u4e2a word<br \/>\nCtrl + b \u540e\u79fb\u4e00\u4e2a\u5b57\u7b26<br \/>\nCtrl + f \u524d\u79fb\u4e00\u4e2a\u5b57\u7b26<br \/>\nCtrl + d \u5220\u9664\u5f53\u524d\u5b57\u7b26<br \/>\nBackspace \u5220\u9664\u524d\u4e00\u4e2a\u5b57\u7b26<br \/>\nCtrl + &#8211; \u64a4\u9500<br \/>\nctrl + l \u6e05\u5c4f<\/p>\n<p>mata \u952e\u5728 windows \u5c31\u662f alt \u952e\uff0cmac osx \u7528\u6237\u9700\u8981\u624b\u52a8\u5f00\uff0c\u6839\u636e\u7ea6\u5b9a\uff0cmeta \u952e\u662f\u4e13\u95e8\u7528\u6765\u5904\u7406\u5355\u4e2a\u8bcd\uff08word\uff09\u7684\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%89%AA%E5%88%87%E5%92%8C%E7%B2%98%E8%B4%B4\"><\/span>\u526a\u5207\u548c\u7c98\u8d34<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>ctrl + k \u4ece\u5149\u6807\u526a\u5207\u5230\u884c\u5c3e<br \/>\nctrl + y \u7c98\u8d34<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E6%90%9C%E7%B4%A2%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%8E%86%E5%8F%B2\"><\/span>\u641c\u7d22\u547d\u4ee4\u884c\u5386\u53f2<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>ctrl + r \u6572\u5165\u641c\u7d22\u5173\u952e\u5b57\u641c\u7d22<br \/>\n\u7ee7\u7eed\u6309 ctrl + r \u641c\u7d22\u7ed3\u679c\u5217\u8868<br \/>\nctrl + j \u9009\u5b9a\u5f53\u524d\u547d\u4ee4<br \/>\nctrl + g \u53d6\u6d88\u641c\u7d22<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E6%90%9C%E7%B4%A2%E5%91%BD%E4%BB%A4\"><\/span>\u641c\u7d22\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code>whatis<\/code>\u547d\u4ee4\u4f1a\u7cbe\u786e\u641c\u7d22 whatis \u6570\u636e\u5e93\uff0c\u7ed9\u51fa\u547d\u4ee4\u7684\u7b80\u4ecb<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  ~ whatis cal\ncal(1), ncal(1)          - displays a calendar and the date of Easter\n<\/code><\/pre>\n<p><code>apropos<\/code>\u662f<code>whatis<\/code>\u7684\u6a21\u7cca\u641c\u7d22\u7248\uff0c\u4f1a\u5168\u6587\u6a21\u7cca\u641c\u7d22 whatis \u6570\u636e\u5e93<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  ~ apropos cal\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"sudo_%E8%BF%90%E8%A1%8C%E4%B8%8A%E4%B8%80%E4%B8%AA%E5%91%BD%E4%BB%A4\"><\/span>sudo \u8fd0\u884c\u4e0a\u4e00\u4e2a\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code>!!<\/code>\u662f\u4e0a\u4e00\u4e2a\u547d\u4ee4\u7684\u522b\u540d\uff0c\u6240\u4ee5<code>sudo !!<\/code>\u53ef\u4ee5\u4ee5\u7ba1\u7406\u5458\u6743\u9650\u6267\u884c\u4e0a\u4e00\u4e2a\u547d\u4ee4<\/p>\n<pre><code class=\"language-bash \">sudo !!\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"sudo_%E6%89%A7%E8%A1%8C%E4%B8%80%E4%B8%AA%E9%95%BF%E5%91%BD%E4%BB%A4\"><\/span>sudo \u6267\u884c\u4e00\u4e2a\u957f\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code>sudo<\/code> \u6709\u65f6\u5728\u6267\u884c\u4e00\u4e2a\u957f\u547d\u4ee4\u65f6 <code>sudo cat \/dev\/null &gt; \/var\/log\/dpkg.log<\/code> \u8fd8\u662f\u4f1a\u63d0\u793a\u6743\u9650\u4e0d\u591f\uff0c\u56e0\u4e3a <code>sudo<\/code> \u53ea\u80fd\u8ba9 <code>cat<\/code> \u547d\u4ee4\u4ee5 <code>root<\/code> \u7684\u6743\u9650\u6267\u884c\uff0c\u800c\u5bf9\u4e8e <code>&gt;<\/code> \u8fd9\u4e2a\u7b26\u53f7\u5e76\u6ca1\u6709 <code>root<\/code> \u7684\u6743\u9650\u3002<\/p>\n<p>\u8fd9\u65f6\u8981\u7528 <code>sh -c<\/code> \u5c06\u6574\u4e2a\u957f\u547d\u4ee4\u4e00\u8d77\u6267\u884c\uff0c\u5168\u90e8\u63d0\u5347\u5230 <code>root<\/code> \u6743\u9650\u6267\u884c\u3002<\/p>\n<pre><code class=\"language-bash \">sudo sh -c \"cat \/dev\/null &gt; \/var\/log\/dpkg.log\"\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E7%B1%BB%E5%9E%8B_%E2%80%93_file\"><\/span>\u6587\u4ef6\u7c7b\u578b &#8211; file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Linux \u4e0d\u4ee5\u6587\u4ef6\u540d\u540e\u7f00\u6765\u8bc6\u522b\u6587\u4ef6\u7c7b\u578b\uff0c\u901a\u8fc7 file \u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u6587\u4ef6\u7c7b\u578b\uff0c\u4e00\u822c\u6587\u4ef6\u7c7b\u578b\u5206\u4e3a 3 \u7c7b<\/p>\n<table>\n<thead>\n<tr>\n<th>keyword<\/th>\n<th>description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>text<\/td>\n<td>\u53ef\u8bfb\u6587\u672c<\/td>\n<\/tr>\n<tr>\n<td>executable<\/td>\n<td>\u53ef\u6267\u884c\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>data<\/td>\n<td>\u9664\u6b64\u4e4b\u5916\u7684\u53eb\u505a data\uff0c\u4e00\u822c\u662f\u4e8c\u8fdb\u5236\u7684\u6216\u4e0d\u53ef\u6253\u5370\u7684<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ file \/etc\/passwd\n\/etc\/passwd: ASCII text\n[shiming@redhat ~]$ file \/bin\/passwd\n\/bin\/passwd: setuid ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU\/Linux 2.6.32, BuildID[sha1]=0a16a7915f7f9b01d96442755257e22067ce5b2c, stripped\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E7%BB%9F%E8%AE%A1_%E2%80%93_wc\"><\/span>\u6587\u4ef6\u7edf\u8ba1 &#8211; wc<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>wc for word count, print newline, word, and byte counts for each file<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ wc \/etc\/passwd\n  46  100 2426 \/etc\/passwd                  #\u884c\u6570\uff0cword\u6570\uff0cbyte\u6570\uff0c\u6587\u4ef6\u540d\n[shiming@redhat ~]$ wc -l \/etc\/passwd       #\u53ea\u6253\u5370\u884c\u6570\n46 \/etc\/passwd\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E7%A3%81%E7%9B%98%E4%BD%BF%E7%94%A8%E6%83%85%E5%86%B5\"><\/span>\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><code>df<\/code>\u663e\u793a\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5\uff0c\u9ed8\u8ba4\u5927\u5c0f\u4e3a bytes\uff0c\u52a0\u4e0a<code>-h<\/code>\u53c2\u6570\u4f7f\u7528\u66f4\u9002\u4e8e\u4eba\u7c7b\u9605\u8bfb\u7684\u65b9\u5f0f\u5c55\u793a<\/p>\n<pre><code class=\"language-bash \">root@mix2 \u279c  bitcoin df -h\nFilesystem      Size  Used Avail Use% Mounted on\nudev             16G     0   16G   0% \/dev\ntmpfs           3.2G  4.6M  3.2G   1% \/run\n\/dev\/vda1        99G   45G   49G  48% \/\ntmpfs            16G   40K   16G   1% \/dev\/shm\ntmpfs           5.0M     0  5.0M   0% \/run\/lock\ntmpfs            16G     0   16G   0% \/sys\/fs\/cgroup\n\/dev\/vdc       1008G   63G  895G   7% \/mnt\/ethereum\n\/dev\/vdb       1008G  273G  684G  29% \/mnt\/bitcoin\ntmpfs           3.2G     0  3.2G   0% \/run\/user\/0\ntmpfs           3.2G     0  3.2G   0% \/run\/user\/1002\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E5%A4%A7%E5%B0%8F\"><\/span>\u6587\u4ef6\u5927\u5c0f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><code>du<\/code>\u547d\u4ee4\u67e5\u770b\u6587\u4ef6\u5927\u5c0f, <code>du -h<\/code>, h means human readable,\u9ed8\u8ba4<\/p>\n<pre><code class=\"language-bash \">root@mix2 \u279c  bitcoin du --max-depth=0 -h\n273G    .\nroot@mix2 \u279c  bitcoin du --max-depth=1 -h\n26G .\/testnet3\n26G .\/omni\n223G    .\/mainnet\n273G    .\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E6%89%93%E5%8D%B0\"><\/span>\u6587\u4ef6\u6253\u5370<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E5%BC%80%E5%A4%B4_%E2%80%93_head\"><\/span>\u5f00\u5934 &#8211; head<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u9ed8\u8ba4\u6253\u5370\u5f00\u5934 10 \u884c<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ head \/etc\/passwd        #\u593410\u884c\nroot:x:0:0:root:\/root:\/bin\/bash\nbin:x:1:1:bin:\/bin:\/sbin\/nologin\ndaemon:x:2:2:daemon:\/sbin:\/sbin\/nologin\nadm:x:3:4:adm:\/var\/adm:\/sbin\/nologin\nlp:x:4:7:lp:\/var\/spool\/lpd:\/sbin\/nologin\nsync:x:5:0:sync:\/sbin:\/bin\/sync\nshutdown:x:6:0:shutdown:\/sbin:\/sbin\/shutdown\nhalt:x:7:0:halt:\/sbin:\/sbin\/halt\nmail:x:8:12:mail:\/var\/spool\/mail:\/sbin\/nologin\noperator:x:11:0:operator:\/root:\/sbin\/nologin\n<\/code><\/pre>\n<p>\u53ef\u6307\u5b9a\u6253\u5370\u884c\u6570 &#8211; head -n [linenum]<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ head -n 5 \/etc\/passwd    #\u59345\u884c\nroot:x:0:0:root:\/root:\/bin\/bash\nbin:x:1:1:bin:\/bin:\/sbin\/nologin\ndaemon:x:2:2:daemon:\/sbin:\/sbin\/nologin\nadm:x:3:4:adm:\/var\/adm:\/sbin\/nologin\nlp:x:4:7:lp:\/var\/spool\/lpd:\/sbin\/nologin\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9C%AB%E5%B0%BE_%E2%80%93_tail\"><\/span>\u672b\u5c3e &#8211; tail<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u9ed8\u8ba4\u6253\u5370\u672b\u5c3e 10 \u884c<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ tail \/etc\/passwd\nnfsnobody:x:65534:65534:Anonymous NFS User:\/var\/lib\/nfs:\/sbin\/nologin\npcp:x:990:985:Performance Co-Pilot:\/var\/lib\/pcp:\/sbin\/nologin\ngnome-initial-setup:x:989:984::\/run\/gnome-initial-setup\/:\/sbin\/nologin\nnslcd:x:65:55:LDAP Client User:\/:\/sbin\/nologin\navahi:x:70:70:Avahi mDNS\/DNS-SD Stack:\/var\/run\/avahi-daemon:\/sbin\/nologin\npostfix:x:89:89::\/var\/spool\/postfix:\/sbin\/nologin\nsshd:x:74:74:Privilege-separated SSH:\/var\/empty\/sshd:\/sbin\/nologin\noprofile:x:16:16:Special user account to be used by OProfile:\/var\/lib\/oprofile:\/sbin\/nologin\ntcpdump:x:72:72::\/:\/sbin\/nologin\nshiming:x:1000:1000:Shiming Liu:\/home\/shiming:\/bin\/bash\n<\/code><\/pre>\n<p>\u6307\u5b9a\u6253\u5370\u884c\u6570 &#8211; tail -n [linenum]<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ tail -n 5 \/etc\/passwd\npostfix:x:89:89::\/var\/spool\/postfix:\/sbin\/nologin\nsshd:x:74:74:Privilege-separated SSH:\/var\/empty\/sshd:\/sbin\/nologin\noprofile:x:16:16:Special user account to be used by OProfile:\/var\/lib\/oprofile:\/sbin\/nologin\ntcpdump:x:72:72::\/:\/sbin\/nologin\nshiming:x:1000:1000:Shiming Liu:\/home\/shiming:\/bin\/bash\n<\/code><\/pre>\n<p>\u6253\u5370\u6574\u4e2a\u6587\u4ef6\u5185\u5bb9 &#8211; cat [filename]<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ tail \/etc\/passwd\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E7%AE%A1%E7%90%86\"><\/span>\u6587\u4ef6\u7ba1\u7406<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"linux_%E6%96%87%E4%BB%B6%E7%BB%93%E6%9E%84\"><\/span>linux \u6587\u4ef6\u7ed3\u6784<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><strong><em>man \u81ea\u5e26\u5e2e\u52a9\u9875\uff1a<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.systutorials.com\/docs\/linux\/man\/7-hier\/\">man hier<\/a><\/em><\/strong><br \/>\n<img decoding=\"async\" src=\"https:\/\/box.kancloud.cn\/f075453374d52e3ae00def2b6c7a3a41_1182x648.png\" alt=\"\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E7%BB%93%E6%9E%84%E6%A0%87%E5%87%86\"><\/span>\u6587\u4ef6\u7ed3\u6784\u6807\u51c6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Filesystem Hierarchy Standard<br \/>\n<a class=\"wp-editor-md-post-content-link\" href=\"http:\/\/www.pathname.com\/fhs\/pub\/fhs-2.3.pdf\">fhs-2.3.pdf<\/a><br \/>\nhttp:\/\/www.pathname.com\/fhs\/<\/p>\n<table>\n<thead>\n<tr>\n<th>\u4f4d\u7f6e<\/th>\n<th>\u7528\u9014<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\/usr<\/td>\n<td>\u5b89\u88c5\u8f6f\u4ef6\u3001\u5171\u4eab\u7684\u5e93\uff0c\u5305\u62ec\u6587\u4ef6\u548c\u9759\u6001\u53ea\u8bfb\u7a0b\u5e8f\u6570\u636e\u3002\u91cd\u8981\u7684\u5b50\u76ee\u5f55\u6709\uff1a<\/br> -\/usr\/bin\uff1a\u7528\u6237\u547d\u4ee4\u3002<\/br> -\/usr\/sbin\uff1a\u7cfb\u7edf\u7ba1\u7406\u547d\u4ee4\u3002<\/br> -\/usr\/local\uff1a\u672c\u5730\u81ea\u5b9a\u4e49\u8f6f\u4ef6\u3002<\/td>\n<\/tr>\n<tr>\n<td>\/etc<\/td>\n<td>\u7279\u5b9a\u4e8e\u6b64\u7cfb\u7edf\u7684\u914d\u7f6e\u6587\u4ef6, \u9759\u6001\u7684\u6c38\u4e45\u7cfb\u7edf\u914d\u7f6e\u6570\u636e\u3002<\/td>\n<\/tr>\n<tr>\n<td>\/var<\/td>\n<td>\u7279\u5b9a\u4e8e\u6b64\u7cfb\u7edf\u7684\u53ef\u53d8\u6570\u636e\uff0c\u5728\u7cfb\u7edf\u542f\u52a8\u4e4b\u95f4\u4fdd\u6301\u6c38\u4e45\u6027\u3002\u52a8\u6001\u53d8\u5316\u7684\u6587\u4ef6\uff08\u5982\u6570\u636e\u5e93\u3001\u7f13\u5b58\u76ee\u5f55\u3001\u65e5\u5fd7\u6587\u4ef6\u3001\u6253\u5370\u673a\u540e\u53f0\u5904\u7406\u6587\u6863\u5185\u5bb9\u548c\u7f51\u7ad9\u5185\u5bb9\uff09\u53ef\u4ee5\u5728 \/var \u4e0b\u627e\u5230\u3002<\/td>\n<\/tr>\n<tr>\n<td>\/run<\/td>\n<td>\u5305\u542b\u52a8\u6001\u7684\u3001\u975e\u6c38\u4e45\u7684\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u65f6\u6570\u636e,\u81ea\u4e0a\u4e00\u6b21\u7cfb\u7edf\u542f\u52a8\u4ee5\u6765\u542f\u52a8\u7684\u8fdb\u7a0b\u7684\u8fd0\u884c\u65f6\u6570\u636e\u3002\u8fd9\u5305\u62ec\u8fdb\u7a0b ID \u6587\u4ef6\u548c\u9501\u5b9a\u6587\u4ef6\uff0c\u7b49\u7b49\u3002\u6b64\u76ee\u5f55\u4e2d\u7684\u5185\u5bb9\u5728\u91cd\u542f\u65f6\u91cd\u65b0\u521b\u5efa\u3002\uff08\u6b64\u76ee\u5f55\u6574\u5408\u4e86\u65e7\u7248 Red Hat Enterprise Linux \u4e2d\u7684 \/var\/run \u548c \/var\/lock\u3002\uff09<\/td>\n<\/tr>\n<tr>\n<td>\/home<\/td>\n<td>\u666e\u901a\u7528\u6237\u4e3b\u76ee\u5f55\u3002<\/td>\n<\/tr>\n<tr>\n<td>\/root<\/td>\n<td>root \u4e3b\u76ee\u5f55\u3002<\/td>\n<\/tr>\n<tr>\n<td>\/tmp<\/td>\n<td>\u4e34\u65f6\u6587\u4ef6\u76ee\u5f55\u300210 \u5929\u5185\u672a\u8bbf\u95ee\u3001\u672a\u66f4\u6539\u6216\u672a\u4fee\u6539\u7684\u6587\u4ef6\u5c06\u81ea\u52a8\u4ece\u8be5\u76ee\u5f55\u4e2d\u5220\u9664\u3002\u8fd8\u6709\u4e00\u4e2a\u4e34\u65f6\u76ee\u5f55 \/var\/tmp\uff0c\u8be5\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u5982\u679c\u5728 30 \u5929\u5185\u672a\u66fe\u8bbf\u95ee\u3001\u66f4\u6539\u6216\u4fee\u6539\u8fc7\uff0c\u5c06\u81ea\u52a8\u5220\u9664\u3002<\/td>\n<\/tr>\n<tr>\n<td>\/boot<\/td>\n<td>\u5f00\u673a\u542f\u52a8\u8fc7\u7a0b\u4e2d\u6240\u9700\u7684\u6587\u4ef6\u3002<\/td>\n<\/tr>\n<tr>\n<td>\/dev<\/td>\n<td>\u5305\u542b\u7279\u6b8a\u7684\u8bbe\u5907\u6587\u4ef6\uff0c\u4f9b\u7cfb\u7edf\u4f7f\u7528\u7684\u7269\u7406\u786c\u4ef6\u3002<\/td>\n<\/tr>\n<tr>\n<td>\/media<\/td>\n<td>\u53ef\u79fb\u9664\u7684\u8bbe\u5907\u6302\u8f7d\u70b9\uff0c\u5982 cd\u3001vcd\u3001U \u76d8<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin<\/td>\n<td>\u666e\u901a\u7528\u6237\u547d\u4ee4\u548c\u5b9e\u7528\u7a0b\u5e8f<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/sbin\/<\/td>\n<td>\u4f9b root \u7528\u6237\u4f7f\u7528\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E6%89%93%E5%8D%B0%E5%BD%93%E5%89%8D%E5%B7%A5%E4%BD%9C%E7%9B%AE%E5%BD%95\"><\/span>\u6253\u5370\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat tmp]$ pwd\n\/tmp\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%96%B0%E5%BB%BA%E7%9B%AE%E5%BD%95_%E2%80%93_mkdir\"><\/span>\u65b0\u5efa\u76ee\u5f55 &#8211; mkdir<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5e38\u7528\u53c2\u6570<br \/>\n<img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/huahuayu\/img\/master\/20190423222908.png\" alt=\"\" \/><\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ mkdir tmp\n[shiming@redhat ~]$ ls\nDesktop  Documents  Downloads  Music  Pictures  Public  Templates  tmp  Videos\n<\/code><\/pre>\n<p>\u9012\u5f52\u521b\u5efa\u76ee\u5f55<\/p>\n<pre><code class=\"language-bash \">mkdir -p \/dir\/not\/exist  # \u5982\u679c\/dir\u6216\u8005\/dir\/not\u4e0d\u5b58\u5728\u5219\u90fd\u4f1a\u88ab\u521b\u5efa\n<\/code><\/pre>\n<p>\u521b\u5efa\u5e26\u6743\u9650\u7684\u76ee\u5f55<\/p>\n<pre><code class=\"language-bash \">mkdir -m 744 \/dir   # \/dir\u7684\u6743\u9650\u4f1a\u88ab\u65b0\u5efa\u4e3a744\n<\/code><\/pre>\n<p>\u4e00\u6b21\u6027\u521b\u5efa\u591a\u4e2a\u76ee\u5f55<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  \/tmp mkdir -p dir1\/{dir2\/,dir3\/{dir3.1,dir3.2}}\nshiming@pro \u279c  \/tmp tree dir1\ndir1\n\u251c\u2500\u2500 dir2\n\u2514\u2500\u2500 dir3\n    \u251c\u2500\u2500 dir3.1\n    \u2514\u2500\u2500 dir3.2\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E5%88%97%E8%A1%A8_%E2%80%93_ls\"><\/span>\u6587\u4ef6\u5217\u8868 &#8211; ls<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ ls -l                               #\u957f\u5217\u8868\n[shiming@redhat ~]$ ls -a                               #\u663e\u793a\u5305\u62ec\u9690\u85cf\u6587\u4ef6\n[shiming@redhat ~]$ ls -R                               #\u9012\u5f52\u5217\u8868\uff08\u5305\u542b\u5b50\u6587\u4ef6\u5939\uff09\n[shiming@redhat dir2]$ ls -alR \/tmp\/dir1                #\u53ef\u7ec4\u5408\u4f7f\u7528\n\/tmp\/dir1:\ntotal 12\ndrwxrwxr-x.  3 shiming shiming 4096 Jul 26 22:25 .\ndrwxrwxrwt. 14 root    root    4096 Jul 26 22:26 ..\ndrwxrwxr-x.  2 shiming shiming 4096 Jul 26 22:26 dir2\n\n\/tmp\/dir1\/dir2:\ntotal 8\ndrwxrwxr-x. 2 shiming shiming 4096 Jul 26 22:26 .\ndrwxrwxr-x. 3 shiming shiming 4096 Jul 26 22:25 ..\n-rw-rw-r--. 1 shiming shiming    0 Jul 26 22:26 file1\n-rw-rw-r--. 1 shiming shiming    0 Jul 26 22:26 .file2\n<\/code><\/pre>\n<p>ls \u53ef\u4ee5\u4e00\u6b21\u6027\u5217\u51fa\u51e0\u4e2a\u6587\u4ef6\u5939\u4e2d\u7684\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ ls -l Music Pictures Videos         #\u5217\u51faN\u4e2a\u6587\u4ef6\u5939\nMusic:\ntotal 0\n-rw-rw-r--. 1 shiming shiming 0 Jul 27 23:25 song1.mp3\n-rw-rw-r--. 1 shiming shiming 0 Jul 27 23:25 song2.mp3\n\nPictures:\ntotal 0\n-rw-rw-r--. 1 shiming shiming 0 Jul 27 23:26 snap1.jpg\n-rw-rw-r--. 1 shiming shiming 0 Jul 27 23:26 snap2.jpg\n\nVideos:\ntotal 0\n-rw-rw-r--. 1 shiming shiming 0 Jul 27 23:27 film1.avi\n-rw-rw-r--. 1 shiming shiming 0 Jul 27 23:27 film2.avi\n<\/code><\/pre>\n<p>ls -h \u5217\u51fa\u6587\u4ef6\u5927\u5c0f\u4e3a\u4eba\u773c\u53ef\u8bfb\u7684(B,K,M,G)<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  asset-platform git:(master) ls -alh\ntotal 24\ndrwxr-xr-x@  6 shiming  staff   192B Apr 18 10:50 .\ndrwxr-xr-x@ 22 shiming  staff   704B Apr 16 20:13 ..\n-rw-r--r--@  1 shiming  staff   6.0K Apr 22 20:10 .DS_Store\ndrwxr-xr-x@ 13 shiming  staff   416B Apr 22 20:12 .git\n-rw-r--r--   1 shiming  staff    36B Apr 16 20:13 README.md\ndrwxr-xr-x@  7 shiming  staff   224B Apr 22 20:10 docs\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E5%88%87%E6%8D%A2%E7%9B%AE%E5%BD%95\"><\/span>\u5207\u6362\u76ee\u5f55<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat tmp]$ cd \/\n[shiming@redhat \/]$ cd ~\/tmp\n[shiming@redhat tmp]$ cd -      #\u5207\u5230\u4e0a\u4e00\u4e2a\u5de5\u4f5c\u76ee\u5f55\n\/\n[shiming@redhat \/]$\n[shiming@redhat ~]$ cd ..       #\u5207\u5230\u7236\u76ee\u5f55\n[shiming@redhat home]$ ls\nlost+found  shiming\n[shiming@redhat ~]$ cd ..\/..    #\u4ece\u5f53\u524d\u4f4d\u7f6e\u4e0a\u79fb\u4e24\u4e2a\u7ea7\u522b\n[shiming@redhat \/]$\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6_%E2%80%93_touch\"><\/span>\u65b0\u5efa\u6587\u4ef6 &#8211; touch<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat tmp]$ touch tmp1     #tmp1\u4e0d\u5b58\u5728\u5219\u65b0\u5efa\uff0c\u5b58\u5728\u5219\u5c06\u6587\u4ef6\u7684\u65f6\u95f4\u6233\u66f4\u65b0\u4e3a\u5f53\u524d\u65f6\u95f4\n<\/code><\/pre>\n<p>\u65b0\u5efa\u591a\u4e2a\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat tmp]$ touch file1 file2\n<\/code><\/pre>\n<p>\u4f7f\u7528\u5927\u62ec\u53f7\u65b0\u5efa\u591a\u4e2a\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ touch file{1..5}       #\u5982\u679c\u6587\u4ef6\u540d\u6709\u89c4\u5219\u7684\u8bdd\u53ef\u4ee5\u8fd9\u4e48\u5efa\n[shiming@redhat ~]$ ls -l\n-rw-rw-r--. 1 shiming shiming    0 Jul 28 09:41 file1\n-rw-rw-r--. 1 shiming shiming    0 Jul 28 09:41 file2\n-rw-rw-r--. 1 shiming shiming    0 Jul 28 09:41 file3\n-rw-rw-r--. 1 shiming shiming    0 Jul 28 09:41 file4\n-rw-rw-r--. 1 shiming shiming    0 Jul 28 09:41 file5\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E5%88%A0%E9%99%A4%E6%96%87%E4%BB%B6_%E2%80%93_rm\"><\/span>\u5220\u9664\u6587\u4ef6 &#8211; rm<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5e38\u7528\u9009\u9879<br \/>\n<img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/huahuayu\/img\/master\/20190423223101.png\" alt=\"\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E7%A7%BB%E5%8A%A8%E6%96%87%E4%BB%B6_%E2%80%93_mv\"><\/span>\u79fb\u52a8\u6587\u4ef6 &#8211; mv<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5e38\u7528\u9009\u9879<br \/>\n<img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/huahuayu\/img\/master\/20190423223235.png\" alt=\"\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E7%AE%A1%E7%90%86%E5%91%BD%E4%BB%A4\"><\/span>\u6587\u4ef6\u7ba1\u7406\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>\u6587\u4ef6\u7ba1\u7406\u547d\u4ee4<\/th>\n<th>\u5355\u4e00\u6765\u6e90<\/th>\n<th>\u591a\u6765\u6e90<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u590d\u5236\u6587\u4ef6<\/td>\n<td>cp file1 file2<\/td>\n<td>cp file1 file2 file3 dir\u2463<\/td>\n<\/tr>\n<tr>\n<td>\u590d\u5236\u6587\u4ef6(\u76ee\u6807\u6587\u4ef6\u5939\u4e0d\u5b58\u5728)<\/td>\n<td>mkdir -p ~\/.litecoin &amp;&amp; cp bitcoin.conf litecin.conf<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u79fb\u52a8\u6587\u4ef6<\/td>\n<td>mv file1 file2\u2460<\/td>\n<td>mv file1 file2 file3 dir\u2463<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u6587\u4ef6<\/td>\n<td>rm file1<\/td>\n<td>rm -f file1 file2 file3\u2464<\/td>\n<\/tr>\n<tr>\n<td>\u521b\u5efa\u76ee\u5f55<\/td>\n<td>mkdir dir<\/td>\n<td>mkdir -p part1\/part2\/dir\u2465<\/td>\n<\/tr>\n<tr>\n<td>\u590d\u5236\u76ee\u5f55<\/td>\n<td>cp -r dir1 dir2\u2461<\/td>\n<td>cp -r dir1 dir2 dir3 dir4\u2463<\/td>\n<\/tr>\n<tr>\n<td>\u79fb\u52a8\u76ee\u5f55<\/td>\n<td>mv dir1 dir2\u2462<\/td>\n<td>mv dir1 dir2 dir3 dir4\u2463<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u76ee\u5f55<\/td>\n<td>rm -r dir1\u2461<\/td>\n<td>rm -rf dir1 dir2 dir3\u2464<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#42;\u6ce8\uff1a<br \/>\n\u2460 \u7ed3\u679c\u4e3a\u91cd\u547d\u540d\u3002<br \/>\n\u2461 \u9700\u8981\u4f7f\u7528\u201c\u9012\u5f52\u201d\u9009\u9879\u6765\u5904\u7406\u6765\u6e90\u76ee\u5f55\u3002<br \/>\n\u2462 \u5982\u679c dir2 \u5b58\u5728\uff0c\u5219\u7ed3\u679c\u4e3a\u79fb\u52a8\u3002\u5982\u679c dir2 \u4e0d\u5b58\u5728\uff0c\u5219\u7ed3\u679c\u4e3a\u91cd\u547d\u540d\u3002<br \/>\n\u2463 \u6700\u540e\u4e00\u4e2a\u53c2\u6570\u5fc5\u987b\u662f\u76ee\u5f55\u3002<br \/>\n\u2464 \u8bf7\u8c28\u614e\u4f7f\u7528\u201cforce\u201d\u9009\u9879\uff0c\u7cfb\u7edf\u5c06\u4e0d\u4f1a\u63d0\u793a\u60a8\u786e\u8ba4\u64cd\u4f5c\u3002<br \/>\n\u2465<strong>\u4f7f\u7528\u201c\u521b\u5efa\u7236\u7ea7\u201d\u9009\u9879\u65f6\u5e94\u5c0f\u5fc3\uff1b\u65e0\u6cd5\u6355\u83b7\u952e\u5165\u9519\u8bef\u3002<\/strong><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E8%BD%AF%E9%93%BE%E6%8E%A5\"><\/span>\u6587\u4ef6\u8f6f\u94fe\u63a5<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">~\/.oh-my-zsh\/themes\/\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BF%AE%E6%94%B9%E6%96%87%E4%BB%B6%E6%89%80%E6%9C%89%E8%80%85\"><\/span>\u4fee\u6539\u6587\u4ef6\u6240\u6709\u8005<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">chown newowner file   # \u4fee\u6539file\u7684owner\u4e3anewowner\nchgrp newgroup file   # \u4fee\u6539file\u7684group\u4e3anewowner\nchown newowner.newgroup file  # \u540c\u65f6\u4fee\u6539file\u7684owner\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BF%AE%E6%94%B9%E6%96%87%E4%BB%B6%E6%9D%83%E9%99%90\"><\/span>\u4fee\u6539\u6587\u4ef6\u6743\u9650<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">chmod +x file\nchmod -x file\nchmod u+x file\nchmod\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E7%A1%AC%E7%9B%98%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%92%8C%E6%8C%82%E8%BD%BD\"><\/span>\u786c\u76d8\u683c\u5f0f\u5316\u548c\u6302\u8f7d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>https:\/\/help.aliyun.com\/document_detail\/25426.html<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E8%BF%9C%E7%A8%8B%E6%96%87%E4%BB%B6%E4%BC%A0%E8%BE%93\"><\/span>\u8fdc\u7a0b\u6587\u4ef6\u4f20\u8f93<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5728\u672c\u5730 terminal \u4e0b\u6267\u884c scp \u547d\u4ee4<\/p>\n<ol>\n<li>\u5c06\u672c\u5730\u6587\u4ef6\u590d\u5236\u5230\u8fdc\u7a0b<\/li>\n<\/ol>\n<pre><code class=\"language-bash \"># \u5c06\u672c\u5730\u6587\u4ef6file1.txt\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u5bb6\u76ee\u5f55\u4e0b\n$ scp -P &lt;sshport&gt; file1.txt root@47.52.241.187:~\n<\/code><\/pre>\n<ol start=\"2\">\n<li>\u5c06\u672c\u5730\u6587\u4ef6\u5939\u590d\u5236\u5230\u8fdc\u7a0b(-r \u9009\u9879)<\/li>\n<\/ol>\n<pre><code class=\"language-bash \"># \u5c06\u672c\u5730\u6587\u4ef6\u5939dir1\u590d\u5236\u5230\u8fdc\u7a0b\u5bb6\u76ee\u5f55\n$ scp -P &lt;sshport&gt; -r dir1 root@47.52.241.187:~\n<\/code><\/pre>\n<ol start=\"3\">\n<li>\u5c06\u8fdc\u7a0b\u6587\u4ef6\u590d\u5236\u5230\u672c\u5730<\/li>\n<\/ol>\n<pre><code class=\"language-bash \"># \u5c06\u8fdc\u7a0b\u6587\u4ef6file2.txt \u590d\u5236\u5230\u672c\u5730\u5de5\u4f5c\u76ee\u5f55\n$ scp -P &lt;sshport&gt; root@47.52.241.187:~\/file2.txt .\n<\/code><\/pre>\n<ol start=\"4\">\n<li>\u5c06\u8fdc\u7a0b\u6587\u4ef6\u5939\u590d\u5236\u5230\u672c\u5730<\/li>\n<\/ol>\n<pre><code class=\"language-bash \"># \u5c06\u8fdc\u7a0b\u76ee\u5f55dir1\u590d\u5236\u5230\u672c\u5730\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\n$ scp -P &lt;sshport&gt; -r root@47.52.241.187:~\/dir1 .\n<\/code><\/pre>\n<ol start=\"5\">\n<li>\u5c06\u591a\u4e2a\u672c\u5730\u6587\u4ef6\u590d\u5236\u5230\u8fdc\u7a0b<\/li>\n<\/ol>\n<pre><code class=\"language-bash \">$ scp -P &lt;sshport&gt; file4 file5 root@47.52.241.187:~\n# \u53ea\u8981\u8f93\u4e00\u6b21\u5bc6\u7801\nEnter passphrase for key '\/Users\/Shiming\/.ssh\/id_rsa':\nfile4                                         100%    0     0.0KB\/s   00:00\nfile5                                         100%    0     0.0KB\/s   00:00\n<\/code><\/pre>\n<ol start=\"6\">\n<li>\u5c06\u591a\u4e2a\u8fdc\u7a0b\u6587\u4ef6\u590d\u5236\u5230\u672c\u5730<\/li>\n<\/ol>\n<pre><code class=\"language-bash \"># \u51e0\u4e2a\u6587\u4ef6\u5c31\u8f93\u51e0\u6b21\u5bc6\u7801\nShimings-Air:~ Shiming$ scp -P &lt;sshport&gt; root@47.52.241.187:~\/{file1.txt,file2.txt} .\nEnter passphrase for key '\/Users\/Shiming\/.ssh\/id_rsa':\nfile1.txt                                     100%   26     0.3KB\/s   00:00\nEnter passphrase for key '\/Users\/Shiming\/.ssh\/id_rsa':\nfile2.txt                                     100%   26     0.3KB\/s   00:00\n<\/code><\/pre>\n<h4>rsync vs scp<\/h4>\n<p>scp \u548c rsync \u90fd\u662f\u57fa\u4e8e ssh \u7684\u6587\u4ef6\u4f20\u8f93\u5de5\u5177\uff0crsync \u4f20\u8f93\u901f\u5ea6\u66f4\u5feb\uff0c\u4f46\u662f rsync \u9700\u8981\u5728\u672c\u5730\u548c\u8fdc\u7a0b\u90fd\u5b89\u88c5\uff0c\u800c scp \u4e00\u822c\u90fd\u539f\u751f\u652f\u6301\u3002<\/p>\n<p>\u8fdc\u7a0b\u5230\u672c\u5730<\/p>\n<pre><code class=\"language-bash \">rsync -avW -e 'ssh -p 22' user@remote-server:\/path\/on\/remote \/path\/on\/local\nscp -P 22 user@remote-server:\/path\/on\/remote \/path\/on\/local\n<\/code><\/pre>\n<p>\u672c\u5730\u5230\u8fdc\u7a0b<\/p>\n<pre><code class=\"language-bash \">rsync -avW -e 'ssh -p 22' \/path\/to\/local\/file user@remote-server:\/path\/on\/remote\nscp -P 22 \/path\/to\/local\/file user@remote-server:\/path\/on\/remote\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86\"><\/span>\u7528\u6237\u7ba1\u7406<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E6%B7%BB%E5%8A%A0%E7%94%A8%E6%88%B7\"><\/span>\u6dfb\u52a0\u7528\u6237<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u4f7f\u7528<code>useradd<\/code>\u547d\u4ee4\u65b0\u589e\u7528\u6237\uff0c\u7528\u6237\u521d\u59cb\u72b6\u6001\u662f lock \u7684\uff0c\u9700\u8981\u53e6\u5916\u4f7f\u7528<code>passwd username<\/code>\u6765\u624b\u52a8\u8bbe\u7f6e\u7528\u6237\u5bc6\u7801\uff0c\u800c\u4e14\u7528\u6237\u5bb6\u76ee\u5f55\u4e0d\u4f1a\u9ed8\u8ba4\u521b\u5efa\uff0c\u9664\u975e\u7528<code>-m<\/code>\u6216<code>-d<\/code>\u6307\u5b9a\u5bb6\u76ee\u5f55\u3002<\/p>\n<pre><code class=\"language-bash \"># \u65b0\u589e\u7528\u6237\n$ useradd shiming\n# \u4fee\u6539\u7528\u6237\u5bc6\u7801\n$ passwd shiming\nEnter new UNIX password:\nRetype new UNIX password:\npasswd: password updated successfully\n# \u5207\u6362\u7528\u6237\u5bb6\u76ee\u5f55(\u6b64\u65f6\u5bb6\u76ee\u5f55\u4e0d\u5b58\u5728)\n$ su - shiming\nNo directory, logging in with HOME=\/\n# \u4f7f\u7528\u7ba1\u7406\u5458\u8d26\u6237\u4e3a\u65b0\u7528\u6237\u5efa\u7acb\u5bb6\u76ee\u5f55\n$ su - root\n$ sudo mkdir \/home\/shiming\n$ sudo chown shiming:shiming \/home\/shiming\n<\/code><\/pre>\n<pre><code class=\"language-bash \"># \u65b0\u589e\u7528\u6237alice\uff0c\u81ea\u52a8\u751f\u6210\u5bb6\u76ee\u5f55\uff0c\u6307\u5b9a\u9ed8\u8ba4shell\u4e3abash\nuseradd -m alice -s \/bin\/bash\n<\/code><\/pre>\n<p>\u603b\u7684\u6765\u8bf4<code>useradd<\/code>\u662f\u4e00\u4e2a lowlevel \u7684\u65b0\u589e\u7528\u6237\u64cd\u4f5c\uff0c\u5efa\u8bae\u4f7f\u7528<code>adduser<\/code>\u6765\u65b0\u589e\u7528\u6237\uff0c\u4f1a\u6709\u4ea4\u4e92\u5f0f\u7684\u547d\u4ee4\u884c\u4e00\u6b21\u6027\u8bbe\u7f6e\u597d\u7528\u6237\u7684\u5c5e\u6027\u3002<\/p>\n<pre><code class=\"language-bash \">$ adduser alice\n<\/code><\/pre>\n<p>\u53c2\u8003\u8d44\u6599\uff1ahttps:\/\/www.tecmint.com\/add-users-in-linux\/<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BF%AE%E6%94%B9%E7%94%A8%E6%88%B7\"><\/span>\u4fee\u6539\u7528\u6237<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u53c2\u8003\u8d44\u6599\uff1ahttps:\/\/www.tecmint.com\/usermod-command-examples\/<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A0%81_%E2%80%93_passwd\"><\/span>\u4fee\u6539\u5bc6\u7801 &#8211; passwd<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@red-hat-enterprise-linux ~]$ passwd      #\u4fee\u6539\u5f53\u524d\u7528\u6237\u5bc6\u7801\n\u66f4\u6539\u7528\u6237 shiming \u7684\u5bc6\u7801 \u3002\n\u4e3a shiming \u66f4\u6539 STRESS \u5bc6\u7801\u3002\n\uff08\u5f53\u524d\uff09UNIX \u5bc6\u7801\uff1a\n\u65b0\u7684 \u5bc6\u7801\uff1a\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E5%88%87%E6%8D%A2%E7%94%A8%E6%88%B7\"><\/span>\u5207\u6362\u7528\u6237<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code>su<\/code> \u5207\u6362\u5230 root \u7528\u6237<br \/>\n<code>su anotheruser<\/code> \u5c06\u5f53\u524d\u7528\u6237\u7684\u73af\u5883\u53d8\u91cf\u5e26\u5230\u65b0\u7528\u6237\u4e0b<br \/>\n<code>su - anotheruser<\/code> \u4f7f\u7528\u65b0\u7528\u6237\u7684\u73af\u5883\u53d8\u91cf<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E9%94%81%E4%BD%8F%E7%94%A8%E6%88%B7\"><\/span>\u9501\u4f4f\u7528\u6237<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">root@tool1:~# passwd -l bot  #-l means lock, lock\u540e\u4ecd\u53ef\u4ee5\u4f7f\u7528su - username\u5207\u6362\u7528\u6237\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E5%88%A0%E9%99%A4%E7%94%A8%E6%88%B7%EF%BC%88%E8%BF%9E%E5%90%8C%E7%94%A8%E6%88%B7_home_%E7%9B%AE%E5%BD%95%EF%BC%89\"><\/span>\u5220\u9664\u7528\u6237\uff08\u8fde\u540c\u7528\u6237 home \u76ee\u5f55\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">deluser --remove-home tecmint      [On Debian and its derivatives]\nuserdel --remove tecmint           [On RedHat\/CentOS based systems]\n<\/code><\/pre>\n<p>\u5982\u679c\u8981\u66f4\u4e25\u8c28\u7684\u5220\u9664\u7528\u6237\u53ef\u4ee5\u53c2\u8003 https:\/\/www.tecmint.com\/delete-remove-a-user-account-with-home-directory-in-linux\/<\/p>\n<ol>\n<li>\u9501\u4f4f\u8d26\u53f7\uff0c\u8fd9\u6837\u5c31\u65e0\u6cd5\u767b\u9646<\/li>\n<li>\u67e5\u770b\u7528\u6237\u8fdb\u7a0b<\/li>\n<li>\u6740\u6b7b\u7528\u6237\u8fdb\u7a0b<\/li>\n<li>\u5907\u4efd\u7528\u6237\u5bb6\u76ee\u5f55<\/li>\n<li>\u5220\u9664\u7528\u6237\u548c\u5bb6\u76ee\u5f55<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E5%BD%93%E5%89%8D%E7%99%BB%E5%BD%95%E7%94%A8%E6%88%B7\"><\/span>\u67e5\u770b\u5f53\u524d\u767b\u5f55\u7528\u6237<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code>w<\/code>\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u767b\u5f55\u7528\u6237<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  ~ w\n23:22  up 12:42, 3 users, load averages: 2.12 1.77 1.84\nUSER     TTY      FROM              LOGIN@  IDLE WHAT\nshiming  console  -                10:40   12:41 -\nshiming  s001     -                11:19       - w\nshiming  s002     -                10:55       1 ssh root@ubuntu\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E7%99%BB%E5%BD%95%E8%AE%B0%E5%BD%95\"><\/span>\u67e5\u770b\u767b\u5f55\u8bb0\u5f55<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code>last<\/code>\uff0c<code>last &lt;user_name&gt;<\/code>\u53ef\u4ee5\u67e5\u770b\u767b\u5f55\u8bb0\u5f55\uff0c\u5305\u62ec\u91cd\u542f\/\u5173\u673a\u8bb0\u5f55<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  ~ last\nshiming   ttys001                   Tue Mar 26 11:19   still logged in\nshiming   ttys002                   Tue Mar 26 10:55   still logged in\nshiming   ttys001                   Tue Mar 26 10:53 - 10:53  (00:00)\nshiming   console                   Tue Mar 26 10:40   still logged in\nreboot    ~                         Tue Mar 26 10:40\nshutdown  ~                         Tue Mar 26 10:17\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E7%A6%81%E6%AD%A2%E7%94%A8%E6%88%B7_ssh_%E7%99%BB%E5%BD%95\"><\/span>\u7981\u6b62\u7528\u6237 ssh \u767b\u5f55<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u7f16\u8f91<code>\/etc\/ssh\/sshd_config<\/code>\u6587\u4ef6\uff0c\u5728\u6700\u540e\u52a0\u4e0a<code>DenyUsers<\/code>\u914d\u7f6e\uff08\u5982\u5df2\u5b58\u5728\uff0c\u590d\u7528\u5373\u53ef\uff09<\/p>\n<pre><code class=\"language-bash \"># deny user ssh login\nDenyUsers user1 user2 user3\n<\/code><\/pre>\n<p>\u91cd\u542f ssh \u670d\u52a1<\/p>\n<pre><code class=\"language-bash \">sudo systemctl reload ssh\n<\/code><\/pre>\n<p>\u7528\u6237\u4e0d\u80fd\u901a\u8fc7 ssh \u767b\u5f55\u4e86\uff0c\u4f46\u662f\u53ef\u4ee5\u901a\u8fc7\u5df2\u767b\u5f55\u7684\u8d26\u53f7<code>su - user1<\/code>\u53bb\u5207\u6362\u5230 user1<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E7%A6%81%E6%AD%A2%E5%AF%86%E7%A0%81%E7%99%BB%E5%BD%95%EF%BC%8C%E4%BB%85%E6%94%AF%E6%8C%81%E8%AF%81%E4%B9%A6\"><\/span>\u7981\u6b62\u5bc6\u7801\u767b\u5f55\uff0c\u4ec5\u652f\u6301\u8bc1\u4e66<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u7f16\u8f91<code>\/etc\/ssh\/sshd_config<\/code>\u6587\u4ef6\uff0c<\/p>\n<ol>\n<li>\u5982\u679c\u662f\u7981\u6b62 root \u7528\u6237\u5bc6\u7801\u767b\u5f55\uff08\u4f46\u652f\u6301\u8bc1\u4e66\u767b\u5f55\uff09<\/li>\n<\/ol>\n<pre><code class=\"language-bash \"># Authentication:\n# yes - \u5141\u8bb8root\u767b\u5f55 no-\u4e0d\u5141\u8bb8root\u767b\u5f55 prohibit-password-\u7981\u6b62root\u4f7f\u7528\u5bc6\u7801\u767b\u5f55\nPermitRootLogin prohibit-password\n<\/code><\/pre>\n<ol start=\"2\">\n<li>\u5982\u679c\u662f\u7981\u6b62\u4e2a\u522b\u7528\u6237\u3001\u7528\u6237\u7ec4<br \/>\n\u5728\u6700\u540e\u52a0\u4e0a<code>Match<\/code>\u6bb5\uff0c\u5728\u91cc\u9762\u52a0\u4e0a<\/li>\n<\/ol>\n<pre><code class=\"language-bash \"># disable ssh login by password for some user\nMatch User user1\n    PasswordAuthentication no\n    ChallengeResponseAuthentication no\n<\/code><\/pre>\n<pre><code class=\"language-bash \"># disable ssh login by password for some group\nMatch Group group1\n    PasswordAuthentication no\n    ChallengeResponseAuthentication no\n<\/code><\/pre>\n<ol start=\"3\">\n<li>\u5982\u679c\u7981\u6b62\u6240\u6709\u7528\u6237\u5bc6\u7801\u767b\u5f55\uff0c\u5c06\u4ee5\u4e0b\u53c2\u6570\u90fd\u6539\u4e3a no<\/li>\n<\/ol>\n<pre><code class=\"language-bash \">PasswordAuthentication no\nChallengeResponseAuthentication no\n<\/code><\/pre>\n<p>\u91cd\u542f ssh \u670d\u52a1<\/p>\n<pre><code class=\"language-bash \">sudo systemctl reload ssh\n<\/code><\/pre>\n<p>\u65e0\u8bc1\u4e66\u767b\u5f55\u65f6\u4f1a\u62a5\u9519<\/p>\n<pre><code class=\"language-bash \">$ ssh shiming@ubuntu\nshiming@ubuntu: Permission denied (publickey).\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%96%B0%E5%BB%BA%E7%94%A8%E6%88%B7%E9%BB%98%E8%AE%A4%E4%BD%BF%E7%94%A8_zsh\"><\/span>\u65b0\u5efa\u7528\u6237\u9ed8\u8ba4\u4f7f\u7528 zsh<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5982\u679c\u4f7f\u7528<code>adduser<\/code>\u547d\u4ee4\u65b0\u589e\u7528\u6237\uff0c\u8be5\u547d\u4ee4\u7684\u914d\u7f6e\u6587\u4ef6\u662f<code>\/etc\/adduser.conf<\/code>\uff0c\u4fee\u6539\u8be5\u6587\u4ef6\u5c06\u9ed8\u8ba4<\/p>\n<pre><code class=\"language-bash \">DSHELL=\/bin\/sh\n<\/code><\/pre>\n<p>\u4fee\u6539\u4e3a<\/p>\n<pre><code class=\"language-bash \">DSHELL=\/bin\/zsh\n<\/code><\/pre>\n<p>\u5982\u679c\u4f7f\u7528<code>useradd<\/code>\u6dfb\u52a0\u7528\u6237\u5219\u4fee\u6539<code>\/etc\/default\/useradd<\/code><\/p>\n<pre><code class=\"language-bash \">SHELL=\/bin\/sh\n<\/code><\/pre>\n<p>\u6539\u4e3a<\/p>\n<pre><code class=\"language-bash \">SHELL=\/bin\/zsh\n<\/code><\/pre>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u65b0\u7528\u6237\u786e\u5b9e\u9ed8\u8ba4\u4f7f\u7528 zsh\uff0c\u4f46\u662f\u56e0\u4e3a\u6ca1\u6709\u914d\u7f6e<code>~\/.zshrc<\/code>\u6587\u4ef6\uff0c\u65b0\u7528\u6237\u5728\u9996\u6b21\u767b\u9646\u7684\u65f6\u5019 zsh \u4f1a\u51fa\u4ee5\u4e0b\u63d0\u793a,\u4e0d\u662f\u592a\u53cb\u597d\uff1a<\/p>\n<pre><code class=\"language-bash \">This is the Z Shell configuration function for new users,\nzsh-newuser-install.\nYou are seeing this message because you have no zsh startup files\n(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory\n~).  This function can help you with a few settings that should\nmake your use of the shell easier.\n\nYou can:\n\n(q)  Quit and do nothing.  The function will be run again next time.\n\n(0)  Exit, creating the file ~\/.zshrc containing just a comment.\n     That will prevent this function being run again.\n\n(1)  Continue to the main menu.\n\n(2)  Populate your ~\/.zshrc with the configuration recommended\n     by the system administrator and exit (you will need to edit\n     the file by hand, if so desired).\n\n--- Type one of the keys in parentheses ---\n<\/code><\/pre>\n<p>linux \u53ef\u4ee5\u652f\u6301\u5728\u65b0\u5efa\u7528\u6237\u65f6\u540c\u65f6\u5c06\u4e00\u4e9b\u6587\u4ef6\u653e\u5230\u65b0\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u4e0b\uff0c\u5728\u914d\u7f6e\u6587\u4ef6<code>\/etc\/adduser.conf<\/code>\u548c<code>\/etc\/default\/useradd<\/code>\u4e2d\u90fd\u5b9a\u4e49\u4e86\u4e00\u4e2a\u53c2\u6570<\/p>\n<pre><code class=\"language-bash \">SKEL=\/etc\/skel\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u8def\u5f84\u7684\u542b\u4e49\u5c31\u662f\uff0c\u51e1\u662f\u653e\u5230\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff0c\u90fd\u4f1a\u62f7\u8d1d\u5230\u65b0\u7528\u6237\u5bb6\u76ee\u5f55\u3002<\/p>\n<p>\u65b0\u5efa\u7528\u6237 blog \u505a\u6d4b\u8bd5\uff0c\u6ce8\u610f<code>Copying files from \/etc\/skel<\/code>\u4f1a\u6709\u8fd9\u4e00\u53e5\u3002<\/p>\n<pre><code class=\"language-bash \">root@sz \u279c  ~ adduser blog\nAdding user `blog' ...\nAdding new group `blog' (1001) ...\nAdding new user `blog' (1001) with group `blog' ...\nCreating home directory `\/home\/blog' ...\nCopying files from `\/etc\/skel' ...\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%9C%8D%E5%8A%A1%E7%AE%A1%E7%90%86\"><\/span>\u670d\u52a1\u7ba1\u7406<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>systemd vs init.d<br \/>\n<img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/huahuayu\/img\/master\/20190602234328.png\" alt=\"\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85\"><\/span>\u8f6f\u4ef6\u5b89\u88c5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%8C%85\"><\/span>\u4e8c\u8fdb\u5236\u5305<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">tar xzf bitcoin-0.14.2-x86_64-linux-gnu.tar.gz\nsudo install -m 0755 -o root -g root -t \/usr\/local\/bin bitcoin-0.14.2\/bin\/*\n<\/code><\/pre>\n<p>-m \u8bbe\u7f6e\u4e8c\u8fdb\u5236\u6587\u4ef6\u6743\u9650<br \/>\n-o \u8bbe\u7f6e owner<br \/>\n-g \u8bbe\u7f6e group<br \/>\n-t \u8bbe\u7f6e install \u76ee\u5f55<br \/>\n\u6700\u540e\u4e00\u4e2a\u76ee\u5f55\u4e3a\u6e90\u76ee\u5f55<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%91%BD%E4%BB%A4%E6%9B%BF%E6%8D%A2\"><\/span>\u547d\u4ee4\u66ff\u6362<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u5f53\u547d\u4ee4\u5305\u542b\u53cd\u5f15\u53f7\uff08\u6ce8\u610f\uff0c\u4e0d\u662f\u5355\u5f15\u53f7\uff09\uff0c\u6216\\$(command)\u65f6\uff0c\u5141\u8bb8\u547d\u4ee4\u66ff\u6362<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ echo today is `date +%A`    #\u53cd\u5f15\u53f7\u548c\u5355\u5f15\u53f7\u5bb9\u6613\u5f15\u8d77\u6df7\u6dc6\ntoday is Saturday\n[shiming@redhat ~]$ echo today is $(date +%A)   #\u5efa\u8bae\u4f7f\u7528$(command)\ntoday is Saturday\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E5%91%BD%E4%BB%A4%E5%8E%86%E5%8F%B2\"><\/span>\u547d\u4ee4\u5386\u53f2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E6%89%93%E5%8D%B0%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%8E%86%E5%8F%B2\"><\/span>\u6253\u5370\u547d\u4ee4\u884c\u5386\u53f2<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ history\n  189  wc -l \/etc\/passwd\n  190  man wc\n  191  ls \/etc\/passwd\n  192  su\n  193  history\n  194  ls \/etc\/passwd\n  195  mkdir tmp\n  196  ls \/etc\/passwd\n  197  man wc\n  198  history\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%89%A7%E8%A1%8C%E5%8E%86%E5%8F%B2%E5%91%BD%E4%BB%A4%E8%A1%8C\"><\/span>\u6267\u884c\u5386\u53f2\u547d\u4ee4\u884c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-text \">  193  history\n  194  ls \/etc\/passwd\n  195  mkdir tmp\n  196  ls \/etc\/passwd\n  197  man wc\n  198  history\n[shiming@redhat ~]$ !194            #!+\u7f16\u53f7 \u53ef\u4ee5\u6267\u884c\u5386\u53f2\u547d\u4ee4\u884c\nls \/etc\/passwd\n\/etc\/passwd\n[shiming@redhat ~]$ !m              #!+string \u6267\u884c\u6700\u8fd1\u7684\u4e00\u4e2a\u4ee5m\u5f00\u5934\u7684\u547d\u4ee4\u884c\uff0c\u5373 man wc\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%90%9C%E7%B4%A2%E5%91%BD%E4%BB%A4%E5%8E%86%E5%8F%B2\"><\/span>\u641c\u7d22\u547d\u4ee4\u5386\u53f2<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u641c\u7d22<code>ctrl + r<\/code> , \u53d6\u6d88\u641c\u7d22 <code>ctrl + g<\/code><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%90%8E%E5%8F%B0%E8%BF%90%E8%A1%8C%E5%91%BD%E4%BB%A4\"><\/span>\u540e\u53f0\u8fd0\u884c\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"nohup_%E5%90%8E%E5%8F%B0%E8%BF%90%E8%A1%8C%E5%91%BD%E4%BB%A4\"><\/span>nohup \u540e\u53f0\u8fd0\u884c\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>nohup command &amp;<\/p>\n<pre><code class=\"language-bash \">$ nohup geth --testnet --datadir \/mnt\/ethereum\/ --syncmode \"full\" --rpc --ws &amp;\n<\/code><\/pre>\n<p>\u5982\u679c\u8981\u8ba9\u6b63\u5728\u8fd0\u884c\u7684&#8221;\u524d\u53f0\u4efb\u52a1&#8221;\u53d8\u4e3a&#8221;\u540e\u53f0\u4efb\u52a1&#8221;\uff0c\u53ef\u4ee5\u5148\u6309 ctrl + z\uff0c\u7136\u540e\u6267\u884c bg \u547d\u4ee4\uff08\u8ba9\u6700\u8fd1\u4e00\u4e2a\u6682\u505c\u7684&#8221;\u540e\u53f0\u4efb\u52a1&#8221;\u7ee7\u7eed\u6267\u884c\uff09<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%AE%88%E6%8A%A4%E8%BF%9B%E7%A8%8B\"><\/span>\u5b88\u62a4\u8fdb\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>http:\/\/www.ruanyifeng.com\/blog\/2016\/02\/linux-daemon.html<\/p>\n<h3><span class=\"ez-toc-section\" id=\"systemd\"><\/span>systemd<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>http:\/\/www.ruanyifeng.com\/blog\/2016\/03\/systemd-tutorial-commands.html<br \/>\nsystemd \u793a\u4f8b\u914d\u7f6e 1<\/p>\n<pre><code class=\"language-text \">[Unit]\nDescription=ropsten\nAfter=network.target\n[Service]\nType=simple\nLimitNOFILE=8192\nWorkingDirectory=\/mnt\/disk2\/ethereum\/ropsten\/\nExecStart=\/usr\/bin\/geth --testnet --syncmode=full --datadir \"\/mnt\/disk2\/ethereum\/ropsten\" --rpc --rpcapi \"eth,net,web3,admin,miner,debug,personal,txpool,db,shh\" --rpccorsdomain '*' --rpcaddr 127.0.0.1 --rpcport 8540 --port 30300\nRestart=always\nUser=bot\nGroup=bot\n[Install]\nWantedBy=multi-user.target\n<\/code><\/pre>\n<p>systemd \u793a\u4f8b\u914d\u7f6e 2<\/p>\n<pre><code class=\"language-text \">[Unit]\nDescription=openresty A high performance web server and a reverse proxy server\nAfter=network.target\n\n[Service]\nType=forking\nPIDFile=\/usr\/local\/openresty\/nginx\/logs\/nginx.pid\nExecStartPre=\/usr\/local\/openresty\/nginx\/sbin\/nginx -t -q -g 'daemon on; master_process on;'\nExecStart=\/usr\/local\/openresty\/nginx\/sbin\/nginx -g 'daemon on; master_process on;'\nExecReload=\/usr\/local\/openresty\/nginx\/sbin\/nginx -g 'daemon on; master_process on;' -s reload\nExecStop=-\/usr\/local\/openresty\/nginx\/sbin\/start-stop-daemon --quiet --stop --retry QUIT\/5 --pidfile \/run\/nginx.pid\nTimeoutStopSec=5\nKillMode=mixed\n\n[Install]\nWantedBy=multi-user.target\n<\/code><\/pre>\n<p>\u65b0\u589e\u4e00\u4e2a service \u540e\u6765\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8<br \/>\n\u6bcf\u4e00\u4e2a Unit \u90fd\u6709\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\uff0c\u544a\u8bc9 Systemd \u600e\u4e48\u542f\u52a8\u8fd9\u4e2a Unit \u3002<\/p>\n<p>Systemd \u9ed8\u8ba4\u4ece\u76ee\u5f55\/etc\/systemd\/system\/\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u3002\u4f46\u662f\uff0c\u91cc\u9762\u5b58\u653e\u7684\u5927\u90e8\u5206\u6587\u4ef6\u90fd\u662f\u7b26\u53f7\u94fe\u63a5\uff0c\u6307\u5411\u76ee\u5f55\/usr\/lib\/systemd\/system\/\uff0c\u771f\u6b63\u7684\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u90a3\u4e2a\u76ee\u5f55\u3002<\/p>\n<p>systemctl enable \u547d\u4ee4\u7528\u4e8e\u5728\u4e0a\u9762\u4e24\u4e2a\u76ee\u5f55\u4e4b\u95f4\uff0c\u5efa\u7acb\u7b26\u53f7\u94fe\u63a5\u5173\u7cfb\u3002<\/p>\n<pre><code class=\"language-bash \">$ sudo systemctl enable clamd@scan.service\n# \u7b49\u540c\u4e8e\n$ sudo ln -s '\/usr\/lib\/systemd\/system\/clamd@scan.service' '\/etc\/systemd\/system\/multi-user.target.wants\/clamd@scan.service'\n<\/code><\/pre>\n<p>\u5982\u679c\u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u8bbe\u7f6e\u4e86\u5f00\u673a\u542f\u52a8\uff0csystemctl enable \u547d\u4ee4\u76f8\u5f53\u4e8e\u6fc0\u6d3b\u5f00\u673a\u542f\u52a8\u3002<\/p>\n<p>\u4e0e\u4e4b\u5bf9\u5e94\u7684\uff0csystemctl disable \u547d\u4ee4\u7528\u4e8e\u5728\u4e24\u4e2a\u76ee\u5f55\u4e4b\u95f4\uff0c\u64a4\u9500\u7b26\u53f7\u94fe\u63a5\u5173\u7cfb\uff0c\u76f8\u5f53\u4e8e\u64a4\u9500\u5f00\u673a\u542f\u52a8\u3002<\/p>\n<pre><code class=\"language-bash \">$ sudo systemctl disable clamd@scan.service\n<\/code><\/pre>\n<p>\u5217\u51fa\u6240\u6709\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># \u5217\u51fa\u6240\u6709\u914d\u7f6e\u6587\u4ef6\n$ systemctl list-unit-files\n\n# \u5217\u51fa\u6307\u5b9a\u7c7b\u578b\u7684\u914d\u7f6e\u6587\u4ef6\n$ systemctl list-unit-files --type=service\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u8f93\u51fa\u4e00\u4e2a\u5217\u8868<\/p>\n<pre><code class=\"language-bash \">$ systemctl list-unit-files\n\nUNIT FILE              STATE\nchronyd.service        enabled\nclamd@.service         static\nclamd@scan.service     disabled\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u5217\u8868\u663e\u793a\u6bcf\u4e2a\u914d\u7f6e\u6587\u4ef6\u7684\u72b6\u6001\uff0c\u4e00\u5171\u6709\u56db\u79cd\u3002<\/p>\n<pre><code class=\"language-text \">enabled\uff1a\u5df2\u5efa\u7acb\u542f\u52a8\u94fe\u63a5\ndisabled\uff1a\u6ca1\u5efa\u7acb\u542f\u52a8\u94fe\u63a5\nstatic\uff1a\u8be5\u914d\u7f6e\u6587\u4ef6\u6ca1\u6709[Install]\u90e8\u5206\uff08\u65e0\u6cd5\u6267\u884c\uff09\uff0c\u53ea\u80fd\u4f5c\u4e3a\u5176\u4ed6\u914d\u7f6e\u6587\u4ef6\u7684\u4f9d\u8d56\nmasked\uff1a\u8be5\u914d\u7f6e\u6587\u4ef6\u88ab\u7981\u6b62\u5efa\u7acb\u542f\u52a8\u94fe\u63a5\n# \u6ce8\u610f\uff0c\u4ece\u914d\u7f6e\u6587\u4ef6\u7684\u72b6\u6001\u65e0\u6cd5\u770b\u51fa\uff0c\u8be5 Unit \u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002\u8fd9\u5fc5\u987b\u6267\u884c\u524d\u9762\u63d0\u5230\u7684systemctl status\u547d\u4ee4\u3002\n<\/code><\/pre>\n<p>\u542f\u52a8\u670d\u52a1<\/p>\n<pre><code class=\"language-bash \">systemctl start xxx.service\n<\/code><\/pre>\n<p>\u67e5\u770b\u670d\u52a1\u72b6\u6001<\/p>\n<pre><code class=\"language-bash \">systemctl status xxx.service\n<\/code><\/pre>\n<p>reload systemctl \u914d\u7f6e<\/p>\n<pre><code class=\"language-bash \">systemctl daemon-reload  #\u4e00\u65e6\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff0c\u5c31\u8981\u8ba9 SystemD \u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u65b0\u542f\u52a8\uff0c\u5426\u5219\u4fee\u6539\u4e0d\u4f1a\u751f\u6548\u3002\n<\/code><\/pre>\n<p>\u91cd\u542f\u670d\u52a1<\/p>\n<pre><code class=\"language-bash \">systemctl restart xxx.service\n<\/code><\/pre>\n<p>\u505c\u6b62\u670d\u52a1<\/p>\n<pre><code class=\"language-bash \">systemctl stop xxx.service\n<\/code><\/pre>\n<p>\u770b\u6240\u6709 systemctl \u7684\u65e5\u5fd7(\u542f\u52a8\u5931\u8d25\u7684\u65f6\u5019\u53ef\u4ee5\u6765\u8fd9\u91cc\u770b)<\/p>\n<pre><code class=\"language-bash \">journalctl -xef\n<\/code><\/pre>\n<p>\u770b\u6307\u5b9a service \u7684\u65e5\u5fd7<\/p>\n<pre><code class=\"language-bash \">journalctl -u servicename\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E7%BD%91%E7%BB%9C\"><\/span>\u7f51\u7edc<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u7aef\u53e3\u53f7\u8bf4\u660e\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u7aef\u53e3\u53f7<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>0~1023<\/td>\n<td>the Well Known Ports, also referred to as System Ports.<\/td>\n<\/tr>\n<tr>\n<td>1024~49151<\/td>\n<td>the Registered Ports, also known as User Ports.<\/td>\n<\/tr>\n<tr>\n<td>49152~65535<\/td>\n<td>the Dynamic Ports, also referred to as the Private Ports.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>1024 \u524d\u7684\u7aef\u53e3\u7ed1\u5b9a\u9700\u8981 root \u6743\u9650\u624d\u53ef\u4ee5<\/p>\n<p>\u67e5\u770b\u670d\u52a1\u548c\u7aef\u53e3\u7ed1\u5b9a\u4fe1\u606f\uff1a<\/p>\n<pre><code class=\"language-bash \">$ cat \/etc\/services\n<\/code><\/pre>\n<p>\u5217\u51fa\u6240\u6709\u6253\u5f00\u7684\u7aef\u53e3\u6216\u6b63\u5728\u8fd0\u884c\u7684\u7aef\u53e3\uff08\u5305\u62ec TCP\/UDP\uff09:<br \/>\n-l \u2013 prints only listening sockets<br \/>\n-n \u2013 shows port number<br \/>\n-t \u2013 enables listing of tcp ports<br \/>\n-u \u2013 enables listing of udp ports<br \/>\n-p \u2013 display PID\/Program name for sockets<\/p>\n<p><code>$ netstat -lntup<\/code>\u5217\u51fa\u6240\u6709 tcp\/udp\u3001\u7aef\u53e3\u3001pid\u3001\u7a0b\u5e8f\u540d\uff0c\u6bd4\u8f83\u5b9e\u7528<\/p>\n<pre><code class=\"language-bash \">$ netstat -lntu\nActive Internet connections (only servers)\nProto Recv-Q Send-Q Local Address           Foreign Address         State\ntcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN\ntcp        0      0 0.0.0.0:18333           0.0.0.0:*               LISTEN\ntcp        0      0 127.0.0.1:8545          0.0.0.0:*               LISTEN\ntcp        0      0 127.0.0.1:8546          0.0.0.0:*               LISTEN\ntcp6       0      0 :::18333                :::*                    LISTEN\ntcp6       0      0 :::30303                :::*                    LISTEN\nudp        0      0 0.0.0.0:68              0.0.0.0:*\nudp        0      0 172.31.42.181:123       0.0.0.0:*\nudp        0      0 127.0.0.1:123           0.0.0.0:*\nudp        0      0 0.0.0.0:123             0.0.0.0:*\nudp6       0      0 :::30303                :::*\nudp6       0      0 :::123                  :::*\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u670d\u52a1\u662f\u53ea\u5bf9 localhost \u76f8\u5e94\u7aef\u53e3\u670d\u52a1\u7684\uff0c\u5916\u7f51\u8bbf\u95ee\u4e0d\u5230<\/p>\n<pre><code class=\"language-text \">Proto Recv-Q Send-Q Local Address           Foreign Address         State\ntcp6       0      0 :::18333                :::*                    LISTEN\ntcp6       0      0 :::30303                :::*                    LISTEN\n<\/code><\/pre>\n<p>\u6216\u4f7f\u7528 ss -lntu<\/p>\n<pre><code class=\"language-bash \">$ ss -lntu\nNetid State      Recv-Q Send-Q              Local Address:Port                             Peer Address:Port\nudp   UNCONN     0      0                               *:68                                          *:*\nudp   UNCONN     0      0                   172.31.42.181:123                                         *:*\nudp   UNCONN     0      0                       127.0.0.1:123                                         *:*\nudp   UNCONN     0      0                               *:123                                         *:*\nudp   UNCONN     0      0                              :::30303                                      :::*\nudp   UNCONN     0      0                              :::123                                        :::*\ntcp   LISTEN     0      128                             *:22                                          *:*\ntcp   LISTEN     0      128                             *:18333                                       *:*\ntcp   LISTEN     0      128                     127.0.0.1:8545                                        *:*\ntcp   LISTEN     0      128                     127.0.0.1:8546                                        *:*\ntcp   LISTEN     0      128                            :::18333                                      :::*\ntcp   LISTEN     0      128                            :::30303                                      :::*\n<\/code><\/pre>\n<p>\u91cd\u542f\u7f51\u7edc &#8211; ubuntu<\/p>\n<pre><code class=\"language-bash \">sudo service networking restart\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E7%BD%91%E7%BB%9C%E9%93%BE%E8%B7%AF%E6%B5%8B%E8%AF%95\"><\/span>\u7f51\u7edc\u94fe\u8def\u6d4b\u8bd5<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>ping \u4e0d\u901a\u6216\u4e22\u5305\u4e25\u91cd\u65f6\u9700\u8981\u8fdb\u884c\u7f51\u7edc\u94fe\u8def\u6d4b\u8bd5\uff0c\u5b9a\u4f4d\u95ee\u9898<br \/>\nhttps:\/\/help.aliyun.com\/knowledge_detail\/40573.html<\/p>\n<p>\u63a8\u8350\u4f7f\u7528<code>mtr<\/code>\u547d\u4ee4<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E7%AB%AF%E5%8F%A3%E6%98%AF%E5%90%A6%E6%89%93%E5%BC%80\"><\/span>\u67e5\u770b\u7aef\u53e3\u662f\u5426\u6253\u5f00<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>1.\u4f60\u53ef\u4ee5\u4f7f\u7528 lsof \u547d\u4ee4\u6765\u67e5\u770b\u67d0\u4e00\u7aef\u53e3\u662f\u5426\u5f00\u653e\u3002\u67e5\u770b\u7aef\u53e3\u53ef\u4ee5\u8fd9\u6837\u6765\u4f7f\u7528\uff0c\u6211\u5c31\u4ee5 80 \u7aef\u53e3\u4e3a\u4f8b\uff1a<br \/>\nlsof -i:80<br \/>\n\u5982\u679c\u6709\u663e\u793a\u8bf4\u660e\u5df2\u7ecf\u5f00\u653e\u4e86\uff0c\u5982\u679c\u6ca1\u6709\u663e\u793a\u8bf4\u660e\u6ca1\u6709\u5f00\u653e<br \/>\n2.netstat -aptn \u6267\u884c\u770b\u770b\uff0c\u662f\u5426\u76d1\u542c\u5728 0.0.0.0:3306 3.<br \/>\nnetstat -nupl (UDP \u7c7b\u578b\u7684\u7aef\u53e3)<br \/>\nnetstat -ntpl\u00a0(TCP \u7c7b\u578b\u7684\u7aef\u53e3)<br \/>\n\u4f8b\u5982<br \/>\n4.telnet ip \u00a0 \u7aef\u53e3\u53f7 \u00a0 \u65b9\u5f0f\u6d4b\u8bd5\u8fdc\u7a0b\u4e3b\u673a\u7aef\u53e3\u662f\u5426\u6253\u5f00<br \/>\n\u53c2\u8003\uff1ahttps:\/\/blog.csdn.net\/m0_37975886\/article\/details\/78405808?utm_source=copy<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E9%98%BF%E9%87%8C%E4%BA%91%E5%AE%89%E5%85%A8%E7%BB%84%E7%AD%96%E7%95%A5\"><\/span>\u963f\u91cc\u4e91\u5b89\u5168\u7ec4\u7b56\u7565<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5982\u679c\u963f\u91cc\u4e91\u5b89\u5168\u7ec4\u91cc\u6ca1\u6709\u5f00\u653e\u7aef\u53e3\uff0c\u5373\u4fbf\u670d\u52a1\u5728\u672c\u673a\u7aef\u53e3\u7ed1\u5b9a\u4e86\uff0c\u5916\u7f51\u4e5f\u65e0\u6cd5\u8bbf\u95ee<\/p>\n<pre><code class=\"language-bash \">shiming@pro \u279c  telnet 120.79.226.111 9009\nTrying 120.79.226.111...\ntelnet: connect to address 120.79.226.111: Operation timed out\ntelnet: Unable to connect to remote host\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E9%98%B2%E7%81%AB%E5%A2%99\"><\/span>\u9632\u706b\u5899<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">root@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw status verbose  #\u67e5\u770b\u9632\u706b\u5899\u8be6\u60c5\nStatus: inactive  #\u672a\u5f00\u542f\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw allow 8545\/tcp  #\u5141\u8bb8\u7aef\u53e3tcp\u8bbf\u95ee\nRules updated\nRules updated (v6)\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw allow 8546\/tcp\nRules updated\nRules updated (v6)\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw allow 8545\/udp   #\u5141\u8bb8\u7aef\u53e3udp\u8bbf\u95ee\nRules updated\nRules updated (v6)\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw allow 8546\/udp\nRules updated\nRules updated (v6)\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw status verbose\nStatus: inactive\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw enable  #\u5f00\u542f\u9632\u706b\u5899\nCommand may disrupt existing ssh connections. Proceed with operation (y|n)? y\nFirewall is active and enabled on system startup\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw allow http #\u5f00\u542f80\u7aef\u53e3(http)\u8bbf\u95ee\nRule added\nRule added (v6)\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw allow https #\u5f00\u542f443\u7aef\u53e3(https)\u8bbf\u95ee\nRule added\nRule added (v6)\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw allow ssh #\u5f00\u542f22\u7aef\u53e3(ssh)\u8bbf\u95ee\nRule added\nRule added (v6)\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo service networking restart\nroot@iZj6c48apyeg9dvouqz3uxZ:~# sudo ufw status verbose\nStatus: active\nLogging: on (low)\nDefault: deny (incoming), allow (outgoing), disabled (routed)\nNew profiles: skip\n\nTo                         Action      From\n--                         ------      ----\n8545\/tcp                   ALLOW IN    Anywhere\n8546\/tcp                   ALLOW IN    Anywhere\n8545\/udp                   ALLOW IN    Anywhere\n8546\/udp                   ALLOW IN    Anywhere\n80                         ALLOW IN    Anywhere\n443                        ALLOW IN    Anywhere\n22                         ALLOW IN    Anywhere\n8545\/tcp (v6)              ALLOW IN    Anywhere (v6)\n8546\/tcp (v6)              ALLOW IN    Anywhere (v6)\n8545\/udp (v6)              ALLOW IN    Anywhere (v6)\n8546\/udp (v6)              ALLOW IN    Anywhere (v6)\n80 (v6)                    ALLOW IN    Anywhere (v6)\n443 (v6)                   ALLOW IN    Anywhere (v6)\n22 (v6)                    ALLOW IN    Anywhere (v6)\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E7%BD%91%E7%BB%9C%E6%B5%8B%E8%AF%95\"><\/span>\u7f51\u7edc\u6d4b\u8bd5<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">Shimings-Air:~ Shiming$ traceroute -p 8545 47.75.70.201\ntraceroute to 47.75.70.201 (47.75.70.201), 64 hops max, 52 byte packets\n 1  172.16.0.1 (172.16.0.1)  4.037 ms  1.054 ms  1.719 ms\n 2  192.168.5.1 (192.168.5.1)  5.688 ms  8.667 ms  6.993 ms\n 3  100.64.0.1 (100.64.0.1)  16.788 ms  5.867 ms  7.902 ms\n 4  213.106.38.59.broad.fs.gd.dynamic.163data.com.cn (59.38.106.213)  9.796 ms  8.975 ms  8.774 ms\n 5  183.56.65.62 (183.56.65.62)  13.150 ms  10.301 ms\n    183.56.65.66 (183.56.65.66)  11.280 ms\n 6  59.43.80.21 (59.43.80.21)  12.356 ms  10.645 ms  11.649 ms\n 7  59.43.130.106 (59.43.130.106)  12.012 ms  51.356 ms  43.798 ms\n 8  59.43.187.126 (59.43.187.126)  16.115 ms\n    59.43.187.122 (59.43.187.122)  13.389 ms\n    59.43.187.150 (59.43.187.150)  11.819 ms\n 9  59.43.187.178 (59.43.187.178)  16.522 ms\n    59.43.183.106 (59.43.183.106)  21.514 ms\n    59.43.188.126 (59.43.188.126)  18.220 ms\n10  59.43.249.10 (59.43.249.10)  17.732 ms\n    59.43.186.126 (59.43.186.126)  22.963 ms\n    59.43.186.122 (59.43.186.122)  14.746 ms\n11  210.48.139.70 (210.48.139.70)  21.244 ms\n    210.48.136.158 (210.48.136.158)  19.783 ms\n    203.100.48.254 (203.100.48.254)  22.733 ms\n12  * * *\n13  11.211.16.137 (11.211.16.137)  24.828 ms\n    11.211.16.105 (11.211.16.105)  22.569 ms\n    11.211.20.165 (11.211.20.165)  30.418 ms\n14  * * *\n15  * * *\n16  * * *\n17  * * *\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E7%BD%91%E9%80%9F\"><\/span>\u67e5\u770b\u7f51\u901f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u4f7f\u7528<code>nload<\/code>\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u7f51\u7edc\u8d1f\u8377\uff0c\u5b9e\u65f6\u663e\u793a\u7f51\u901f\uff0c\u6309 enter \u53ef\u4ee5\u5207\u6362\u7f51\u5361<br \/>\n<code>nload<\/code>\u6bd4\u8f83\u7b80\u6d01\uff0c\u53ea\u663e\u793a\u603b\u7f51\u901f\uff0c<code>nethogs<\/code>\u53ef\u4ee5\u6309\u8fdb\u7a0b\u663e\u793a\u7f51\u7edc\u5360\u7528\uff0c\u7c7b\u4f3c<code>htop<\/code><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E7%BC%96%E8%BE%91%E5%91%BD%E4%BB%A4%E8%A1%8C\"><\/span>\u7f16\u8f91\u547d\u4ee4\u884c<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u5206\u9694\u540c\u4e00\u884c\u4e2d\u7684\u547d\u4ee4<\/p>\n<table>\n<thead>\n<tr>\n<th>shell \u547d\u4ee4<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>ctrl+a<\/td>\n<td>\u8df3\u5230\u547d\u4ee4\u884c\u5f00\u5934<\/td>\n<\/tr>\n<tr>\n<td>ctrl+e<\/td>\n<td>\u8df3\u5230\u547d\u4ee4\u884c\u7ed3\u5c3e<\/td>\n<\/tr>\n<tr>\n<td>ctrl+u<\/td>\n<td>\u5220\u9664\u5149\u6807\u524d\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td>ctrl+k<\/td>\n<td>\u5220\u9664\u5149\u6807\u540e\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td>ctrl+\u5de6\u7bad\u5934<\/td>\n<td>\u5411\u5de6\u8df3\u4e00\u5b57<\/td>\n<\/tr>\n<tr>\n<td>ctrl+\u53f3\u7bad\u5934<\/td>\n<td>\u5411\u53f3\u8df3\u4e00\u5b57<\/td>\n<\/tr>\n<tr>\n<td>ctrl+r<\/td>\n<td>\u5728\u547d\u4ee4\u884c\u5386\u53f2\u4e2d\u641c\u7d22\u67d0\u4e00\u6a21\u5f0f\u547d\u4ee4<\/td>\n<\/tr>\n<tr>\n<td>;<\/td>\n<td>\u5206\u9694\u540c\u4e00\u884c\u4e2d\u7684\u547d\u4ee4<\/td>\n<\/tr>\n<tr>\n<td>Esc + .<\/td>\n<td>\u590d\u5236\u4ee5\u524d\u547d\u4ee4\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span class=\"ez-toc-section\" id=\"bash_%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6\"><\/span>bash \u914d\u7f6e\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u6267\u884c\u987a\u5e8f\uff1a \/etc\/profile -> (~\/.bash_profile | ~\/.bash_login | ~\/.profile) -> ~\/.bashrc -> \/etc\/bashrc -> ~\/.bash_logout \u89c1<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.thegeekstuff.com\/2008\/10\/execution-sequence-for-bash_profile-bashrc-bash_login-profile-and-bash_logout\/\">\u53c2\u8003\u4e00<\/a><\/p>\n<table>\n<thead>\n<tr>\n<th>file<\/th>\n<th>Interactive login<\/th>\n<th>Interactive non-login<\/th>\n<th>Script<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\/etc\/profile<\/td>\n<td>A<\/td>\n<td><\/td>\n<td><\/td>\n<td>system wide version of ~\/.profit, execute once when user login. Executed only for interactive shells<\/td>\n<\/tr>\n<tr>\n<td>\/etc\/profile.d\/&#42;<\/td>\n<td>A<\/td>\n<td><\/td>\n<td><\/td>\n<td>user defined \/etc\/profile, invoked by \/etc\/profile<\/td>\n<\/tr>\n<tr>\n<td>\/etc\/bashrc or \/etc\/bash.bashrc<\/td>\n<td><\/td>\n<td>A<\/td>\n<td><\/td>\n<td>system wide version of ~\/.bashrc. Executed for both interactive and non-interactive shells. In fact in Ubuntu the \/etc\/profile calls the \/etc\/bashrc directly<\/td>\n<\/tr>\n<tr>\n<td>~\/.bashrc<\/td>\n<td><\/td>\n<td>B<\/td>\n<td><\/td>\n<td>user defined shell config<\/td>\n<\/tr>\n<tr>\n<td>~\/.bash_profile<\/td>\n<td>B1<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>~\/.bash_login<\/td>\n<td>B2<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>~\/.profile<\/td>\n<td>B3<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>BASH_ENV<\/td>\n<td><\/td>\n<td><\/td>\n<td>A<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>~\/.bash_logout<\/td>\n<td>C<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\"><\/span>\u67e5\u770b\u73af\u5883\u53d8\u91cf<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u67e5\u770b\u6240\u6709\u73af\u5883\u53d8\u91cf\u4f7f\u7528 printenv \u547d\u4ee4<br \/>\n<code>\u279c ~ printenv<\/code><\/p>\n<h2><span class=\"ez-toc-section\" id=\"alias\"><\/span>alias<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u522b\u540d\u53ef\u4ee5\u5b9a\u4e49\u5728.zshrc \u6216.bashrc \u4e2d\u65b9\u4fbf\u4e00\u4e9b\u64cd\u4f5c<\/p>\n<pre><code class=\"language-text \"># add python3.7 to path\nexport PATH=\/usr\/local\/Cellar\/python\/3.7.1\/bin:$PATH\nexport PATH=\/usr\/local\/Cellar\/python\/3.7\/bin:$PATH\nalias pip3='python3 -m pip'\nalias python2=\"\/usr\/bin\/python\"\n\n# alias cleos in docker\nalias cleos='docker exec -it eosio \/opt\/eosio\/bin\/cleos --url http:\/\/127.0.0.1:7777 --wallet-url http:\/\/127.0.0.1:5555'\n\n# alias md_to_json\nalias mtj='md_to_json'\n\n# alias for clear\nalias cl='clear'\n\n# alias for tldr\nalias sman='tldr'\n\n# alias for go to defang dir\nalias defang='cd \/Users\/shiming\/Nutstore\/21-defang'\n\n# alias for go to jianguoyun dir\nalias jianguoyun='cd \/Users\/shiming\/Nutstore'\n\n# alias for go to myrepo dir\nalias myrepo='cd \/Users\/shiming\/Nutstore\/00-myrepo'\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"export\"><\/span>export<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>bash \u5185\u5efa\u547d\u4ee4\uff0c\u4f7f\u5f97\u5b50\u8fdb\u7a0b\u53ef\u4ee5\u590d\u7528\u7236\u8fdb\u7a0b\u7684\u73af\u5883\u53d8\u91cf\u3002\u901a\u8fc7\u547d\u4ee4\u884c\u6572\u7684 export \u547d\u4ee4\uff0c\u4e0d\u7ba1\u662f\u5bfc\u5165\u8fd8\u662f\u5220\u9664\u90fd\u662f\u4e34\u65f6\u7684\u3002\u5982\u679c\u9700\u8981\u6c38\u4e45\u4fdd\u6301\u6709\u6548\u9700\u8981\u5199\u5728~\/.bashrc \u7b49\u914d\u7f6e\u6587\u4ef6\u4e2d\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"unset_%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\"><\/span>unset \u73af\u5883\u53d8\u91cf<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><code>unset<\/code>\u547d\u4ee4\u53ef\u4ee5\u5220\u9664 export \u7684\u73af\u5883\u53d8\u91cf<\/p>\n<pre><code class=\"language-bash \">\u279c  ~ export TMPVAR=\"XX\"\n\u279c  ~ printenv TMPVAR\nXX\n\u279c  ~ unset TMPVAR\n\u279c  ~ printenv TMPVAR\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E5%8D%95%E4%B8%AA%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\"><\/span>\u67e5\u770b\u5355\u4e2a\u73af\u5883\u53d8\u91cf<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-bash \">\u279c  ~ printenv HOME\n\/Users\/shiming\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E5%B8%B8%E8%A7%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\"><\/span>\u5e38\u89c1\u73af\u5883\u53d8\u91cf<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<table>\n<thead>\n<tr>\n<th>Variable<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>EDITOR<\/td>\n<td>The program to run to perform edits.<\/td>\n<\/tr>\n<tr>\n<td>HOME<\/td>\n<td>The Home directory of the user.<\/td>\n<\/tr>\n<tr>\n<td>LOGNAME<\/td>\n<td>The login name of the user.<\/td>\n<\/tr>\n<tr>\n<td>MAIL<\/td>\n<td>The location of the user&#8217;s local inbox.<\/td>\n<\/tr>\n<tr>\n<td>OLDPWD<\/td>\n<td>The previous working directory.<\/td>\n<\/tr>\n<tr>\n<td>PATH<\/td>\n<td>A colon separated list of directories to search for commands.<\/td>\n<\/tr>\n<tr>\n<td>PAGER<\/td>\n<td>This program may be called to view a file.<\/td>\n<\/tr>\n<tr>\n<td>PS1<\/td>\n<td>PS1 The primary prompt string.<\/td>\n<\/tr>\n<tr>\n<td>PWD<\/td>\n<td>The present working directory.<\/td>\n<\/tr>\n<tr>\n<td>USER<\/td>\n<td>The username of the user.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"PATH\"><\/span>PATH<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code>PATH<\/code>\u73af\u5883\u53d8\u91cf\u51b3\u5b9a\u4e86\u7cfb\u7edf\u5bfb\u627e\u6267\u884c\u7a0b\u5e8f\u65f6\u7684\u8def\u5f84\uff0c\u9ed8\u8ba4\u7684\u73af\u5883\u53d8\u91cf\u5982\u4e0b<\/p>\n<pre><code class=\"language-bash \">john@ubuntu:~$ echo $PATH\n\/home\/john\/bin:\/home\/john\/.local\/bin:\/usr\/local\/bin:\/usr\/bin:\/bin:\/usr\/local\/games:\/usr\/games\n<\/code><\/pre>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.jianshu.com\/p\/ea6c4758dba4\">\/usr\/bin \u548c\/usr\/local\/bin \u7684\u533a\u522b<\/a>\uff1a<br \/>\n\u9996\u5148\u6ce8\u610f usr \u6307 Unix System Resource\uff0c\u800c\u4e0d\u662f User<br \/>\n\u7136\u540e\u901a\u5e38\uff1a<br \/>\n\/usr\/bin \u4e0b\u9762\u7684\u90fd\u662f\u7cfb\u7edf\u9884\u88c5\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\uff0c\u4f1a\u968f\u7740\u7cfb\u7edf\u5347\u7ea7\u800c\u6539\u53d8\u3002<br \/>\n\/usr\/local\/bin \u76ee\u5f55\u662f\u7ed9\u7528\u6237\u653e\u7f6e\u81ea\u5df1\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u5730\u65b9\uff0c\u63a8\u8350\u653e\u5728\u8fd9\u91cc\uff0c\u4e0d\u4f1a\u88ab\u7cfb\u7edf\u5347\u7ea7\u800c\u8986\u76d6\u540c\u540d\u6587\u4ef6\u3002<\/p>\n<p><code>~\/.local<\/code>\u76ee\u5f55\u662f\u4f7f\u7528 systemd linux \u53d1\u884c\u7248\u90fd\u4f1a\u6709\u7684\u4e00\u4e2a\u76ee\u5f55<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E\"><\/span>\u53c2\u6570\u8bf4\u660e<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-text \">-p\nList of all names that are exported in the current shell\n-n\nRemove names from export list\n-f\nNames are exported as functions\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"export_%E4%BD%9C%E7%94%A8%E8%A7%A3%E6%9E%90\"><\/span>export \u4f5c\u7528\u89e3\u6790<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6ca1\u7528 export \u524d<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ name=shiming            #\u8bbe\u7f6e\u53d8\u91cfname=shimiing\n[shiming@redhat ~]$ echo $name              #\u5728\u5f53\u524d\u8fdb\u7a0b\u4e0b\u8f93\u51fa\nshiming                                     #\u6b63\u786e\u8f93\u51fa\n[shiming@redhat ~]$ bash                    #\u65b0\u5f00\u4e00\u4e2a\u8fdb\u7a0b\n[shiming@redhat ~]$ echo $name              #\u5728\u65b0\u5f00\u7684\u8fdb\u7a0b\u8f93\u51fa$name\n                                            #\u65e0\u6548\n[shiming@redhat ~]$\n<\/code><\/pre>\n<p>\u7528\u4e86 export \u540e<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ name=shiming            #\u8bbe\u7f6e\u53d8\u91cfname=shiming\n[shiming@redhat ~]$ echo $name              #\u5f53\u524d\u8fdb\u7a0b\u8f93\u51fa\nshiming                                     #\u6b63\u786e\u8f93\u51fa\n[shiming@redhat ~]$ export name             #export\u53d8\u91cf\n[shiming@redhat ~]$ bash                    #\u65b0\u5f00\u8fdb\u7a0b\n[shiming@redhat ~]$ echo $name              #\u518d\u6b21\u8f93\u51fa\nshiming                                     #\u6b63\u786e\u8f93\u51fa\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"append_to_the_PATH\"><\/span>append to the PATH<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u7ed9 PATH \u52a0\u4e00\u4e2a\u8def\u5f84\uff0c\u7528\u5192\u53f7\u5206\u9694<\/p>\n<pre><code class=\"language-text \">$ export PATH=$PATH:\/home\/himanshu\/practice\/\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E5%9B%BA%E5%8C%96%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F\"><\/span>\u56fa\u5316\u73af\u5883\u53d8\u91cf<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-text \">export name=\"xiongxiong\"                        #\u5728~\/.bashrc\u6587\u4ef6\u672b\u5c3e\u52a0\u4e0a\u8fd9\u53e5\n[shiming@redhat shiming]$ echo $name            #\u6253\u5370\u4e3a\u7a7a\n\n[shiming@redhat shiming]$ source .bashrc        #\u6267\u884c.bashrc\n[shiming@redhat shiming]$ echo $name            #\u6253\u5370\u6709\u503c\nxiongxiong\n[shiming@redhat shiming]$ unset name            #\u5982\u679c\u4e0d\u60f3\u7528\u8fd9\u4e2a\u73af\u5883\u53d8\u91cf\u4e86\uff0c\u7528unset\u6682\u65f6\u5220\u9664\n[shiming@redhat shiming]$ echo $name            #\u6253\u5370\u4e3a\u7a7a\n\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E5%B1%80%E9%83%A8%E5%92%8C%E5%85%A8%E5%B1%80%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE\"><\/span>\u5c40\u90e8\u548c\u5168\u5c40\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u53c2\u8003<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.tecmint.com\/set-unset-environment-variables-in-linux\/\">\u8fd9\u91cc<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E8%BF%9B%E7%A8%8B%E7%AE%A1%E7%90%86\"><\/span>\u8fdb\u7a0b\u7ba1\u7406<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E8%BF%9B%E7%A8%8B%E8%B5%84%E6%BA%90%E5%8D%A0%E7%94%A8\"><\/span>\u67e5\u770b\u8fdb\u7a0b\u8d44\u6e90\u5360\u7528<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u4f7f\u7528\u547d\u4ee4<code>top<\/code>(\u6216 <code>htop<\/code>\uff0c\u9700\u8981\u5b89\u88c5)<\/p>\n<pre><code class=\"language-bash \">Processes: 501 total, 2 running, 499 sleeping, 2532 threads                                              09:39:06\nLoad Avg: 2.68, 1.92, 1.79  CPU usage: 1.26% user, 1.42% sys, 97.30% idle\nSharedLibs: 229M resident, 47M data, 86M linkedit.\nMemRegions: 171203 total, 8320M resident, 84M private, 1873M shared.\nPhysMem: 16G used (6889M wired), 118M unused.\nVM: 2489G vsize, 1121M framework vsize, 30538579(0) swapins, 32834518(0) swapouts.\nNetworks: packets: 60080455\/70G in, 68155895\/7815M out. Disks: 6097134\/243G read, 6811848\/392G written.\n\nPID    COMMAND      %CPU TIME     #TH    #WQ  #PORTS MEM    PURG   CMPRS  PGRP  PPID  STATE    BOOSTS\n44018  top          5.0  00:02.23 1\/1    0    26     6032K  0B     0B     44018 33399 running  *0[1]\n44017  sleep        0.0  00:00.00 1      0    10     328K   0B     0B     26499 26726 sleeping *0[1]\n44000  quicklookd   0.0  00:00.16 4      1    88     5104K  28K    0B     44000 1     sleeping  0[0]\n43947  com.apple.iC 0.0  00:00.14 2      1    59     3032K  0B     256K   43947 1     sleeping  0[0]\n43904  ocspd        0.0  00:00.02 2      1    36     1912K  0B     0B     43904 1     sleeping *0[1]\n43881  Google Chrom 0.0  00:00.79 10     2    73     29M    4096B  9560K  1123  1123  sleeping *0[3]\n43880  Google Chrom 0.0  00:05.02 16     1    125    98M    0B     19M    1123  1123  sleeping *0[3]\n43879  Google Chrom 0.0  00:00.31 16     1    122    17M    0B     12M    1123  1123  sleeping *0[3]\n43769  MTLCompilerS 0.0  00:00.06 3      3    27     16K    0B     10M    43769 1     sleeping  0[2]\n43764  com.apple.pr 0.0  00:02.17 4      1    274    5948K  0B     21M    43764 1     sleeping *0[598]\n43763  MTLCompilerS 0.0  00:00.07 3      3    27     12K    0B     10M    43763 1     sleeping  0[2]\n43757  System Prefe 0.0  00:02.70 4      1    296    5632K  8192B  18M    43757 1     sleeping *0[304]\n43729  com.apple.no 0.0  00:00.04 2      1    44     28K    0B     1424K  43729 1     sleeping  0[1]\n43727  mdworker     0.0  00:00.07 3      1    54     52K    0B     3232K  43727 1     sleeping *0[1]\n43711  Google Chrom 0.0  00:25.45 17     1    133    44M    0B     125M   1123  1123  sleeping *0[24]\n43004  Google Chrom 0.2  04:07.35 19     1    150    208M   0B     62M    1123  1123  sleeping *0[26]\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E8%BF%9B%E7%A8%8B%E5%90%8E%E5%8F%B0%E8%BF%90%E8%A1%8C\"><\/span>\u8fdb\u7a0b\u540e\u53f0\u8fd0\u884c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>\u547d\u4ee4<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>command &amp;<\/td>\n<td>\u8fdb\u7a0b\u540e\u53f0\u8fd0\u884c<\/td>\n<\/tr>\n<tr>\n<td>ctrl + c<\/td>\n<td>\u505c\u6b62\u524d\u53f0\u8fd0\u884c\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>ctrl + z<\/td>\n<td>\u6302\u8d77\u5f53\u524d\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>bg<\/td>\n<td>\u8bb2\u6302\u8d77\u7684\u8fdb\u7a0b\u653e\u5728\u540e\u53f0\u7ee7\u7eed\u8fd0\u884c\uff08\u9700\u914d\u5408 ctrl + z \u4f7f\u7528\uff09<\/td>\n<\/tr>\n<tr>\n<td>bg [%num]<\/td>\n<td>\u5c06\u8fdb\u7a0b\u653e\u5728\u540e\u53f0\u8fd0\u884c<\/td>\n<\/tr>\n<tr>\n<td>fg [%num]<\/td>\n<td>\u5c06\u8fdb\u7a0b\u653e\u5728\u524d\u53f0\u8fd0\u884c<\/td>\n<\/tr>\n<tr>\n<td>kill -l<\/td>\n<td>\u67e5\u770b\u6240\u6709\u4e2d\u65ad\u4fe1\u53f7<\/td>\n<\/tr>\n<tr>\n<td>kill -9 pid<\/td>\n<td>\u6740\u6b7b\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>jobs<\/td>\n<td>\u67e5\u770b jobs<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E6%8C%87%E5%AE%9A%E8%BF%9B%E7%A8%8B\"><\/span>\u67e5\u770b\u6307\u5b9a\u8fdb\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat profile.d]$ ps -p 1        #\u67e5\u770bpid = 1\u7684\u8fdb\u7a0b\u4fe1\u606f\n  PID TTY          TIME CMD\n    1 ?        00:00:03 systemd\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%89%93%E5%8D%B0%E5%BD%93%E5%89%8D%E8%BF%9B%E7%A8%8B_id\"><\/span>\u6253\u5370\u5f53\u524d\u8fdb\u7a0b id<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat profile.d]$ echo $$        #\u4e24\u4e2a\u7f8e\u5143\u7b26\u53f7\u6253\u5370\u5f53\u524d\u8fdb\u7a0b\u540d\n19376\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E8%AF%A2%E5%AD%90%E8%BF%9B%E7%A8%8B%E4%BF%A1%E6%81%AF\"><\/span>\u67e5\u8be2\u5b50\u8fdb\u7a0b\u4fe1\u606f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat profile.d]$ echo $$        #\u5f53\u524d\u8fdb\u7a0b\n19376\n[shiming@redhat profile.d]$ bash           #\u65b0\u8d77\u4e00\u4e2a\u5b50\u8fdb\u7a0b\n[shiming@redhat profile.d]$ echo $$        #\u83b7\u53d6\u5b50\u8fdb\u7a0bid\n21139\n[shiming@redhat profile.d]$ ps --ppid 19376  #\u67e5\u770b\u5b50\u8fdb\u7a0b\u4fe1\u606f\n  PID TTY          TIME CMD\n21139 pts\/0    00:00:00 bash\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E8%BF%9B%E7%A8%8B%E5%89%8D%E5%8F%B0%E5%90%8E%E5%8F%B0%E8%BF%90%E8%A1%8C%E5%88%87%E6%8D%A2\"><\/span>\u8fdb\u7a0b\u524d\u53f0\/\u540e\u53f0\u8fd0\u884c\u5207\u6362<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<blockquote class=\"wp-embedded-content\" data-secret=\"1MMnkBkH88\"><p><a href=\"https:\/\/www.thegeekstuff.com\/2010\/05\/unix-background-job\/\">Bg, Fg, &#038;, Ctrl-Z &#8211; 5 Examples to Manage Unix Background Jobs<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Bg, Fg, &#038;, Ctrl-Z &#8211; 5 Examples to Manage Unix Background Jobs&#8221; &#8212; The Geek Stuff\" src=\"https:\/\/www.thegeekstuff.com\/2010\/05\/unix-background-job\/embed\/#?secret=zIlYsJHbUX#?secret=1MMnkBkH88\" data-secret=\"1MMnkBkH88\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h2><span class=\"ez-toc-section\" id=\"vim\"><\/span>vim<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E7%B3%BB%E7%BB%9F%E8%87%AA%E5%B8%A6%E6%95%99%E7%A8%8B\"><\/span>\u7cfb\u7edf\u81ea\u5e26\u6559\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ vimtutor\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"vim_%E5%A4%8D%E5%88%B6%E5%86%85%E5%AE%B9%E5%88%B0_Mac_%E7%B3%BB%E7%BB%9F%E5%89%AA%E8%B4%B4%E6%9D%BF\"><\/span>vim \u590d\u5236\u5185\u5bb9\u5230 Mac \u7cfb\u7edf\u526a\u8d34\u677f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>mac \u81ea\u5e26\u7684 vim \u4f4d\u4e8e\/usr\/bin \u76ee\u5f55\u4e0b\uff0c\u8fd9\u4e2a\u7248\u672c\u4e0d\u652f\u6301\u5c06 vim \u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230\u7cfb\u7edf\u526a\u8d34\u677f<br \/>\n\u5982\u4f55\u67e5\u770b\u662f\u5426\u652f\u6301\u590d\u5236\u5230\u526a\u8d34\u677f\uff1a<\/p>\n<pre><code class=\"language-bash \">vim --version\n<\/code><\/pre>\n<p>\u5982\u679c\u51fa\u73b0<code>+clipboard<\/code>\u5219\u652f\u6301,\u51fa\u73b0<code>-clipboard<\/code>\u5219\u4e0d\u652f\u6301<br \/>\n\u6240\u4ee5\u9700\u8981\u81ea\u5df1\u91cd\u65b0\u5b89\u88c5 vim, <code>brew install vim --with-client-server<\/code><br \/>\n\u5b89\u88c5\u540e\u9700\u8981\u505a\u4e24\u4ef6\u4e8b\uff1a<\/p>\n<ol>\n<li>\u505a\u4e00\u4e2a\u8f6f\u8fde\u63a5\u5230\/usr\/local\/bin, \u8fd9\u6837\u5c31\u4f1a\u4f7f\u7528\u65b0\u88c5\u7684 vim\uff0c\u56e0\u4e3a\/usr\/local\/bin \u5728 path \u4e2d\u6bd4\/usr\/bin \u66f4\u9760\u524d<\/li>\n<\/ol>\n<pre><code class=\"language-text \">ln -sf \/usr\/local\/Cellar\/vim\/8.1.0600_1\/bin\/vim \/usr\/local\/bin\/vim\nln -sf \/usr\/local\/Cellar\/vim\/8.1.0600_1\/bin\/vim \/usr\/local\/bin\/vi\n<\/code><\/pre>\n<p>2.\u8fd8\u9700\u8981\u4fee\u6539~\/.vimrc \u6587\u4ef6\uff0c\u52a0\u4e0a\u4e0b\u9762\u8fd9\u884c<\/p>\n<pre><code class=\"language-text \">set clipboard=unnamed\n<\/code><\/pre>\n<p>\u4ee5\u540e\u5c31\u53ef\u4ee5\u5728 vim \u4e2d visual \u6a21\u5f0f\u9009\u4e2d\u6587\u5b57\u8fdb\u884c\u590d\u5236(yank)\u4e86<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%86%99_read-only_%E6%96%87%E4%BB%B6\"><\/span>\u5199 read-only \u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6709\u65f6\u6ca1\u6709\u7528 sudo \u6253\u5f00\u6587\u4ef6\uff0c\u7f16\u8f91\u540e\u4fdd\u5b58\u4e0d\u4e86\uff0c\u4f1a\u63d0\u793a read-only\uff0c\u53ef\u4ee5\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u6587\u4ef6\u5199\u8fdb\u53bb\uff0c\u4e0d\u7528\u9000\u51fa\u6587\u4ef6\u518d sudo \u6253\u5f00\u3002<\/p>\n<pre><code class=\"language-zsh \">:w !sudo tee %\n<\/code><\/pre>\n<p>\u547d\u4ee4\u89e3\u91ca\uff1a<br \/>\n:w \u2013 write<br \/>\n!sudo \u2013 call shell sudo command<br \/>\ntee \u2013 the output of write (:w) command is redirected using tee<br \/>\n% \u2013 current file name<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E7%9B%B8%E5%AF%B9%E8%A1%8C%E5%8F%B7\"><\/span>\u76f8\u5bf9\u884c\u53f7<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code>set relativenumber<\/code>\u53ef\u4ee5\u5f00\u542f\u76f8\u5bf9\u884c\u53f7<\/p>\n<p>\u4ee5\u4e0b.vimrc \u914d\u7f6e\u53ef\u4ee5\u5728 normal \u6a21\u5f0f\u4e0b\u663e\u793a\u76f8\u5bf9\u884c\u53f7\uff0cinsert \u6a21\u5f0f\u4e0b\u73b0\u5728\u6b63\u5e38\u884c\u53f7<\/p>\n<pre><code class=\"language-text \">set nu\naugroup relative_numbser\n    autocmd!\n    autocmd InsertEnter * :set norelativenumber\n    autocmd InsertLeave * :set relativenumber\naugroup END\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"vscode_vim_%E6%8F%92%E4%BB%B6%E8%AE%BE%E7%BD%AE\"><\/span>vscode vim \u63d2\u4ef6\u8bbe\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>https:\/\/medium.com\/@realjohnnylau\/vscode-vim-easymotion-%E9%85%8D%E7%BD%AE-6b64bba642cf<\/p>\n<h3><span class=\"ez-toc-section\" id=\"vim_normal_%E6%A8%A1%E5%BC%8F%E5%92%8C%E6%8F%92%E5%85%A5%E6%A8%A1%E5%BC%8F%E6%8C%87%E9%92%88%E5%BD%A2%E7%8A%B6\"><\/span>vim normal \u6a21\u5f0f\u548c\u63d2\u5165\u6a21\u5f0f\u6307\u9488\u5f62\u72b6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>normal \u6a21\u5f0f\u548c\u63d2\u5165\u6a21\u5f0f\u6307\u9488\u5f62\u72b6\u5982\u679c\u6ca1\u6709\u533a\u522b\uff08normal \u6a21\u5f0f\u65b9\u5757\uff0c\u63d2\u5165\u6a21\u5f0f\u4e00\u6839\u7ad6\u7ebf\uff09\u53ef\u4ee5\u5728.vimrc \u6587\u4ef6\u4e2d\u8fdb\u884c\u8bbe\u7f6e<br \/>\n\u53c2\u8003 https:\/\/vim.fandom.com\/wiki\/Change_cursor_shape_in_different_modes<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E5%88%97%E8%A1%A8\"><\/span>\u5e38\u7528\u547d\u4ee4\u5217\u8868<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>\u64cd\u4f5c<\/th>\n<th>\u547d\u4ee4<\/th>\n<th>\u5907\u6ce8<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u5149\u6807\u5de6\u79fb<\/td>\n<td>h<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5149\u6807\u53f3\u79fb<\/td>\n<td>l<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5149\u6807\u4e0b\u79fb<\/td>\n<td>j<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5149\u6807\u4e0a\u79fb<\/td>\n<td>k<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5149\u6807\u79fb\u5230\u5f53\u524d\u5c4f\u5e55\u9876\u90e8<\/td>\n<td>H<\/td>\n<td>H for Home<\/td>\n<\/tr>\n<tr>\n<td>\u5149\u6807\u79fb\u5230\u5f53\u524d\u5c4f\u5e55\u4e2d\u90e8<\/td>\n<td>M<\/td>\n<td>M for Middle<\/td>\n<\/tr>\n<tr>\n<td>\u5149\u6807\u79fb\u5230\u5f53\u524d\u5c4f\u5e55\u5e95\u90e8<\/td>\n<td>L<\/td>\n<td>L for Last<\/td>\n<\/tr>\n<tr>\n<td>\u5149\u6807\u8df3\u5230\u4e0b\u4e00\u4e2a\u53e5\u5b50<\/td>\n<td>\uff09<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5149\u6807\u8df3\u5230\u4e0a\u4e00\u4e2a\u53e5\u5b50<\/td>\n<td>\uff08<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5149\u6807\u8df3\u5230\u4e0b\u4e00\u4e2a\u6bb5\u843d<\/td>\n<td>}<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5149\u6807\u8df3\u5230\u4e0a\u4e00\u4e2a\u6bb5\u843d<\/td>\n<td>{<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5f53\u524d\u5149\u6807\u63d2\u5165<\/td>\n<td>i<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5f53\u524d\u5149\u6807\u540e\u63d2\u5165<\/td>\n<td>a<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u590d\u5236\u884c<\/td>\n<td>yy or Y<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u526a\u5207\u884c<\/td>\n<td>dd<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u526a\u5207\u4e24\u884c<\/td>\n<td>2dd<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u7c98\u8d34\uff08\u5230\u5149\u6807\u540e\uff09<\/td>\n<td>p<\/td>\n<td>p for paste<\/td>\n<\/tr>\n<tr>\n<td>\u7c98\u8d34\uff08\u5230\u5149\u6807\u524d\uff09<\/td>\n<td>P\uff08\u5927\u5199\uff09<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u663e\u793a\u884c\u53f7<\/td>\n<td>:set number<\/td>\n<td>\u7b80\u5199:set nu<\/td>\n<\/tr>\n<tr>\n<td>\u4e0d\u663e\u793a\u884c\u53f7<\/td>\n<td>:set nonumber<\/td>\n<td>\u7b80\u5199:set nu!<\/td>\n<\/tr>\n<tr>\n<td>\u663e\u793a\u76f8\u5bf9\u884c\u53f7<\/td>\n<td>:set relativenumber<\/td>\n<td>\u7b80\u5199:set rnu<\/td>\n<\/tr>\n<tr>\n<td>\u4e0d\u663e\u793a\u76f8\u5bf9\u884c\u53f7<\/td>\n<td>:set norelativenumber<\/td>\n<td>\u7b80\u5199:set rnu!<\/td>\n<\/tr>\n<tr>\n<td>\u663e\u793a\u6240\u6709\u8bbe\u7f6e\u9879<\/td>\n<td>:set all<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u663e\u793a\u7528\u6237\u8bbe\u7f6e<\/td>\n<td>:set<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u672c\u5355\u8bcd\u7ed3\u5c3e\uff08\u5305\u62ec\u7d27\u8ddf\u7740\u7684\u7a7a\u683c\uff09<\/td>\n<td>dw<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u4e24\u4e2a\u5355\u8bcd\u7ed3\u5c3e\uff08\u5305\u62ec\u7d27\u8ddf\u7740\u7684\u7a7a\u683c\uff09<\/td>\n<td>d2w<\/td>\n<td>\u4ee5\u6b64\u7c7b\u63a8<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u672c\u5355\u8bcd\u7ed3\u5c3e\uff08\u4e0d\u5305\u62ec\u7d27\u8ddf\u7684\u7a7a\u683c\uff09<\/td>\n<td>de<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u4e24\u4e2a\u5355\u8bcd\u7ed3\u5c3e\uff08\u4e0d\u5305\u62ec\u7d27\u8ddf\u7684\u7a7a\u683c\uff09<\/td>\n<td>d2e<\/td>\n<td>\u4ee5\u6b64\u7c7b\u63a8<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u672c\u884c\u672b\u5c3e<\/td>\n<td>d$<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u672c\u884c\u5f00\u5934<\/td>\n<td>d^<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u6587\u4ef6\u672b\u5c3e<\/td>\n<td>dG<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u4e24\u4e2a\u5f15\u53f7\/\u62ec\u53f7\u4e2d\u7684\u5185\u5bb9\uff08\u4e0d\u5305\u62ec\u5f15\u53f7\uff09<\/td>\n<td>di&#8221; \u6216 di)<\/td>\n<td>i for inside<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u4e24\u4e2a\u5f15\u53f7\/\u62ec\u53f7\u4e2d\u7684\u5185\u5bb9\uff08\u5305\u62ec\u5f15\u53f7\uff09<\/td>\n<td>da&#8221; \u6216 da)<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u6587\u4ef6\u5f00\u5934\uff08\u5305\u62ec\u5149\u6807\u6240\u5728\u884c\uff09<\/td>\n<td>dgg\/d1G<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u6307\u5b9a\u5b57\u7b26\uff08\u5305\u542b\u5b57\u7b26\uff09<\/td>\n<td>dfX<\/td>\n<td>\u5220\u9664\u5230 X\uff0c\u5305\u542b X<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u6307\u5b9a\u5b57\u7b26\uff08\u4e0d\u5305\u542b\u5b57\u7b26\uff09<\/td>\n<td>dtX<\/td>\n<td>\u5220\u9664\u5230 X\uff0c\u4e0d\u5305\u542b X<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u6307\u5b9a\u6b63\u5219\u5339\u914d\u5230\u7684\u5b57\u7b26\uff08\u4e0d\u5305\u542b\u5b57\u7b26\uff09<\/td>\n<td>d\/regex<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u53cd\u5411\u5220\u9664\u5230\u6307\u5b9a\u5b57\u7b26\uff08\u5305\u542b\u5b57\u7b26\uff09<\/td>\n<td>dFX<\/td>\n<td>\u5220\u9664\u5230 X\uff0c\u5305\u542b X<\/td>\n<\/tr>\n<tr>\n<td>\u53cd\u5411\u5220\u9664\u5230\u6307\u5b9a\u5b57\u7b26\uff08\u4e0d\u5305\u542b\u5b57\u7b26\uff09<\/td>\n<td>dTX<\/td>\n<td>\u5220\u9664\u5230 X\uff0c\u4e0d\u5305\u542b X<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u4e00\u884c\u5e76\u8fdb\u5165\u63d2\u5165\u6a21\u5f0f<\/td>\n<td>cc<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u5355\u8bcd\u7ed3\u5c3e\u5e76\u8fdb\u5165\u63d2\u5165\u6a21\u5f0f<\/td>\n<td>ce<\/td>\n<td>\u65b9\u4fbf\u4fee\u6539\u8be5\u5355\u8bcd,c for change<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5230\u672c\u884c\u672b\u5c3e\u5e76\u8fdb\u5165\u63d2\u5165\u6a21\u5f0f<\/td>\n<td>c$ \u6216 C(\u5927\u5199)<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u6574\u884c\u5411\u53f3\u7f29\u8fdb<\/td>\n<td>>><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u6574\u884c\u5411\u5de6\u7f29\u8fdb<\/td>\n<td>&lt;&lt;<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u64a4\u9500<\/td>\n<td>u<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u64a4\u9500\u4e4b\u64a4\u9500<\/td>\n<td>ctrl + r<\/td>\n<td>r for redo<\/td>\n<\/tr>\n<tr>\n<td>\u4fdd\u5b58<\/td>\n<td>:w<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u53e6\u5b58\u4e3a<\/td>\n<td>:w + filename<\/td>\n<td>\u5c06\u76ee\u524d\u7f16\u8f91\u7684\u6587\u4ef6\u53e6\u5b58\u4e3a filename<\/td>\n<\/tr>\n<tr>\n<td>\u4fdd\u5b58\u5e76\u9000\u51fa<\/td>\n<td>:wq or :ZZ<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u4e0d\u4fdd\u5b58\u9000\u51fa<\/td>\n<td>:q!<\/td>\n<td>q for quit<\/td>\n<\/tr>\n<tr>\n<td>\u4fdd\u5b58\u53ea\u8bfb\u6587\u4ef6<\/td>\n<td>:w !sudo tee %<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u5230\u4e0b\u4e00\u8bcd\u9996<\/td>\n<td>w<\/td>\n<td>w for word<\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u5230\u4e0a\u4e00\u8bcd\u9996<\/td>\n<td>b<\/td>\n<td>b for back<\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u5230\u4e0b 2 \u4e2a\u8bcd\u9996<\/td>\n<td>2w<\/td>\n<td>\u4ee5\u6b64\u7c7b\u63a8<\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u5230\u8bcd\u5c3e<\/td>\n<td>e<\/td>\n<td>e for end<\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u5230\u4e0b\u4e00\u8bcd\u5c3e<\/td>\n<td>2e<\/td>\n<td>\u4ee5\u6b64\u7c7b\u63a8<\/td>\n<\/tr>\n<tr>\n<td>\u66ff\u6362\u5149\u6807\u5904\u5b57\u7b26<\/td>\n<td>r + \u65b0\u5b57\u7b26<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u884c\u5185\u5b57\u7b26\u67e5\u627e<\/td>\n<td>f + \u5b57\u7b26 + ;(optional, \u53ef\u5c06\u5149\u6807\u8df3\u5230\u4e0b\u4e00\u4e2a\u5339\u914d\u9879)<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u884c\u5185\u5b57\u7b26\u67e5\u627e (\u53cd\u5411)<\/td>\n<td>F + \u5b57\u7b26 + ;(optional, \u53ef\u5c06\u5149\u6807\u8df3\u5230\u4e0b\u4e00\u4e2a\u5339\u914d\u9879)<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u5230\u6587\u672c\u672b\u5c3e<\/td>\n<td>G<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u5230\u6587\u672c\u5f00\u5934<\/td>\n<td>gg<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u5230\u6307\u5b9a\u884c<\/td>\n<td>\u884c\u53f7 + G<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5411\u4e0b\u641c\u7d22<\/td>\n<td>\/ + keyword<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5411\u4e0a\u641c\u7d22<\/td>\n<td>\uff1f + keyword<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u627e\u4e0b\u4e00\u4e2a<\/td>\n<td>n<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u627e\u4e0a\u4e00\u4e2a<\/td>\n<td>N<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u641c\u7d22\u9ad8\u4eae<\/td>\n<td>:set hls<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u5230\u5149\u6807\u4e0a\u4e00\u4e2a\u6240\u5728\u7684\u4f4d\u7f6e<\/td>\n<td>ctrl + o<\/td>\n<td>o for older<\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u5230\u5149\u6807\u4e0b\u4e00\u4e2a\u6240\u5728\u7684\u4f4d\u7f6e<\/td>\n<td>ctrl + i<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u627e\u5230\u5bf9\u79f0\u7684\u53e6\u4e00\u534a\u62ec\u53f7(\u5927\u4e2d\u5c0f\u62ec\u53f7\u90fd\u884c)<\/td>\n<td>\u5c06\u5149\u6807\u7f6e\u4e8e\u62ec\u53f7\u4e0a\u7136\u540e\u6309%<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u66ff\u6362\u5149\u6807\u884c\u7b2c\u4e00\u4e2a\u5339\u914d\u9879<\/td>\n<td>:s\/old\/new\/<\/td>\n<td>old \u4e3a\u5f85\u66ff\u6362\u5b57\u7b26\uff0cnew \u4e3a\u65b0\u5b57\u7b26<\/td>\n<\/tr>\n<tr>\n<td>\u66ff\u6362\u5149\u6807\u884c\u6240\u6709\u5339\u914d\u9879<\/td>\n<td>:s\/old\/new\/g<\/td>\n<td>g for global<\/td>\n<\/tr>\n<tr>\n<td>\u66ff\u6362\u6307\u5b9a\u884c\u6240\u6709\u5339\u914d\u9879<\/td>\n<td>:#,#s\/old\/new\/g<\/td>\n<td>\u4e24\u4e2a\u4e95\u53f7\u4ee3\u8868\u5f00\u59cb\u884c\u548c\u7ed3\u675f\u884c<\/td>\n<\/tr>\n<tr>\n<td>\u5168\u5c40\u66ff\u6362\uff08\u65e0\u786e\u8ba4\uff09<\/td>\n<td>:%s\/old\/new\/g<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5168\u5c40\u66ff\u6362\uff08\u9010\u4e2a\u786e\u8ba4\uff09<\/td>\n<td>:%s\/old\/new\/gc<\/td>\n<td>c for comfirm<\/td>\n<\/tr>\n<tr>\n<td>\u6267\u884c\u5916\u90e8\u547d\u4ee4<\/td>\n<td>:! + command<\/td>\n<td>\u4e3e\u4f8b :!ls :!rm file<\/td>\n<\/tr>\n<tr>\n<td>\u8fdb\u5165 visual \u6a21\u5f0f<\/td>\n<td>v<\/td>\n<td>\u8fdb\u5165 visual \u6a21\u5f0f\u540e\u53ef\u4ee5\u901a\u8fc7\u79fb\u52a8\u5149\u6807\u9009\u4e2d\u6587\u5b57<\/td>\n<\/tr>\n<tr>\n<td>\u590d\u5236\u9009\u4e2d\u6587\u5b57<\/td>\n<td>visual \u6a21\u5f0f\u9009\u4e2d + y<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u9009\u4e2d\u6587\u5b57<\/td>\n<td>visual \u6a21\u5f0f\u9009\u4e2d + d<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u9009\u4e2d\u6587\u5b57\u53e6\u5b58\u4e3a\u65b0\u6587\u4ef6<\/td>\n<td>visual \u6a21\u5f0f\u9009\u4e2d + :w + \u65b0\u6587\u4ef6\u540d<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5728\u5149\u6807\u540e\u63d2\u5165\u53e6\u4e00\u6587\u4ef6\u7684\u5185\u5bb9<\/td>\n<td>:r + filename<\/td>\n<td>\u5c06 filename \u9644\u52a0\u5230\u5149\u6807\u540e<\/td>\n<\/tr>\n<tr>\n<td>\u5728\u5149\u6807\u540e\u63d2\u5165\u547d\u4ee4\u884c\u7684\u6807\u51c6\u8f93\u51fa<\/td>\n<td>:r + !ls -l<\/td>\n<td>\u5c06 ls -l \u8f93\u51fa\u9644\u52a0\u5230\u5149\u6807\u540e<\/td>\n<\/tr>\n<tr>\n<td>\u5728\u5149\u6807\u4e0b\u63d2\u4e00\u7a7a\u884c<\/td>\n<td>o<\/td>\n<td>o for open, open a line<\/td>\n<\/tr>\n<tr>\n<td>\u5728\u5149\u6807\u4e0a\u63d2\u4e00\u7a7a\u884c<\/td>\n<td>O<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u6807\u8bb0\u4e66\u7b7e<\/td>\n<td>ma<\/td>\n<td>\u7ed9\u8be5\u884c\u6253\u4e0a\u6807\u8bb0 a \uff08\u53ef\u4ee5\u6807\u8bb0 a-z\uff09<\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u8f6c\u5230\u4e66\u7b7e\u884c<\/td>\n<td>&#8216;a<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u8df3\u8f6c\u5230\u4e66\u7b7e\u884c\u5217<\/td>\n<td>`a<\/td>\n<td>\u4e0d\u4ec5\u8df3\u8f6c\u5230\u884c\u800c\u4e14\u8df3\u8f6c\u5230\u5149\u6807\u6240\u5728\u7684\u5217<\/td>\n<\/tr>\n<tr>\n<td>\u6807\u7b7e\u5217\u8868<\/td>\n<td>:marks<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u6807\u7b7e<\/td>\n<td>:delmarks a \u6216 :delm a<\/td>\n<td>\u5220\u9664\u6807\u7b7e a<\/td>\n<\/tr>\n<tr>\n<td>vim<\/td>\n<td>:set xxx<\/td>\n<td>&#8216;ic&#8217; &#8216;ignorecase&#8217; ignore upper\/lower case when searching <br \/>&#8216;is&#8217; &#8216;incsearch&#8217; show partial matches for a search phrase <br \/>&#8216;hls&#8217; &#8216;hlsearch&#8217; highlight all matching phrases <br \/>\u7ed9\u4ee5\u4e0a\u9009\u9879\u524d\u52a0\u4e0a&#8217;no&#8217;\u5373\u53ef\u64a4\u9500\u547d\u4ee4<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u5e2e\u52a9<\/td>\n<td>:help<\/td>\n<td>\u67e5\u770b\u5e2e\u52a9\u65f6\u5207\u6362\u7a97\u53e3 ctrl + w<\/td>\n<\/tr>\n<tr>\n<td>\u4e2a\u6027\u5316 vim \u914d\u7f6e\u6587\u4ef6<\/td>\n<td>:e ~\/.vimrc<\/td>\n<td>\u67e5\u770b\u5e2e\u52a9\u65f6\u5207\u6362\u7a97\u53e3 ctrl + w<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"vim_%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81\"><\/span>vim \u4e2d\u6587\u4e71\u7801<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5982\u679c vim \u4e2d\u6587\u4e71\u7801\uff0c\u5728\u7528\u6237\u5bb6\u76ee\u5f55\u4e0b\u65b0\u5efa.vimrc \u6587\u4ef6\uff0c\u586b\u5165\u4ee5\u4e0b\u5185\u5bb9<\/p>\n<pre><code class=\"language-text \">set fileencodings=utf-8,gbk,utf-16le,cp1252,iso-8859-15,ucs-bom\nset termencoding=utf-8\nset encoding=utf-8\n<\/code><\/pre>\n<p>\u4e5f\u53ef\u4ee5\u5728\/etc\/vim\/vimrc \u91cc\u52a0\u5728\u6700\u540e\uff0c\u4f46\u662f\u8fd9\u4e2a\u6587\u4ef6\u5f71\u54cd\u6240\u6709\u7528\u6237\uff0c\u5728\u81ea\u5df1\u5bb6\u76ee\u5f55\u4e0b\u7684.vimrc \u53ea\u5f71\u54cd\u81ea\u5df1<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E8%8E%B7%E5%8F%96%E5%B8%AE%E5%8A%A9\"><\/span>\u83b7\u53d6\u5e2e\u52a9<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E6%90%9C%E7%B4%A2%E5%B8%AE%E5%8A%A9%E4%B8%BB%E9%A2%98\"><\/span>\u641c\u7d22\u5e2e\u52a9\u4e3b\u9898<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ man -k passwd         #\u641c\u7d22\u4e0e\u5173\u952e\u5b57passwd\u6709\u5173\u7684\u5e2e\u52a9\nchpasswd (8)         - update passwords in batch mode\nfgetpwent_r (3)      - get passwd file entry reentrantly\ngetpwent_r (3)       - get passwd file entry reentrantly\ngpasswd (1)          - administer \/etc\/group and \/etc\/gshadow\ngrub2-mkpasswd-pbkdf2 (1) - Generate a PBKDF2 password hash.\nkpasswd (1)          - change a user's Kerberos password\nlpasswd (1)          - Change group or user password\nlppasswd (1)         - add, change, or delete digest passwords.\n\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E5%B8%AE%E5%8A%A9%E5%88%86%E7%B1%BB\"><\/span>\u5e2e\u52a9\u5206\u7c7b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>num<\/th>\n<th>topic<\/th>\n<th>note<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>Executable programs or shell commands<\/td>\n<td>\u7528\u6237\u547d\u4ee4<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>System calls (functions provided by the kernel)<\/td>\n<td>\u7cfb\u7edf\u8c03\u7528<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>Library calls (functions within program libraries)<\/td>\n<td>\u5e93\u51fd\u6570<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>Special files (usually found in \/dev)<\/td>\n<td>\u7279\u6b8a\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>File formats and conventions eg \/etc\/passwd<\/td>\n<td>\u6587\u4ef6\u683c\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>Games<\/td>\n<td>\u6e38\u620f<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)<\/td>\n<td>\u60ef\u4f8b\u3001\u6807\u51c6\u548c\u5176\u4ed6<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>System administration commands (usually only for root)<\/td>\n<td>\u7cfb\u7edf\u7ba1\u7406\u547d\u4ee4<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>Kernel routines [Non standard]<\/td>\n<td>Linux \u5185\u6838 API<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"pinfo\"><\/span>pinfo<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>pinfo \u63d0\u4f9b\u66f4\u8be6\u7ec6\u7684\u5e2e\u52a9\u6587\u6863<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat doc]$ pinfo vim\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E8%BD%AF%E4%BB%B6%E5%8C%85%E6%96%87%E6%A1%A3\"><\/span>\u67e5\u770b\u8f6f\u4ef6\u5305\u6587\u6863<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u8f6f\u4ef6\u5305\u6587\u6863\u50a8\u5b58\u5728\/usr\/share\/doc \u76ee\u5f55\u4e0b\uff0c\u91cc\u9762\u5305\u542b\u5927\u91cf\u8f6f\u4ef6\u5305\u63d0\u4f9b\u7684\u6587\u6863\u8bf4\u660e<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%88%9B%E5%BB%BA%E3%80%81%E6%9F%A5%E7%9C%8B%E5%92%8C%E7%BC%96%E8%BE%91%E6%96%87%E6%9C%AC%E6%96%87%E4%BB%B6\"><\/span>\u521b\u5efa\u3001\u67e5\u770b\u548c\u7f16\u8f91\u6587\u672c\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E6%A0%87%E5%87%86%E8%BE%93%E5%85%A5%E3%80%81%E6%A0%87%E5%87%86%E8%BE%93%E5%87%BA%E3%80%81%E6%A0%87%E5%87%86%E9%94%99%E8%AF%AF\"><\/span>\u6807\u51c6\u8f93\u5165\u3001\u6807\u51c6\u8f93\u51fa\u3001\u6807\u51c6\u9519\u8bef<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.linuxunit.com\/images\/stdin-stdout-stderr.png\" alt=\"https:\/\/www.linuxunit.com\/io-redirection-stdin-stdout-stderr-streams\/\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"exit_code\"><\/span>exit code<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>bash \u811a\u672c\u8fd0\u884c\u7ec8\u6b62\u65f6\u53ef\u4ee5\u8fd4\u56de\u4e00\u4e2a<code>exit code<\/code>\uff0c\u5c31\u50cf\u5728 C \u7a0b\u5e8f\u4e2d\u4e00\u6837\u3002\u5b83\u4e5f\u53ef\u4ee5\u8fd4\u56de\u4e00\u4e2a\u503c\uff0c\u8fd9\u4e2a\u503c\u53ef\u4ee5\u7ed9\u811a\u672c\u7684\u7236\u8fdb\u7a0b\u3002<\/p>\n<p>\u6bcf\u4e2a\u547d\u4ee4\u90fd\u4f1a\u8fd4\u56de\u4e00\u4e2a<code>exit status<\/code>\uff08\u6709\u65f6\u88ab\u79f0\u4e3a\u8fd4\u56de\u72b6\u6001\u6216\u9000\u51fa\u4ee3\u7801\uff09\u3002\u6210\u529f\u7684\u547d\u4ee4\u4f1a\u8fd4\u56de\u4e00\u4e2a 0\uff0c\u800c\u4e0d\u6210\u529f\u7684\u547d\u4ee4\u4f1a\u8fd4\u56de\u4e00\u4e2a\u975e\u96f6\u503c\uff0c\u901a\u5e38\u53ef\u4ee5\u89e3\u91ca\u4e3a\u9519\u8bef\u4ee3\u7801\u3002\u884c\u4e3a\u826f\u597d\u7684 UNIX \u547d\u4ee4\u3001\u7a0b\u5e8f\u548c\u5b9e\u7528\u7a0b\u5e8f\u5728\u6210\u529f\u5b8c\u6210\u540e\u90fd\u4f1a\u8fd4\u56de 0 \u7684\u9000\u51fa\u4ee3\u7801\uff0c\u4f46\u4e5f\u6709\u4e00\u4e9b\u4f8b\u5916\u3002<\/p>\n<p>\u540c\u6837\uff0c\u811a\u672c\u4e2d\u7684\u51fd\u6570\u548c\u811a\u672c\u672c\u8eab\u4e5f\u4f1a\u8fd4\u56de\u4e00\u4e2a\u9000\u51fa\u72b6\u6001\u3002\u51fd\u6570\u6216\u811a\u672c\u4e2d\u6700\u540e\u6267\u884c\u7684\u547d\u4ee4\u51b3\u5b9a\u4e86\u9000\u51fa\u72b6\u6001\u3002\u5728\u811a\u672c\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528 exit nnn \u547d\u4ee4\u5411 shell \u4f20\u9001 nnn \u9000\u51fa\u72b6\u6001\uff08nnn \u5fc5\u987b\u662f 0 &#8211; 255 \u8303\u56f4\u5185\u7684\u6574\u6570\uff09\u3002<\/p>\n<p>\u67e5\u770b\u4e0a\u4e00\u4e2a\u547d\u4ee4\u7684<code>exit code<\/code>\u7684\u65b9\u6cd5\u4e3a<code>echo $?<\/code>\u5982\u679c\u8fd0\u884c\u6b63\u5e38\uff0c\u8f93\u51fa\u4e3a 0\uff0c\u5426\u5219\u4ee3\u8868\u51fa\u9519\u3002<\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.tldp.org\/LDP\/abs\/html\/exit-status.html\">\u53c2\u8003\u8d44\u6599 Advanced Bash-Scripting Guide<\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E9%87%8D%E5%AE%9A%E5%90%91\"><\/span>\u91cd\u5b9a\u5411<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4>stdout \u91cd\u5b9a\u5411\uff0c>\u8986\u76d6\u5199\uff0c>>\u8ffd\u52a0\u5199<\/h4>\n<pre><code class=\"language-bash \">[shiming@redhat doc]$ echo \"hello\" &gt; \/tmp\/hello.txt         #\u8f93\u51fa\u91cd\u5b9a\u5411\uff0c\u65b0\u5efa\n[shiming@redhat doc]$ cat \/tmp\/hello.txt\nhello\n[shiming@redhat doc]$ echo \"world\" &gt;&gt; \/tmp\/hello.txt        #\u8f93\u51fa\u91cd\u5b9a\u5411\uff0c\u8ffd\u52a0\n[shiming@redhat doc]$ cat \/tmp\/hello.txt\nhello\nworld\n[shiming@redhat doc]$ echo \"hello world\" &gt; \/tmp\/hello.txt   #\u8f93\u51fa\u91cd\u5b9a\u5411\uff0c\u8986\u76d6\n[shiming@redhat doc]$ cat \/tmp\/hello.txt\nhello world\n<\/code><\/pre>\n<h4>stderr \u91cd\u5b9a\u5411<\/h4>\n<pre><code class=\"language-bash \">[shiming@redhat doc]$ echox \"hello world\" 2&gt;\/tmp\/hello_err.txt  #\u9519\u8bef\u91cd\u5b9a\u5411\uff0c\u65b0\u5efa\n[shiming@redhat doc]$ cat \/tmp\/hello_err.txt\nbash: echox: command not found...\nSimilar command is: 'echo'\n[shiming@redhat doc]$ echoy \"hello world\" 2&gt;&gt;\/tmp\/hello_err.txt #\u9519\u8bef\u91cd\u5b9a\u5411\uff0c\u8ffd\u52a0\n[shiming@redhat doc]$ cat \/tmp\/hello_err.txt\nbash: echox: command not found...\nSimilar command is: 'echo'\nbash: echoy: command not found...\nSimilar command is: 'echo'\n[shiming@redhat doc]$ echoz \"hello world\" 2 &gt; \/tmp\/hello_err.txt #\u91cd\u5b9a\u5411\u7b26\u53f7\u5de6\u53f3\u4e0d\u80fd\u7a7a\u683c\nbash: echoz: command not found...\nSimilar command is: 'echo'\n[shiming@redhat doc]$ echoz \"hello world\" 2&gt;\/tmp\/hello_err.txt   #\u9519\u8bef\u91cd\u5b9a\u5411\uff0c\u8986\u76d6\n[shiming@redhat doc]$ cat \/tmp\/hello_err.txt\nbash: echoz: command not found...\nSimilar command is: 'echo'\n[shiming@redhat doc]$ echoz \"hello world\" 2&gt;\/dev\/null            #\u5c06\u9519\u8bef\u4fe1\u606f\u91cd\u5b9a\u5411\u5230\/dev\/null\uff0c\u4ece\u800c\u5c06\u5b83\u4e22\u5f03\n[shiming@redhat doc]$ cat \/dev\/null                              #\u65e0\u8f93\u51fa\n<\/code><\/pre>\n<h4>stdout \u548c stderr \u4e00\u8d77\u91cd\u5b9a\u5411<\/h4>\n<pre><code class=\"language-bash \">$ command &gt;file 2&gt;&amp;1            #\u91cd\u5b9a\u5411stdout\u548cstderr\u4ee5\u8986\u76d6\u540c\u4e00\u4e2a\u6587\u4ef6\n$ command &amp;&gt;file                #\u4e0e\u4e0a\u9762\u7b49\u6548(\u63a8\u8350)\n\n$ command &gt;&gt;file 2&gt;&amp;1           #\u91cd\u5b9a\u5411stdout\u548cstderr\u4ee5\u9644\u52a0\u5230\u540c\u4e00\u4e2a\u6587\u4ef6\n$ command &amp;&gt;&gt;file               #\u4e0e\u4e0a\u9762\u7b49\u6548(\u63a8\u8350)\n\n#\u793a\u4f8b\uff1a\n[shiming@redhat doc]$ echo \"nice day\" &amp;&gt;\/tmp\/nice.txt\n[shiming@redhat doc]$ cat \/tmp\/nice.txt\nnice day\n[shiming@redhat doc]$ echoa \"nice day\" &amp;&gt;&gt;\/tmp\/nice.txt\n[shiming@redhat doc]$ cat \/tmp\/nice.txt\nnice day\nbash: echoa: command not found...\nSimilar command is: 'echo'\n<\/code><\/pre>\n<h4>\u91cd\u5b9a\u5411\u793a\u4f8b<\/h4>\n<h5>\u4fdd\u5b58\u65f6\u95f4\u6233\u4f9b\u4ee5\u540e\u53c2\u8003<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ date &gt; \/tmp\/saved_timestamp\n<\/code><\/pre>\n<h5>\u5c06\u4e00\u4e2a\u65e5\u5fd7\u7684\u540e 100 \u884c\u8d1f\u8d23\u5230\u53e6\u4e00\u6587\u4ef6<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ tail -n 100 \/var\/log\/dmesg &gt;\/tmp\/last_100_boot_msg\n<\/code><\/pre>\n<h5>\u5c06\u56db\u4e2a\u6587\u4ef6\u8fde\u63a5\u4e3a\u4e00\u4e2a<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ cat file1 file2 file3 file4 &gt;\/tmp\/four_in_one\n<\/code><\/pre>\n<h5>\u5c06\u6587\u4ef6\u540d\u5217\u51fa\u5230\u6587\u4ef6\u4e2d<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ cat \/tmp\/filename\n<\/code><\/pre>\n<h5>\u5c06\u8f93\u51fa\u9644\u52a0\u5230\u73b0\u6709\u6587\u4ef6<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ echo \"new line info\" &gt;&gt;\/tmp\/many_lines_of_info\n[shiming@redhat ~]$ diff previous_file current_file &gt;&gt;\/tmp\/tracking_change_made\n<\/code><\/pre>\n<h5>\u5c06\u9519\u8bef\u91cd\u5b9a\u5411\u5230\u6587\u4ef6<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ find \/etc -name passwd 2&gt;\/tmp\/error\n<\/code><\/pre>\n<h5>\u5c06\u8f93\u51fa\u548c\u9519\u8bef\u5206\u522b\u5b9a\u5411\u5230\u4e0d\u540c\u6587\u4ef6<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ find \/etc -name passwd &gt;\/tmp\/output 2&gt;\/tmp\/error\n<\/code><\/pre>\n<h5>\u5ffd\u7565\u5e76\u4e22\u5f03\u9519\u8bef\u4fe1\u606f<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ find \/etc -name passwd &gt;\/tmp\/output 2&gt;\/dev\/null\n<\/code><\/pre>\n<h5>\u5c06\u8f93\u51fa\u548c\u9519\u8bef\u4fe1\u606f\u4e00\u5e76\u4fdd\u5b58<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ find \/etc -name passwd &amp;&gt;\/tmp\/save_both\n<\/code><\/pre>\n<h5>\u5c06\u8f93\u51fa\u548c\u9519\u8bef\u4fe1\u606f\u9644\u52a0\u4fdd\u5b58<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ find \/etc -name passwd &amp;&gt;&gt;\/tmp\/save_both\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E7%AE%A1%E9%81%93\"><\/span>\u7ba1\u9053<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/17fba4f9-a-62cb3a1a-s-sites.googlegroups.com\/site\/jocvlib\/ethiopia\/computer\/linux\/standard-linux-textbook\/ch03\/fig03-02.jpg?attachauth=ANoY7criN_2_KAHzVkRLkqXYnbO4nfF0VL9wd9AaWhPhLTk9fNbP9qMSGtlH-hi_ozjge_WCHA6WsdYnGYC84_U74BctPVnJPUsqL4pWhmHrrZalPOIiRbh-MkmNtdU-ndBNnQYYX0TecOBeCc2Jw1i9Usl-QgEwkQAmF_-pGmtadTsQ2czYxjTbRus437ntxO-VjW-iU6U1FDJW2CKMtG2WrbrJgw20R67mL8Efu4sB8RDgVJoRffDTz_IvqFHSlaKUYXLfzITurK8lw0d4g0ZBaxQJXpoy63BdamI7cVf4ZqEjdHTDfic%3D&amp;attredirects=0\" alt=\"\" \/><\/p>\n<h4>\u7ba1\u9053\u793a\u4f8b<\/h4>\n<h5>\u5355\u4e00\u7ba1\u9053<\/h5>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ ls | wc -l            #\u8ba1\u7b97\u6587\u4ef6\u6570\n14\n<\/code><\/pre>\n<h5>\u7ba1\u9053\u548c\u91cd\u5b9a\u5411\u7ec4\u5408\u4f7f\u7528<\/h5>\n<pre><code class=\"language-bash \">#\u5c06ls -l\u547d\u4ee4\u8f93\u51fa\u524d5\u884c\u91cd\u5b9a\u5411\u5230 \/tmp.first_five_lines\u6587\u4ef6\n[shiming@redhat ~]$ ls -l | head -n 5 &gt; \/tmp\/first_five_lines\n[shiming@redhat ~]$ cat \/tmp\/first_five_lines\ntotal 36\ndrwxr-xr-x. 2 shiming shiming 4096 Mar  3 11:35 Desktop\ndrwxr-xr-x. 2 shiming shiming 4096 Jan 13  2018 Documents\ndrwxr-xr-x. 2 shiming shiming 4096 Jan 13  2018 Downloads\n-rw-rw-r--. 1 shiming shiming    0 Jul 28 09:41 file1\n<\/code><\/pre>\n<h5>tee<\/h5>\n<p>Copy standard input to each FILE, and also to standard output.<\/p>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ ls -l file* | tee \/tmp\/saved_output   #\u6587\u4ef6\u4e2d\u6709\u4fdd\u6301\uff0cstdout\u4e5f\u6253\u5370\n-rw-rw-r--. 1 shiming shiming 0 Jul 28 09:41 file1\n-rw-rw-r--. 1 shiming shiming 0 Jul 28 09:41 file2\n-rw-rw-r--. 1 shiming shiming 0 Jul 28 09:41 file3\n-rw-rw-r--. 1 shiming shiming 0 Jul 28 09:41 file4\n-rw-rw-r--. 1 shiming shiming 0 Jul 28 09:41 file5\n<\/code><\/pre>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ ls -l file* | head -n 2 | tee \/tmp\/first_two_lines\n-rw-rw-r--. 1 shiming shiming 0 Jul 28 09:41 file1\n-rw-rw-r--. 1 shiming shiming 0 Jul 28 09:41 file2\n<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E7%94%A8%E6%88%B7%E5%92%8C%E7%BB%84\"><\/span>\u7528\u6237\u548c\u7ec4<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E5%BD%93%E5%89%8D%E7%94%A8%E6%88%B7%E4%BF%A1%E6%81%AF\"><\/span>\u67e5\u770b\u5f53\u524d\u7528\u6237\u4fe1\u606f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">[shiming@redhat ~]$ id\nuid=1000(shiming) gid=1000(shiming) groups=1000(shiming),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"passwd_%E6%96%87%E4%BB%B6%E6%A0%BC%E5%BC%8F\"><\/span>passwd \u6587\u4ef6\u683c\u5f0f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.cyberciti.biz\/media\/ssb.images\/uploaded_images\/passwd-file-791527.png\" alt=\"\" \/><\/p>\n<ol>\n<li><strong>Username<\/strong>: It is used when user logs in. It should be between 1 and 32 characters in length.<\/li>\n<li><strong>Password<\/strong>: An x character indicates that encrypted password is stored in \/etc\/shadow file. Please note that you need to use the passwd command to computes the hash of a password typed at the CLI or to store\/update the hash of the password in \/etc\/shadow file.<\/li>\n<li><strong>User ID (UID)<\/strong>: Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by system for administrative and system accounts\/groups.<\/li>\n<li><strong>Group ID (GID)<\/strong>: The primary group ID (stored in \/etc\/group file)<\/li>\n<li><strong>User ID Info<\/strong>: The comment field. It allow you to add extra information about the users such as user\u2019s full name, phone number etc. This field use by finger command.<\/li>\n<li><strong>Home directory<\/strong>: The absolute path to the directory the user will be in when they log in. If this directory does not exists then users directory becomes \/<\/li>\n<li><strong>Command\/shell<\/strong>: The absolute path of a command or shell (\/bin\/bash). Typically, this is a shell. Please note that it does not have to be a shell.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"%E5%9C%A8_passwd_%E6%96%87%E4%BB%B6%E4%B8%AD%E6%90%9C%E7%B4%A2%E7%94%A8%E6%88%B7\"><\/span>\u5728 passwd \u6587\u4ef6\u4e2d\u641c\u7d22\u7528\u6237<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u641c\u7d22\u7528\u6237 tom<\/p>\n<pre><code class=\"language-bash \">$ grep tom \/etc\/passwd\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E7%BB%84\"><\/span>\u7ec4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u4e0e\u7528\u6237\u4e00\u6837\uff0c\u7ec4\u4e5f\u6709\u540d\u79f0\u548c\u7f16\u53f7\uff08GID)\u3002\u672c\u5730\u7ec4\u5728\/etc\/group \u4e2d\u5b9a\u4e49<\/p>\n<h4>\u4e3b\u8981\u7ec4<\/h4>\n<ul>\n<li>\u6bcf\u4e2a\u7528\u6237\u53ea\u6709\u4e00\u4e2a\u4e3b\u8981\u7ec4<\/li>\n<li>\u5bf9\u4e8e\u672c\u5730\u7528\u6237\uff0c\u4e3b\u8981\u7ec4\u901a\u8fc7\/etc\/passwd \u7b2c\u56db\u4e2a\u5b57\u6bb5\u5b9a\u4e49<\/li>\n<li>\u901a\u5e38\uff0c\u7528\u6237\u521b\u5efa\u7684\u65b0\u6587\u4ef6\u5f52\u4e3b\u8981\u7ec4\u6240\u6709<\/li>\n<li>\u901a\u5e38\uff0c\u65b0\u5efa\u7528\u6237\u7684\u4e3b\u8981\u7ec4\u662f\u540d\u79f0\u4e0e\u7528\u6237\u76f8\u540c\u7684\u65b0\u5efa\u7ec4\uff0c\u7528\u6237\u662f\u6b64\u7528\u6237\u4e13\u7528\u7ec4\uff08UPG)\u7684\u552f\u4e00\u6210\u5458<\/li>\n<\/ul>\n<h4>\u8865\u5145\u7ec4<\/h4>\n<p>\u7528\u6237\u53ef\u4ee5\u662f\u96f6\u4e2a\u6216\u591a\u4e2a\u8865\u5145\u7ec4\u7684\u6210\u5458\u3002<br \/>\n\u5c5e\u4e8e\u672c\u5730\u7ec4\u8865\u5145\u6210\u5458\u7684\u7528\u6237\u5217\u5728\/etc\/group \u4e2d\u7ec4\u6761\u76ee\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u4e2d\u3002\u5bf9\u4e8e\u672c\u5730\u7ec4\uff0c\u6210\u5458\u8eab\u4efd\u7531\/etc\/group \u4e2d\u7ec4\u6761\u76ee\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u4e2d\u7684\u9017\u53f7\u5206\u9694\u7528\u6237\u5217\u8868\u786e\u5b9a\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8C%85%E7%AE%A1%E7%90%86\"><\/span>\u5305\u7ba1\u7406<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u4e0d\u540c\u7684\u53d1\u884c\u7248\u6709\u4e0d\u540c\u7684\u5305\u7ba1\u7406\u7a0b\u5e8f<\/p>\n<table>\n<thead>\n<tr>\n<th>Operating System<\/th>\n<th>Format<\/th>\n<th>Tool(s)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Debian<\/td>\n<td>.deb<\/td>\n<td>apt, apt-cache, apt-get, dpkg<\/td>\n<\/tr>\n<tr>\n<td>Ubuntu<\/td>\n<td>.deb<\/td>\n<td>apt, apt-cache, apt-get, dpkg<\/td>\n<\/tr>\n<tr>\n<td>CentOS<\/td>\n<td>.rpm<\/td>\n<td>yum<\/td>\n<\/tr>\n<tr>\n<td>Fedora<\/td>\n<td>.rpm<\/td>\n<td>dnf<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD<\/td>\n<td>Ports, .txz<\/td>\n<td>make, pkg<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9B%B4%E6%96%B0%E5%8C%85%E5%88%97%E8%A1%A8\"><\/span>\u66f4\u65b0\u5305\u5217\u8868<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>System<\/th>\n<th>Command<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Debian \/ Ubuntu<\/td>\n<td>sudo apt-get update<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo apt update<\/td>\n<\/tr>\n<tr>\n<td>CentOS<\/td>\n<td>yum check-update<\/td>\n<\/tr>\n<tr>\n<td>Fedora<\/td>\n<td>dnf check-update<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Packages<\/td>\n<td>sudo pkg update<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Ports<\/td>\n<td>sudo portsnap fetch update<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9B%B4%E6%96%B0%E5%B7%B2%E5%AE%89%E8%A3%85%E7%9A%84%E5%8C%85\"><\/span>\u66f4\u65b0\u5df2\u5b89\u88c5\u7684\u5305<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>System<\/th>\n<th>Command<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Debian \/ Ubuntu<\/td>\n<td>sudo apt-get upgrade<\/td>\n<td>Only upgrades installed packages, where possible.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo apt-get dist-upgrade<\/td>\n<td>May add or remove packages to satisfy new dependencies.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo apt upgrade<\/td>\n<td>Like apt-get upgrade.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo apt full-upgrade<\/td>\n<td>Like apt-get dist-upgrade.<\/td>\n<\/tr>\n<tr>\n<td>CentOS<\/td>\n<td>sudo yum update<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Fedora<\/td>\n<td>sudo dnf upgrade<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Packages<\/td>\n<td>sudo pkg upgrade<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Ports<\/td>\n<td>less \/usr\/ports\/UPDATING<\/td>\n<td>Uses less to view update notes for ports (use arrow keys to scroll, press q to quit).<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>cd \/usr\/ports\/ports-mgmt\/portmaster &amp;&amp; sudo make install &amp;&amp; sudo portmaster -a<\/td>\n<td>Installs portmaster and uses it to update installed ports.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E6%90%9C%E7%B4%A2%E5%8C%85\"><\/span>\u641c\u7d22\u5305<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>System<\/th>\n<th>Command<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Debian \/ Ubuntu<\/td>\n<td>apt-cache search search_string<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>apt search search_string<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>CentOS<\/td>\n<td>yum search search_string<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>yum search all search_string<\/td>\n<td>Searches all fields, including description.<\/td>\n<\/tr>\n<tr>\n<td>Fedora<\/td>\n<td>dnf search search_string<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>dnf search all search_string<\/td>\n<td>Searches all fields, including description.<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Packages<\/td>\n<td>pkg search search_string<\/td>\n<td>Searches by name.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>pkg search -f search_string<\/td>\n<td>Searches by name, returning full descriptions.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>pkg search -D search_string<\/td>\n<td>Searches description.<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Ports<\/td>\n<td>cd \/usr\/ports &amp;&amp; make search name=package<\/td>\n<td>Searches by name.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>cd \/usr\/ports &amp;&amp; make search key=search_string<\/td>\n<td>Searches comments, descriptions, and dependencies.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E5%8C%85%E4%BF%A1%E6%81%AF\"><\/span>\u67e5\u770b\u5305\u4fe1\u606f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>System<\/th>\n<th>Command<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Debian \/ Ubuntu<\/td>\n<td>apt-cache show package<\/td>\n<td>Shows locally-cached info about a package.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>apt show package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>dpkg -s package<\/td>\n<td>Shows the current installed status of a package.<\/td>\n<\/tr>\n<tr>\n<td>CentOS<\/td>\n<td>yum info package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>yum deplist package<\/td>\n<td>Lists dependencies for a package.<\/td>\n<\/tr>\n<tr>\n<td>Fedora<\/td>\n<td>dnf info package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>dnf repoquery &#8211;requires package<\/td>\n<td>Lists dependencies for a package.<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Packages<\/td>\n<td>pkg info package<\/td>\n<td>Shows info for an installed package.<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Ports<\/td>\n<td>cd \/usr\/ports\/category\/port &amp;&amp; cat pkg-descr<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BB%8E%E5%BA%93%E4%B8%AD%E5%AE%89%E8%A3%85%E5%8C%85\"><\/span>\u4ece\u5e93\u4e2d\u5b89\u88c5\u5305<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>System<\/th>\n<th>Command<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Debian \/ Ubuntu<\/td>\n<td>sudo apt-get install package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo apt-get install package1 package2 &#8230;<\/td>\n<td>Installs all listed packages.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo apt-get install -y package<\/td>\n<td>Assumes &#8220;yes&#8221; where apt would usually prompt to continue.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo apt install package<\/td>\n<td>Displays a colored progress bar.<\/td>\n<\/tr>\n<tr>\n<td>CentOS<\/td>\n<td>sudo yum install package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo yum install package1 package2 &#8230;<\/td>\n<td>Installs all listed packages.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo yum install -y package<\/td>\n<td>Assumes &#8220;yes&#8221; where yum would usually prompt to continue.<\/td>\n<\/tr>\n<tr>\n<td>Fedora<\/td>\n<td>sudo dnf install package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo dnf install package1 package2 &#8230;<\/td>\n<td>Installs all listed packages.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo dnf install -y package<\/td>\n<td>Assumes &#8220;yes&#8221; where dnf would usually prompt to continue.<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Packages<\/td>\n<td>sudo pkg install package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo pkg install package1 package2 &#8230;<\/td>\n<td>Installs all listed packages.<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Ports<\/td>\n<td>cd \/usr\/ports\/category\/port &amp;&amp; sudo make install<\/td>\n<td>Builds and installs a port from source.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5b89\u88c5\u5305\u65f6\u81ea\u52a8\u786e\u8ba4\u52a0<code>-y<\/code>\u9009\u9879<\/p>\n<pre><code class=\"language-bash \">sudo apt install -y nginx\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BB%8E%E6%9C%AC%E5%9C%B0%E5%AE%89%E8%A3%85%E5%8C%85\"><\/span>\u4ece\u672c\u5730\u5b89\u88c5\u5305<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>System<\/th>\n<th>Command<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Debian \/ Ubuntu<\/td>\n<td>sudo dpkg -i package.deb<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo apt-get install -y gdebi &amp;&amp; sudo gdebi package.deb<\/td>\n<td>Installs and uses gdebi to install package.deb and retrieve any missing dependencies.<\/td>\n<\/tr>\n<tr>\n<td>CentOS<\/td>\n<td>sudo yum install package.rpm<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Fedora<\/td>\n<td>sudo dnf install package.rpm<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Packages<\/td>\n<td>sudo pkg add package.txz<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo pkg add -f package.txz<\/td>\n<td>Installs package even if already installed.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E5%88%A0%E9%99%A4%E4%B8%80%E4%B8%AA%E6%88%96%E5%A4%9A%E4%B8%AA%E5%8C%85\"><\/span>\u5220\u9664\u4e00\u4e2a\u6216\u591a\u4e2a\u5305<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>System<\/th>\n<th>Command<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Debian \/ Ubuntu<\/td>\n<td>sudo apt-get remove package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo apt remove package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo apt-get autoremove<\/td>\n<td>Removes unneeded packages.<\/td>\n<\/tr>\n<tr>\n<td>CentOS<\/td>\n<td>sudo yum remove package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Fedora<\/td>\n<td>sudo dnf erase package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Packages<\/td>\n<td>sudo pkg delete package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>sudo pkg autoremove<\/td>\n<td>Removes unneeded packages.<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Ports<\/td>\n<td>sudo pkg delete package<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>cd \/usr\/ports\/path_to_port &amp;&amp; make deinstall<\/td>\n<td>De-installs an installed port.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E5%B8%AE%E5%8A%A9\"><\/span>\u67e5\u770b\u5e2e\u52a9<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>System<\/th>\n<th>Command<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Debian \/ Ubuntu<\/td>\n<td>man apt-get<\/td>\n<td>Updating the local package database and working with packages.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>man apt-cache<\/td>\n<td>Querying the local package database.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>man dpkg<\/td>\n<td>Working with individual package files and querying installed packages.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>man apt<\/td>\n<td>Working with a more concise, user-friendly interface to most basic operations.<\/td>\n<\/tr>\n<tr>\n<td>CentOS<\/td>\n<td>man yum<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Fedora<\/td>\n<td>man dnf<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Packages<\/td>\n<td>man pkg<\/td>\n<td>Working with pre-compiled binary packages.<\/td>\n<\/tr>\n<tr>\n<td>FreeBSD Ports<\/td>\n<td>man ports<\/td>\n<td>Working with the Ports Collection.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"apt_vs_apt-get\"><\/span>apt vs apt-get<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5efa\u8bae\u4f7f\u7528 apt \u66ff\u4ee3 apt-get\uff0capt \u662f apt-get \u4e0e apt-cache \u7684\u5e38\u7528\u547d\u4ee4\u96c6\u6210<\/p>\n<table>\n<thead>\n<tr>\n<th>apt<\/th>\n<th>apt-get<\/th>\n<th>function<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>apt install<\/td>\n<td>apt-get install<\/td>\n<td>Installs a package<\/td>\n<\/tr>\n<tr>\n<td>apt remove<\/td>\n<td>apt-get remove<\/td>\n<td>Removes a package<\/td>\n<\/tr>\n<tr>\n<td>apt purge<\/td>\n<td>apt-get purge<\/td>\n<td>Removes package with configuration<\/td>\n<\/tr>\n<tr>\n<td>apt update<\/td>\n<td>apt-get update<\/td>\n<td>Refreshes repository index<\/td>\n<\/tr>\n<tr>\n<td>apt upgrade<\/td>\n<td>apt-get upgrade<\/td>\n<td>Upgrades all upgradable packages<\/td>\n<\/tr>\n<tr>\n<td>apt autoremove<\/td>\n<td>apt-get autoremove<\/td>\n<td>Removes unwanted packages<\/td>\n<\/tr>\n<tr>\n<td>apt full-upgrade<\/td>\n<td>apt-get dist-upgrade<\/td>\n<td>Upgrades packages with auto-handling of dependencies<\/td>\n<\/tr>\n<tr>\n<td>apt search<\/td>\n<td>apt-cache search<\/td>\n<td>Searches for the program<\/td>\n<\/tr>\n<tr>\n<td>apt show<\/td>\n<td>apt-cache show<\/td>\n<td>Shows package details<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"%E6%9B%B4%E5%A4%9A%E8%B5%84%E6%BA%90\"><\/span>\u66f4\u591a\u8d44\u6e90<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/ubuntu-and-debian-package-management-essentials\">This guide<\/a> covers Ubuntu and Debian package management in detail.<br \/>\nThere&#8217;s an <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.centos.org\/docs\/5\/html\/yum\/\">official CentOS guide<\/a> to managing software with yum.<br \/>\nThere&#8217;s a <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/fedoraproject.org\/wiki\/Dnf\">Fedora wiki page about dnf<\/a>, and an <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/dnf.readthedocs.org\/en\/latest\/index.html\">official manual for dnf<\/a> itself.<br \/>\n<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-manage-packages-on-freebsd-10-1-with-pkg\">This guide<\/a> covers FreeBSD package management using pkg.<br \/>\nThe <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.freebsd.org\/doc\/handbook\/\">FreeBSD Handbook<\/a> contains a <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.freebsd.org\/doc\/handbook\/ports-using.html\">section on using the Ports Collection<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%B8%B8%E7%94%A8_bash_%E5%91%BD%E4%BB%A4\"><\/span>\u5e38\u7528 bash \u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"find\"><\/span>find<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u9012\u5f52\u641c\u7d22\u5f53\u524d\u76ee\u5f55\uff0c\u540d\u5b57\u4e3a tecmint.txt<\/p>\n<pre><code class=\"language-bash \"># find . -name tecmint.txt\n\n.\/tecmint.txt\n<\/code><\/pre>\n<p>\u9012\u5f52\u641c\/home \u76ee\u5f55<\/p>\n<pre><code class=\"language-bash \"># find \/home -name tecmint.txt\n\n\/home\/tecmint.txt\n<\/code><\/pre>\n<p>\u4e0d\u533a\u5206\u5c0f\u5199\u641c\u7d22<\/p>\n<pre><code class=\"language-bash \"># find \/home -iname tecmint.txt\n\n.\/tecmint.txt\n.\/Tecmint.txt\n<\/code><\/pre>\n<p>\u641c\u7d22\u76ee\u5f55\u540d<\/p>\n<pre><code class=\"language-bash \"># find \/ -type d -name Tecmint\n\n\/Tecmint\n<\/code><\/pre>\n<p>find <code>-type<\/code>\u53c2\u6570<\/p>\n<pre><code class=\"language-text \">     -type t\n             True if the file is of the specified type.  Possible file types are as follows:\n\n             b       block special\n             c       character special\n             d       directory\n             f       regular file\n             l       symbolic link\n             p       FIFO\n             s       socket\n<\/code><\/pre>\n<p>\u67e5\u627e java \u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># find . -name '*.java'\n\nperson.java\nmain.java\n<\/code><\/pre>\n<p>\u914d\u5408 xargs \u4f7f\u7528\uff1a\u9012\u5f52\u641c\u7d22\u5f53\u524d\u76ee\u5f55\uff0c\u540d\u5b57\u4e3a.java \u7ed3\u5c3e\u7684\u6587\u4ef6\uff0c\u5e76\u9644\u52a0\u5230 src.txt \u4e2d<\/p>\n<pre><code class=\"language-bash \"># find . -name '*.java' | xargs cat &gt;&gt; src.txt\n<\/code><\/pre>\n<p>\u627e\u51fa 777 \u6743\u9650\u7684\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># find . -perm 777\n<\/code><\/pre>\n<p>\u627e\u51fa\u6240\u6709\u7684\u7a7a\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \">find \/tmp -type f -empty\n<\/code><\/pre>\n<p>\u627e\u51fa\u6240\u6709\u7684\u7a7a\u6587\u4ef6\u5939<\/p>\n<pre><code class=\"language-bash \"># find \/tmp -type d -empty\n<\/code><\/pre>\n<p>\u627e\u51fa\u6240\u6709\u7684\u9690\u85cf\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># find \/tmp -type f -name \".*\"\n<\/code><\/pre>\n<p>\u627e\u51fa\u67d0\u4e2a\u7528\u6237\u7684\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># find \/ -user root -name tecmint.txt\n<\/code><\/pre>\n<p>\u627e\u51fa\u67d0\u4e2a\u7ec4\u7684\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># find \/home -group developer\n<\/code><\/pre>\n<p>\u627e\u51fa\u8fd1 50 \u5929\u4fee\u6539\u7684\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># find \/ -mtime 50\n<\/code><\/pre>\n<p>\u627e\u51fa\u8fd1 50 \u5929\u6253\u5f00\u8fc7\u7684\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># find \/ -atime 50\n<\/code><\/pre>\n<p>\u627e\u51fa 50~100 \u5929\u5185\u4fee\u6539\u7684\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># find \/ -mtime +50 \u2013mtime -100\n<\/code><\/pre>\n<p>1 \u5c0f\u65f6\u5185\u6709\u6587\u4ef6\u5c5e\u6027\u53d8\u5316<\/p>\n<pre><code class=\"language-bash \"># find \/ -cmin -60\n<\/code><\/pre>\n<p>1 \u5c0f\u65f6\u6587\u4ef6\u5185\u5bb9\u53d8\u5316<\/p>\n<pre><code class=\"language-bash \"># find \/ -mmin -60\n<\/code><\/pre>\n<p>\u5927\u4e8e 50 \u5c0f\u4e8e 100M \u7684\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># find \/ -size +50M -size -100M\n<\/code><\/pre>\n<p>\u627e\u51fa\u5e76\u5220\u9664\u5927\u4e8e 10M \u7684 mp3 \u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \"># find \/ -type f -name *.mp3 -size +10M -exec rm {} +\n<\/code><\/pre>\n<p>find \u627e\u51fa\u8def\u5f84\u540e\u914d\u5408\u5176\u4ed6\u547d\u4ee4\u4f7f\u7528\uff1a<\/p>\n<pre><code class=\"language-bash \"># \u63a8\u8350\uff0c\u5e76\u884c\u5904\u7406\uff0c\u65e0\u9700\u501f\u52a9\u7ba1\u9053\nfind . -exec cmd {} +\n\n# \u63a8\u8350\uff0c\u5e76\u884c\u5904\u7406\uff0c\u901f\u5ea6\u5feb\nfind . -print0 | xargs -0 cmd\n\n# \u6587\u4ef6\u540d\u6709\u7a7a\u683c\u65f6\u5c06\u4e0d\u80fd\u5904\u7406\nfind . | xargs cmd\n\n# \u4e0d\u63a8\u8350\uff0c\u547d\u4ee4\u4e00\u884c\u884c\u6267\u884c\uff0c\u4e0d\u662f\u5e76\u884c\uff0c\u901f\u5ea6\u6700\u6162\nfind . -exec cmd {} \\;\n<\/code><\/pre>\n<p><strong>\u53c2\u8003<\/strong>\uff1a<br \/>\n<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.tecmint.com\/35-practical-examples-of-linux-find-command\/\">35 \u4e2a find \u793a\u4f8b<\/a><br \/>\n<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.cnblogs.com\/hnhycnlc888\/p\/9199738.html\">linux find \u4e2d\u7684-print0 \u548c xargs \u4e2d-0 \u7684\u5965\u5999<\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"sed\"><\/span>sed<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>sed \u7684\u610f\u601d\u662f Stream EDitor\uff0c\u5373\u6d41\u5f0f\u7f16\u8f91\u5668\uff0csed \u547d\u4ee4\u5b9e\u73b0\u5bf9\u6587\u4ef6\u7684\u201d\u589e\u5220\u6539\u67e5\u201c\uff0c\u73a9\u8f6c sed \u662f\u5199\u81ea\u52a8\u5316\u811a\u672c\u5fc5\u987b\u7684\u57fa\u7840\u4e4b\u4e00\u3002<\/p>\n<p>sed \u9075\u5faa\u7b80\u5355\u7684\u5de5\u4f5c\u6d41\uff1a<\/p>\n<ol>\n<li>\u8bfb\u53d6\uff08\u4ece\u8f93\u5165\u4e2d\u8bfb\u53d6\u67d0\u4e00\u884c\uff09<\/li>\n<li>\u6267\u884c\uff08\u5728\u67d0\u4e00\u884c\u4e0a\u6267\u884c sed \u547d\u4ee4\uff09<\/li>\n<li>\u663e\u793a\uff08\u628a\u7ed3\u679c\u663e\u793a\u5728\u8f93\u51fa\u4e2d\uff09<\/li>\n<li>\u9ed8\u8ba4\u662f\u663e\u793a\u4fee\u6539\u540e\u5185\u5bb9\uff0c\u4e0d\u4f1a\u4fee\u6539\u539f\u6587\u4ef6\uff0c\u9664\u975e\u4f7f\u7528-i \u53c2\u6570\u3002<\/li>\n<\/ol>\n<p>\u67e5\u627e\u5e76\u66ff\u6362\u6587\u4ef6\u4e2d\u641c\u7d22\u5230\u7684\u5185\u5bb9<br \/>\nlinux \u4e0b:<\/p>\n<pre><code class=\"language-bash \">sed -i 's\/original\/new\/g' file.txt\n<\/code><\/pre>\n<p>mac \u4e0b\u7684 sed \u547d\u4ee4\u7565\u6709\u533a\u522b\uff0c\u524d\u9762\u8fd8\u9700\u8981\u6307\u5b9a\u4e00\u4e2a\u5907\u4efd\u6587\u4ef6\u540e\u7f00\u3002<\/p>\n<pre><code class=\"language-bash \"># \u4ee5\u4e0b\u547d\u4ee4\u6267\u884c\u5b8c\uff0c\u5b58\u5728\u4e24\u4e2a\u6587\u4ef6 file.txt file.txt.bup\nsed -i '.bup' 's\/original\/new\/g' file.txt\n\n# \u5982\u679c\u4e0d\u9700\u8981\u5907\u4efd\u4e5f\u53ef\u4ee5\u8fd9\u4e48\u5199\u7684\nsed -i '' 's\/original\/new\/g' file.txt\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"awk\"><\/span>awk<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h2><span class=\"ez-toc-section\" id=\"http_%E6%96%87%E4%BB%B6%E6%9C%8D%E5%8A%A1%E5%99%A8\"><\/span>http \u6587\u4ef6\u670d\u52a1\u5668<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u5355\u53ef\u9760\u7684 http \u6587\u4ef6\u670d\u52a1\u5668 <code>apache2<\/code> \u6216\u8005\u53eb <code>httpd<\/code> (\u4e24\u8005\u4e00\u6837)\uff0c\u5728 ubuntu \u4e2d<code>apt install apache2<\/code>\uff0ccentos <code>yum install httpd<\/code><\/p>\n<p>apache2 \u7684\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55\u662f <code>\/etc\/apache2<\/code> \u4e3b\u914d\u7f6e\u662f <code>\/etc\/apache2\/apache2.conf<\/code> \u4f46\u662f\u5176\u4ed6\u76ee\u5f55<\/p>\n<p>httpd \u7684\u914d\u7f6e\u6587\u4ef6\u662f <code>\/etc\/httpd\/conf\/httpd.conf<\/code><\/p>\n<p>\u5b89\u88c5\u597d\u540e\u53ef\u901a\u8fc7 <code>systemctl start apache2<\/code> \u542f\u52a8\u670d\u52a1<\/p>\n<p>\u53ef\u901a\u8fc7 netstat \u67e5\u770b\u670d\u52a1\u548c\u7aef\u53e3\u7ed1\u5b9a\u60c5\u51b5<\/p>\n<pre><code class=\"language-bash \">$ netstat -lntpu\ntcp6       0      0 :::80                   :::*                    LISTEN      18256\/apache2\n<\/code><\/pre>\n<p>\u5bf9\u5916\u53ef\u8bbf\u95ee\u7684\u6587\u4ef6\u9ed8\u8ba4\u653e\u7f6e\u5728 <code>\/var\/www\/html<\/code> \u76ee\u5f55\u4e0b\uff0c\u670d\u52a1\u7684\u7aef\u53e3\u9ed8\u8ba4\u4e3a <code>80<\/code><\/p>\n<p>\u4f46\u6587\u4ef6\u53ef\u4ee5\u8f6f\u94fe\u63a5\u81f3 <code>\/var\/www\/html<\/code> \u76ee\u5f55\u4e0b\u800c\u4e0d\u5fc5\u771f\u7684\u79fb\u52a8\u8fc7\u53bb<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E4%B8%8B%E8%BD%BD\"><\/span>\u6587\u4ef6\u4e0b\u8f7d<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u5c0f\u6587\u4ef6\u7528 <code>wget &lt;URL&gt;<\/code><\/p>\n<p>\u5927\u6587\u4ef6\u7528 <code>axel -n 20 &lt;URL&gt;<\/code> \u591a\u7ebf\u7a0b\u4e0b\u8f7d\uff0c\u53ef\u4ee5\u628a\u7f51\u7edc\u8dd1\u6ee1<\/p>\n<p>\u4e0b\u8f7d\u540e\u91cd\u547d\u540d\u6587\u4ef6 <code>wget -O &lt;newFileName&gt; &lt;fileUrl&gt;<\/code><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E5%8E%8B%E7%BC%A9%E5%92%8C%E8%A7%A3%E5%8E%8B\"><\/span>\u6587\u4ef6\u538b\u7f29\u548c\u89e3\u538b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u538b\u7f29\u5927\u6587\u4ef6 <code>tar -c --use-compress-program=pigz -f tar.file dir_to_zip<\/code><\/p>\n<p>\u5927\u6587\u4ef6\u8fb9\u4e0b\u8f7d\u8fb9\u89e3\u538b <code>wget -q -O - &lt;URL&gt; | tar -zxvf -<\/code><\/p>\n<p>\u6307\u5b9a\u4f7f\u7528<code>pigz<\/code>\u89e3\u538b <code>tar -I pigz -xvf &lt;FILE&gt;.tar.gz<\/code><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%AE%9E%E7%94%A8%E6%8A%80%E5%B7%A7\"><\/span>\u5b9e\u7528\u6280\u5de7<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E5%88%A0%E9%99%A4%E9%98%BF%E9%87%8C%E4%BA%91%E7%9B%BE\"><\/span>\u5220\u9664\u963f\u91cc\u4e91\u76fe<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<pre><code class=\"language-bash \">wget http:\/\/update.aegis.aliyun.com\/download\/uninstall.sh &amp;&amp; chmod +x uninstall.sh &amp;&amp; .\/uninstall.sh\n<\/code><\/pre>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<pre><code class=\"language-bash \">wget http:\/\/update.aegis.aliyun.com\/download\/quartz_uninstall.sh &amp;&amp; chmod +x quartz_uninstall.sh &amp;&amp; .\/quartz_uninstall.sh\n<\/code><\/pre>\n<p>\u5220\u9664\u6b8b\u7559<\/p>\n<pre><code class=\"language-bash \">pkill aliyun-service &amp;&amp; rm -fr \/etc\/init.d\/agentwatch \/usr\/sbin\/aliyun-service &amp;&amp; rm -rf \/usr\/local\/aegis*\n<\/code><\/pre>\n<p>\u5c4f\u853d\u4e91\u76fe<\/p>\n<pre><code class=\"language-bash \">iptables -I INPUT -s 140.205.201.0\/28 -j DROP\niptables -I INPUT -s 140.205.201.16\/29 -j DROP\niptables -I INPUT -s 140.205.201.32\/28 -j DROP\niptables -I INPUT -s 140.205.225.192\/29 -j DROP\niptables -I INPUT -s 140.205.225.200\/30 -j DROP\niptables -I INPUT -s 140.205.225.184\/29 -j DROP\niptables -I INPUT -s 140.205.225.183\/32 -j DROP\niptables -I INPUT -s 140.205.225.206\/32 -j DROP\niptables -I INPUT -s 140.205.225.205\/32 -j DROP\niptables -I INPUT -s 140.205.225.195\/32 -j DROP\niptables -I INPUT -s 140.205.225.204\/32 -j DROP\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"ubuntu_%E5%AE%89%E8%A3%85_mysql\"><\/span>ubuntu \u5b89\u88c5 mysql<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\uff081\uff09\u5b89\u88c5<br \/>\nMySQL \u662f\u4e00\u4e2a\u5c0f\u578b\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u5176\u5b89\u88c5\u5206\u4e3a\u670d\u52a1\u7aef\u4e0e\u5ba2\u6237\u7aef<br \/>\n\u5b89\u88c5\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-bash \">$ sudo apt-get install mysql-server mysql-client # \u8fd9\u6837\u5b89\u88c5\u7684\u4f1a\u662fmysql 5.5\u5de6\u53f3\n<\/code><\/pre>\n<p>\u7136\u540e\u4f1a\u770b\u89c1\u8f93\u5165\u5bc6\u7801\u7684\u754c\u9762\uff0c\u4f60\u53ea\u9700\u63a5\u4e0b\u6765\u8f93\u5165\u7ba1\u7406\u5458\u5bc6\u7801\u5c31\u884c\u3002<\/p>\n<p>\uff082\uff09\u4fee\u6539 MySQL \u7684\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \">$ sudo vim \/etc\/mysql\/my.cnf\n<\/code><\/pre>\n<p>\u5c06 bind-address = 127.0.0.1 \u6ce8\u91ca\u6389\uff0c\u5c31\u53ef\u4ee5\u8fdc\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e86<br \/>\nhttps:\/\/github.com\/rackerlabs\/rackspace-how-to\/edit\/master\/content\/cloud-servers\/installing-mysql-server-on-ubuntu.md<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E9%85%8D%E7%BD%AE_mysql\"><\/span>\u914d\u7f6e mysql<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>https:\/\/github.com\/rackerlabs\/rackspace-how-to\/edit\/master\/content\/cloud-servers\/configuring-mysql-server-on-ubuntu.md<\/p>\n<h3><span class=\"ez-toc-section\" id=\"mysql_%E5%BC%80%E5%90%AF%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5\"><\/span>mysql \u5f00\u542f\u8fdc\u7a0b\u8fde\u63a5<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5b89\u88c5 mysql \u540e\u9ed8\u8ba4\u53ea\u652f\u6301 127.0.0.1 \u8bbf\u95ee 3306 \u7aef\u53e3<\/p>\n<pre><code class=\"language-bash \">shiming@ubuntu:\/etc\/mysql\/conf.d$ netstat -aptn\n(Not all processes could be identified, non-owned process info\n will not be shown, you would have to be root to see it all.)\nActive Internet connections (servers and established)\nProto Recv-Q Send-Q Local Address           Foreign Address         State       PID\/Program name\ntcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      -\ntcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -\ntcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -\ntcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -\ntcp        0      0 10.1.1.236:22           10.1.1.232:50221        ESTABLISHED -\ntcp        0      0 10.211.55.7:22          10.211.55.2:50237       ESTABLISHED -\ntcp6       0      0 :::22                   :::*                    LISTEN      -\ntcp6       0      0 ::1:631                 :::*                    LISTEN      -\n<\/code><\/pre>\n<p>\u8981\u60f3\u8ba9 mysql listen 0.0.0.0:3306 \u9700\u8981\u5728\u5176\u914d\u7f6e\u6587\u4ef6<code>\/etc\/mysql\/mysql.conf.d\/mysqld.cnf<\/code>\u627e\u5230<code>bind-address = 127.0.0.1<\/code>\u6539\u6210 <code>bind-address = 0.0.0.0<\/code> \u8fd9\u4e2a\u64cd\u4f5c\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650<\/p>\n<p>\u7136\u540e\u91cd\u542f mysql<br \/>\n<code>systemctl restart mysql<\/code><\/p>\n<p>\u518d\u6b21\u67e5\u770b\u7aef\u53e3\u72b6\u6001\uff0c\u53d1\u73b0\u5df2\u7ecf\u5728\u76d1\u542c 0.0.0.0:3306 \u4e86<\/p>\n<pre><code class=\"language-bash \">shiming@ubuntu:\/etc\/mysql\/mysql.conf.d$ netstat -aptn\n(Not all processes could be identified, non-owned process info\n will not be shown, you would have to be root to see it all.)\nActive Internet connections (servers and established)\nProto Recv-Q Send-Q Local Address           Foreign Address         State       PID\/Program name\ntcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      -\ntcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -\ntcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -\ntcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      -\n<\/code><\/pre>\n<p>\u8bd5\u4e0b\u4f7f\u7528\u5916\u7f51\u5730\u5740\u8fde\u63a5<\/p>\n<pre><code class=\"language-bash \">shiming@ubuntu:\/etc\/mysql\/mysql.conf.d$ mysql -h 10.211.55.7:3306 -u root -p\nEnter password:\nERROR 2005 (HY000): Unknown MySQL server host '10.211.55.7:3306' (0)\nshiming@ubuntu:\/etc\/mysql\/mysql.conf.d$ mysql -h 10.211.55.7 -P 3306 -u root -p\nEnter password:\nERROR 1130 (HY000): Host 'ubuntu.shared' is not allowed to connect to this MySQL server\n<\/code><\/pre>\n<p>\u53d1\u73b0\u5931\u8d25\u4e86\uff0c\u7b2c\u4e00\u4e2a\u539f\u56e0\u662f\u4e0d\u652f\u6301 host:3306 \u8fd9\u6837\u65b9\u5f0f\uff0c\u9700\u8981\u7528-h 10.211.55.7 -P 3306 \u8fd9\u6837\u7684\u65b9\u5f0f\uff0c\u7b2c\u4e8c\u4e2a\u539f\u56e0\u662f mysql \u7684 root \u8d26\u6237\u53ea\u5f00\u542f\u4e86 localhost \u8bbf\u95ee\u6743\u9650,\u767b\u5f55\u540e\u4f7f\u7528<code>SELECT host FROM mysql.user WHERE User = 'root';<\/code>\u547d\u4ee4\u53ef\u67e5\u770b<\/p>\n<pre><code class=\"language-bash \">shiming@ubuntu:\/etc\/mysql\/mysql.conf.d$ mysql -u root -p\nEnter password:\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 6\nServer version: 5.7.23-0ubuntu0.16.04.1 (Ubuntu)\n\nCopyright (c) 2000, 2018, Oracle and\/or its affiliates. All rights reserved.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql&gt; SELECT host FROM mysql.user WHERE User = 'root';\n+-----------+\n| host      |\n+-----------+\n| localhost |\n+-----------+\n1 row in set (0.00 sec)\n<\/code><\/pre>\n<p>\u65b0\u5efa\u4e00\u4e2a mysql user \u8d4b\u4e88\u8fdc\u7a0b\u8bbf\u95ee\u6743\u9650<\/p>\n<pre><code class=\"language-sql \">mysql&gt; CREATE USER 'shiming'@'localhost' IDENTIFIED BY 'pass';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql&gt; GRANT ALL PRIVILEGES ON *.* TO 'shiming'@'localhost' WITH GRANT OPTION;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql&gt; CREATE USER 'shiming'@'%' IDENTIFIED BY 'pass';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql&gt; GRANT ALL PRIVILEGES ON *.* TO 'shiming'@'%' WITH GRANT OPTION;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql&gt; FLUSH PRIVILEGES;\nQuery OK, 0 rows affected (0.00 sec)\n<\/code><\/pre>\n<p>\u4f7f\u7528\u65b0\u5efa\u7684\u7528\u6237\u767b\u5f55\uff0c\u767b\u5f55\u6210\u529f<\/p>\n<h3><span class=\"ez-toc-section\" id=\"ubuntu_%E4%B8%8B_terminal_%E5%A4%8D%E5%88%B6%E7%B2%98%E8%B4%B4%E5%91%BD%E4%BB%A4%E5%BF%AB%E6%8D%B7%E9%94%AE%E8%AE%BE%E7%BD%AE\"><\/span>ubuntu \u4e0b terminal \u590d\u5236\/\u7c98\u8d34\u547d\u4ee4\u5feb\u6377\u952e\u8bbe\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Edit \u2192 Keyboard Shortcuts menu. \u4e0b\u53ef\u914d\u7f6e\u5feb\u6377\u952e<\/p>\n<h3><span class=\"ez-toc-section\" id=\"ssh_%E9%85%8D%E7%BD%AE%E5%85%8D%E5%AF%86%E7%A0%81%E8%BF%9C%E7%A8%8B%E7%99%BB%E9%99%86\"><\/span>ssh \u914d\u7f6e\u514d\u5bc6\u7801\u8fdc\u7a0b\u767b\u9646<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>ssh-copy-id \u5c06\u672c\u5730\u516c\u94a5 copy \u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u5141\u8bb8\u7684\u4e3b\u673a\u4e2d\u53bb<\/p>\n<pre><code class=\"language-bash \">$ ssh-copy-id -i ~\/.ssh\/id_rsa.pub root@47.52.96.235\n\/usr\/bin\/ssh-copy-id: INFO: Source of key(s) to be installed: \"\/Users\/Shiming\/.ssh\/id_rsa.pub\"\nThe authenticity of host '47.52.96.235 (127.0.0.1)' can't be established.\nECDSA key fingerprint is SHA256:H0LIGfcGjxFjilR+V6IQt\/T97MGRczTQvmx2jXE3Irs.\nAre you sure you want to continue connecting (yes\/no)? yes\n\/usr\/bin\/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed\n\/usr\/bin\/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys\nroot@47.52.96.235's password:\n\nNumber of key(s) added:        1\n\nNow try logging into the machine, with:   \"ssh 'root@47.52.96.235'\"\nand check to make sure that only the key(s) you wanted were added.\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"ssh_%E4%BF%9D%E6%8C%81%E8%BF%9E%E6%8E%A5\"><\/span>ssh \u4fdd\u6301\u8fde\u63a5<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>ssh \u8fdc\u7a0b\u8fde\u63a5\u670d\u52a1\u5668\u8001\u662f\u8d85\u65f6\u81ea\u52a8\u65ad\u5f00\uff0c\u5982\u4f55\u4fdd\u6301\u4e0d\u65ad\uff1f<br \/>\n<strong>\u65b9\u6848\u4e00\uff1a\u5728\u5ba2\u6237\u7aef\u8bbe\u7f6e<\/strong><br \/>\n\u65b9\u6cd5\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u5728\u5ba2\u6237\u7aef\u7535\u8111\u4e0a\u7f16\u8f91\uff08\u9700\u8981 root \u6743\u9650\uff09\/etc\/ssh\/ssh_config\uff0c\u5e76\u6dfb\u52a0\u5982\u4e0b\u4e00\u884c\uff1a<\/p>\n<blockquote><p>\n  ServerAliveInterval 30\n<\/p><\/blockquote>\n<p>\u6b64\u540e\u8be5\u7cfb\u7edf\u91cc\u7684\u7528\u6237\u8fde\u63a5 SSH \u65f6\uff0c\u6bcf 30 \u79d2\u4f1a\u53d1\u4e00\u4e2a KeepAlive \u8bf7\u6c42\uff0c\u907f\u514d\u88ab\u8e22\u3002<\/p>\n<p><strong>\u65b9\u6848\u4e8c\uff1a\u5728\u670d\u52a1\u5668\u8bbe\u7f6e<\/strong><br \/>\n\u5982\u679c\u6709\u76f8\u5e94\u7684\u6743\u9650\uff0c\u4e5f\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u7aef\u8bbe\u7f6e\uff0c\u5373\u7f16\u8f91\/etc\/ssh\/sshd_config\uff0c\u5e76\u6dfb\u52a0\uff1a<\/p>\n<blockquote><p>\n  ClientAliveInterval 60\n<\/p><\/blockquote>\n<p>\u91cd\u542f SSH \u670d\u52a1\u5668\u540e\u8be5\u9879\u8bbe\u7f6e\u4f1a\u751f\u6548\u3002\u6bcf\u4e00\u4e2a\u8fde\u63a5\u5230\u6b64\u670d\u52a1\u5668\u4e0a\u7684\u5ba2\u6237\u7aef\u90fd\u4f1a\u53d7\u5176\u5f71\u54cd\u3002\u5e94\u6ce8\u610f\u542f\u7528\u8be5\u529f\u80fd\u540e\uff0c\u5b89\u5168\u6027\u4f1a\u6709\u4e00\u5b9a\u4e0b\u964d\uff08\u6bd4\u5982\u5fd8\u8bb0\u767b\u51fa\u65f6\u2026\u2026\uff09<\/p>\n<h3><span class=\"ez-toc-section\" id=\"mac_%E4%B8%AD%E5%91%BD%E4%BB%A4%E8%A1%8C%E8%B0%83%E7%94%A8%E8%B5%B7_vscode_%E6%89%93%E5%BC%80%E7%9B%AE%E5%BD%95%E6%96%87%E4%BB%B6\"><\/span>mac \u4e2d\u547d\u4ee4\u884c\u8c03\u7528\u8d77 vscode \u6253\u5f00\u76ee\u5f55\/\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>https:\/\/code.visualstudio.com\/docs\/setup\/mac<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1\"><\/span>\u5f00\u673a\u542f\u52a8\u670d\u52a1<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Ubuntu \u5f00\u673a\u4e4b\u540e\u4f1a\u6267\u884c\/etc\/rc.local \u6587\u4ef6\u4e2d\u7684\u811a\u672c\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\/etc\/rc.local \u4e2d\u6dfb\u52a0\u542f\u52a8\u811a\u672c, \u8981\u6dfb\u52a0\u5230\u8bed\u53e5\uff1aexit 0 \u524d\u9762\u624d\u884c\u3002<\/p>\n<pre><code class=\"language-bash \">sudo vi \/etc\/rc.local\n<\/code><\/pre>\n<p>rc.local \u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-bash \">#!\/bin\/sh -e\n#\n# rc.local\n#\n# This script is executed at the end of each multiuser runlevel.\n# Make sure that the script will \"exit 0\" on success or any other\n# value on error.\n#\n# In order to enable or disable this script just change the execution\n# bits.\n#\n# By default this script does nothing.\n\n# add by shiming to auto run in system restart for bitcoin testnet and ethereum testnet\nnohup geth --testnet --datadir \/mnt\/ethereum\/ --syncmode \"full\" --rpc --ws &amp;\nnohup btcd --testnet --datadir \/mnt\/bitcoin\/ &amp;\nexit 0\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8_nginx_%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86%E6%9C%AC%E5%9C%B0%E7%AB%AF%E5%8F%A3\"><\/span>\u4f7f\u7528 nginx \u53cd\u5411\u4ee3\u7406\u672c\u5730\u7aef\u53e3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>nginx \u7684\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\u4e3a <code>\/etc\/nginx\/nginx.conf<\/code><br \/>\n\u4f46\u662f\u5728\u8fd9\u4e2a\u914d\u7f6e\u4e2d include \u4e86\u5176\u4ed6\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash \">        include \/etc\/nginx\/conf.d\/*.conf;\n        include \/etc\/nginx\/sites-enabled\/*;\n<\/code><\/pre>\n<p>\u6240\u4ee5\u6211\u4eec\u5728 conf.d \u4e2d\u7f16\u5199\u914d\u7f6e\u6587\u4ef6\u5373\u53ef <code>\/etc\/nginx\/conf.d\/btcd.conf<\/code><\/p>\n<pre><code class=\"language-bash \">server{\n        listen 9000;   # \u5bf9\u5916\u7aef\u53e3\n        # using web1 sub domain to access\n        server_name 127.0.0.1 47.75.70.201;\n        access_log  \/var\/log\/nginx\/btcd.log;\n\n        location \/ {\n            proxy_pass http:\/\/127.0.0.1:18334; # \u4ee3\u7406\u7aef\u53e3\n            proxy_read_timeout 300;\n            proxy_connect_timeout 300;\n            proxy_redirect     off;\n\n            proxy_set_header   X-Forwarded-Proto $scheme;\n            proxy_set_header   Host              $http_host;\n            proxy_set_header   X-Real-IP         $remote_addr;\n        }\n    }\n<\/code><\/pre>\n<p>\u914d\u7f6e\u5b8c\u4e86\u68c0\u67e5 nginx \u914d\u7f6e\u662f\u5426\u6b63\u786e<\/p>\n<pre><code class=\"language-bash \">$ conf.d nginx -t\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful\n<\/code><\/pre>\n<p>\u91cd\u542f nginx \u751f\u6548\u914d\u7f6e<\/p>\n<pre><code class=\"language-bash \">\u279c  conf.d systemctl restart nginx\n<\/code><\/pre>\n<p>\u67e5\u770b\u7aef\u53e3\u662f\u5426\u88ab\u76d1\u542c<\/p>\n<pre><code class=\"language-bash \">\u279c  conf.d lsof -i:9000\nCOMMAND  PID     USER   FD   TYPE DEVICE SIZE\/OFF NODE NAME\nnginx   2821     root    7u  IPv4 535089      0t0  TCP *:9000 (LISTEN)\nnginx   2822 www-data    7u  IPv4 535089      0t0  TCP *:9000 (LISTEN)\nnginx   2823 www-data    7u  IPv4 535089      0t0  TCP *:9000 (LISTEN)\nnginx   2824 www-data    7u  IPv4 535089      0t0  TCP *:9000 (LISTEN)\nnginx   2825 www-data    7u  IPv4 535089      0t0  TCP *:9000 (LISTEN)\nnginx   2826 www-data    7u  IPv4 535089      0t0  TCP *:9000 (LISTEN)\nnginx   2827 www-data    7u  IPv4 535089      0t0  TCP *:9000 (LISTEN)\nnginx   2828 www-data    7u  IPv4 535089      0t0  TCP *:9000 (LISTEN)\nnginx   2830 www-data    7u  IPv4 535089      0t0  TCP *:9000 (LISTEN)\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E5%9C%A8%E5%91%BD%E4%BB%A4%E8%A1%8C%E4%B8%AD%E8%B0%83%E7%94%A8_sublime_text_%E7%BC%96%E8%BE%91%E6%96%87%E6%9C%AC\"><\/span>\u5728\u547d\u4ee4\u884c\u4e2d\u8c03\u7528 sublime text \u7f16\u8f91\u6587\u672c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<pre><code class=\"language-bash \">ln -s \"\/Applications\/Sublime Text.app\/Contents\/SharedSupport\/bin\/subl\" \/usr\/local\/bin\/sublime\n<\/code><\/pre>\n<p>\u53c2\u8003 https:\/\/olivierlacan.com\/posts\/launch-sublime-text-3-from-the-command-line\/<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E9%9A%90%E8%97%8F%E8%BA%AB%E4%BB%BD\"><\/span>\u9690\u85cf\u8eab\u4efd<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u6e05\u9664 Linux \u7684\u6700\u8fd1\u767b\u5f55\u65e5\u5fd7\u548c Bash \u5386\u53f2 http:\/\/topspeedsnail.com\/clear-last-linux-login-log\/<br \/>\n\u4f7f\u7528 tor \u5b9e\u73b0\u533f\u540d\u626b\u63cf\/SSH \u767b\u5f55 http:\/\/topspeedsnail.com\/use-tor-hide-your-ass\/<\/p>\n<h2><span class=\"ez-toc-section\" id=\"troubleshooting\"><\/span>troubleshooting<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E5%AD%97%E7%AC%A6%E7%BC%96%E7%A0%81%E9%97%AE%E9%A2%98\"><\/span>\u5b57\u7b26\u7f16\u7801\u95ee\u9898<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><strong>-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory<\/strong><br \/>\ncentos ssh \u767b\u5f55\uff0c\u767b\u5f55\u6210\u529f\u4f46\u662f\u62a5 -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory<\/p>\n<pre><code class=\"language-bash \">\u279c  ~ ssh shiming@10.211.55.13\nshiming@10.211.55.13's password:\nLast login: Sat Oct 13 19:33:34 2018\n-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory\n[shiming@centos ~]$\n<\/code><\/pre>\n<p>\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<pre><code class=\"language-bash \">sudo vi \/etc\/environment\n<\/code><\/pre>\n<p>\u7136\u540e\u52a0\u4e0a\u8fd9\u4e24\u884c\uff0c\u518d\u6b21\u767b\u5f55\u5c31\u4e0d\u4f1a\u62a5\u4e86\uff1a<\/p>\n<pre><code class=\"language-text \">LANG=en_US.utf-8\nLC_ALL=en_US.utf-8\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"ssh_connection_refused\"><\/span>ssh connection refused<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>\u5148\u5224\u65ad ssh \u662f\u5426\u5b89\u88c5<\/li>\n<\/ol>\n<pre><code class=\"language-bash \">shiming@ubuntu:\/etc\/ssh$ ps -e | grep ssh\nshiming@ubuntu:\/etc\/ssh$ \/etc\/init.d\/ssh -start\nbash: \/etc\/init.d\/ssh: No such file or directory\nshiming@ubuntu:\/etc\/ssh$ whichis ssh\nwhichis: command not found\n<\/code><\/pre>\n<p>\u53d1\u73b0 ssh \u672a\u5b89\u88c5<\/p>\n<ol start=\"2\">\n<li>\u5b89\u88c5 ssh-server<\/li>\n<\/ol>\n<pre><code class=\"language-bash \">shiming@ubuntu:\/etc\/ssh$ sudo apt-get install openssh-server\n<\/code><\/pre>\n<ol start=\"3\">\n<li>\u542f\u52a8 ssh \u670d\u52a1<\/li>\n<\/ol>\n<pre><code class=\"language-bash \">shiming@ubuntu:\/etc\/ssh$ systemctl start sshd\nshiming@ubuntu:\/etc\/ssh$ ps -e|grep ssh\n 5602 ?        00:00:00 sshd\n<\/code><\/pre>\n<ol start=\"4\">\n<li>\u672c\u5730\u8fde\u63a5 ssh \u8fdb\u884c\u6d4b\u8bd5<\/li>\n<\/ol>\n<pre><code class=\"language-bash \">shiming@ubuntu:\/etc\/ssh$ ssh shiming@localhost\nThe authenticity of host 'localhost (127.0.0.1)' can't be established.\nECDSA key fingerprint is SHA256:fHN3yPgM87SlGdXxzvvCGzqf3ARmN2iyyq9EfNwSMo4.\nAre you sure you want to continue connecting (yes\/no)? yes\nWarning: Permanently added 'localhost' (ECDSA) to the list of known hosts.\nshiming@localhost's password:\nWelcome to Ubuntu 16.04.3 LTS (GNU\/Linux 4.10.0-28-generic x86_64)\n<\/code><\/pre>\n<ol start=\"5\">\n<li>ifconfig \u67e5\u770b\u5916\u7f51\u5730\u5740<br \/>\ninet \u5373\u5916\u7f51\u5730\u5740<\/li>\n<\/ol>\n<pre><code class=\"language-bash \">shiming@ubuntu:\/etc\/ssh$ ifconfig\nenp0s5    Link encap:Ethernet  HWaddr 00:1c:42:28:80:a2\n          inet addr:10.211.55.7  Bcast:10.211.55.255  Mask:255.255.255.0\n          inet6 addr: fe80::2598:3ddc:aea:479b\/64 Scope:Link\n          inet6 addr: fdb2:2c26:f4e4:0:2cb3:821a:c4:a047\/64 Scope:Global\n          inet6 addr: fdb2:2c26:f4e4:0:2991:5c69:98eb:d6a5\/64 Scope:Global\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\n          RX packets:1142 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:840 errors:0 dropped:0 overruns:0 carrier:0\n          collisions:0 txqueuelen:1000\n          RX bytes:1332342 (1.3 MB)  TX bytes:83530 (83.5 KB)\n\nlo        Link encap:Local Loopback\n          inet addr:127.0.0.1  Mask:255.0.0.0\n          inet6 addr: ::1\/128 Scope:Host\n          UP LOOPBACK RUNNING  MTU:65536  Metric:1\n          RX packets:310 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:310 errors:0 dropped:0 overruns:0 carrier:0\n          collisions:0 txqueuelen:1000\n          RX bytes:27329 (27.3 KB)  TX bytes:27329 (27.3 KB)\n<\/code><\/pre>\n<ol start=\"6\">\n<li>\u901a\u8fc7\u5916\u7f51\u8fdb\u884c ssh \u8fde\u63a5\uff08\u7565\uff09<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"vi_%E7%BC%96%E8%BE%91%EF%BC%8C%E4%B8%8A%E4%B8%8B%E5%B7%A6%E5%8F%B3%E7%AE%AD%E5%A4%B4%E5%8F%98%E6%88%90_ABCDdelete_%E9%94%AE%E6%97%A0%E6%B3%95%E5%88%A0%E9%99%A4%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95\"><\/span>vi \u7f16\u8f91\uff0c\u4e0a\u4e0b\u5de6\u53f3\u7bad\u5934\u53d8\u6210 ABCD\/delete \u952e\u65e0\u6cd5\u5220\u9664\u89e3\u51b3\u529e\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>https:\/\/askubuntu.com\/questions\/353911\/hitting-arrow-keys-adds-characters-in-vi-editor<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%85%B3%E9%97%AD_ubuntu_%E5%9B%BE%E5%BD%A2%E7%95%8C%E9%9D%A2\"><\/span>\u5173\u95ed ubuntu \u56fe\u5f62\u754c\u9762<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5173\u95ed\u56fe\u5f62\u754c\u9762\u53ef\u4ee5\u8ba9\u865a\u62df\u673a\u5c11\u5360\u7528\u4e00\u4e9b\u8d44\u6e90<br \/>\n\u53c2\u8003\uff1a https:\/\/wiki.zthxxx.me\/wiki\/%E6%8A%80%E6%9C%AF%E5%BC%80%E5%8F%91\/Linux\/Ubuntu\/Ubuntu-16-%E5%BC%80%E6%9C%BA%E9%BB%98%E8%AE%A4%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%95%8C%E9%9D%A2\/<\/p>\n<pre><code class=\"language-bash \">shiming@ubuntu:~$ sudo systemctl set-default multi-user.target\n[sudo] password for shiming:\nCreated symlink from \/etc\/systemd\/system\/default.target to \/lib\/systemd\/system\/multi-user.target.\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E5%85%B3%E9%97%AD_centos_%E5%9B%BE%E5%BD%A2%E7%95%8C%E9%9D%A2\"><\/span>\u5173\u95ed centos \u56fe\u5f62\u754c\u9762<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">\u279c  ~ systemctl set-default multi-user.target\nRemoved symlink \/etc\/systemd\/system\/default.target.\nCreated symlink from \/etc\/systemd\/system\/default.target to \/usr\/lib\/systemd\/system\/multi-user.target.\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E6%98%BE%E7%A4%BA%E5%BD%93%E5%89%8D%E4%B8%BB%E6%9C%BA%E7%9A%84%E4%BF%A1%E6%81%AF\"><\/span>\u663e\u793a\u5f53\u524d\u4e3b\u673a\u7684\u4fe1\u606f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">$ hostnamectl\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BF%AE%E6%94%B9_hostname\"><\/span>\u4fee\u6539 hostname<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">hostnamectl set-hostname newhostnameyouwant\n<\/code><\/pre>\n<p>\u6ce8\u610f\uff1a<code>\/etc\/hosts<\/code> \u6587\u4ef6\u4e2d 127.0.0.1 \u6620\u5c04\u7684 hostname \u8981\u81ea\u5df1\u624b\u52a8\u4fee\u6539<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%B0%86%E8%BF%9C%E7%A8%8B%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E6%96%87%E4%BB%B6%E5%A4%8D%E5%88%B6%E5%88%B0%E6%9C%AC%E5%9C%B0%E5%89%AA%E8%B4%B4%E6%9D%BF\"><\/span>\u5c06\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u6587\u4ef6\u590d\u5236\u5230\u672c\u5730\u526a\u8d34\u677f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash \">ssh -e none root@47.75.70.201 \"cat \/tmp\/bb.conf\" | pbcopy  #\u5230\u672c\u5730\u526a\u8d34\u677f\npbpaste &gt; \/tmp\/bb.txt #\u672c\u5730\u526a\u8d34\u677f\u5230\u672c\u5730\u6587\u4ef6\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"%E5%8D%87%E7%BA%A7_vim\"><\/span>\u5347\u7ea7 vim<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>https:\/\/stackoverflow.com\/questions\/39861793\/how-update-vim-to-8-0-version-in-osx<\/p>\n<h3><span class=\"ez-toc-section\" id=\"spacevim_%E5%AD%97%E4%BD%93%E9%97%AE%E9%A2%98\"><\/span>spacevim \u5b57\u4f53\u95ee\u9898<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>spacevim \u4f7f\u7528\u7684\u662f nerd \u5b57\u4f53\uff0c\u7cfb\u7edf\u4e00\u822c\u90fd\u6ca1\u6709\u88c5\uff0c\u4f1a\u5bfc\u81f4\u56fe\u6807\u4e71\u7801\uff0c\u867d\u7136\u4e0d\u5f71\u54cd\u4f7f\u7528\uff0c\u4f46\u662f\u770b\u5230\u4e71\u7801\u5f88\u70e6\u4eba<br \/>\n\u5b89\u88c5\u5b57\u4f53\u7684\u6b65\u9aa4\uff08mac \u597d\u88c5\uff0c\u6709 brew \u547d\u4ee4\uff0c\u4ee5\u4e0b\u662f linux \u7684\u5b89\u88c5\u6b65\u9aa4\uff09\uff1a<\/p>\n<ol>\n<li>\u53bb nerd \u5b98\u7f51\u627e\u5230\u5bf9\u5e94\u7684\u7cfb\u7edf https:\/\/nerdfonts.com\/\uff0c\u4e0b\u8f7d\u5b57\u4f53\u538b\u7f29\u6587\u4ef6\uff0c\u6bd4\u5982ubuntu<br \/>\nhttps:\/\/github.com\/ryanoasis\/nerd-fonts\/releases\/download\/v2.0.0\/Ubuntu.zip<\/li>\n<li>\u5728 linux \u4e2d\u89e3\u538b\u5b57\u4f53\u5305\uff0c\u5f97\u5230.ttf \u7684\u5b57\u4f53\u6587\u4ef6<\/li>\n<li>\u5c06\u5b57\u4f53\u6587\u4ef6\u590d\u5236\u5230<code>\/usr\/share\/founts<\/code>\u76ee\u5f55\u6216\u8005<code>\/usr\/local\/share\/fonts<\/code>\u76ee\u5f55\uff0c\u5982\u679c\u76ee\u5f55\u4e0d\u5b58\u5728\u5c31\u65b0\u5efa<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"man_cant_set_the_locale_make_sure_LC_and_LANG_are_correct\"><\/span>man: can&#8217;t set the locale; make sure $LC&#95;&#42; and $LANG are correct<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u95ee\u9898\u539f\u56e0\uff1a <a class=\"wp-editor-md-post-content-link\" href=\"http:\/\/blog.huatai.me\/2015\/12\/03\/Mac-OS-X-ssh-to-Linux-prompt-setlocale-LC-CTYPE-cannot-change-locale-UTF-8\/\">Mac OS X ssh \u767b\u9646 Linux \u662f\u7ec8\u7aef\u63d0\u793a cannot change locale<\/a><br \/>\n<code>man<\/code>\u547d\u4ee4\u8fd0\u884c\u540e\u4e00\u76f4\u51fa\u8fd9\u4e2a\u63d0\u793a\uff0c\u5b57\u7b26\u96c6\u95ee\u9898\uff0c\u5148\u8fd0\u884c\uff1a<\/p>\n<pre><code class=\"language-bash \">sudo locale-gen \"en_US.UTF-8\"\nsudo dpkg-reconfigure locales\n<\/code><\/pre>\n<p>\u7136\u540e\u5728<code>\/etc\/default\/locale<\/code>\u52a0\u5165\u4ee5\u4e0b\u884c<\/p>\n<pre><code class=\"language-text \">LC_ALL=\"en_US.UTF-8\"\n<\/code><\/pre>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/stackoverflow.com\/questions\/45995530\/manpath-cant-set-the-locale-make-sure-lc-and-lang-are-correct\/46946414\">\u53c2\u8003<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"reference\"><\/span>reference<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"bash_reference\"><\/span>bash reference<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>http:\/\/www.gnu.org\/software\/bash\/manual\/bashref.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>linux\u6559\u7a0b\u3001\u70f9\u996a\u4e66<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"no","_lmt_disable":"","footnotes":""},"categories":[109,3,29],"tags":[45,50],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-cookbook","category-linux","category-tutorial","tag-linux","tag-tutorial"],"modified_by":"Shiming","_links":{"self":[{"href":"https:\/\/liushiming.cn\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liushiming.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liushiming.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liushiming.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/liushiming.cn\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":21,"href":"https:\/\/liushiming.cn\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":1186,"href":"https:\/\/liushiming.cn\/wp-json\/wp\/v2\/posts\/72\/revisions\/1186"}],"wp:attachment":[{"href":"https:\/\/liushiming.cn\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liushiming.cn\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/liushiming.cn\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}