{"id":207870,"date":"2021-01-06T10:40:55","date_gmt":"2021-01-06T02:40:55","guid":{"rendered":"https:\/\/gulass.cn\/?p=207870"},"modified":"2020-12-30T09:14:41","modified_gmt":"2020-12-30T01:14:41","slug":"unix-linux-tishi","status":"publish","type":"post","link":"https:\/\/gulass.cn\/unix-linux-tishi.html","title":{"rendered":"10 \u4e2a\u63d0\u9ad8\u6548\u7387\u7684 UNIX \u548c Linux \u63d0\u793a"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5982\u679c\u60a8\u7684\u670d\u52a1\u4e5f\u90e8\u7f72\u5728 Linux \u673a\u5668\u4e0a\uff0c\u5e76\u4e14\u60a8\u6bcf\u5929\u6709\u5927\u91cf\u7684\u65f6\u95f4\u82b1\u8d39\u5728UNIX \u547d\u4ee4\u7684\u5927\u91cf\u641c\u7d22\u548c\u64cd\u4f5c\uff0c\u90a3\u4e48\u8fd9\u4e9b\u6280\u5de7\u5c06\u8282\u7701\u5927\u91cf\u65f6\u95f4\u3002\u4ee5\u4e0b\u6280\u5de7\u662f\u6211\u5728 UNIX \u4e2d\u591a\u5e74\u7ecf\u9a8c\u7684\u603b\u7ed3\uff0c\u6211\u603b\u7ed3\u4e86\u5728 UNIX \u4e0a\u5feb\u901f\u5de5\u4f5c\u7684 10 \u6761\u6280\u5de7\uff1a\uff09<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5982\u679c\u60a8\u7684\u670d\u52a1\u4e5f\u90e8\u7f72\u5728 Linux \u673a\u5668\u4e0a\uff0c\u5e76\u4e14\u60a8\u6bcf\u5929\u6709\u5927\u91cf\u7684\u65f6\u95f4\u82b1\u8d39\u5728UNIX \u547d\u4ee4\u7684\u5927\u91cf\u641c\u7d22\u548c\u64cd\u4f5c\uff0c\u90a3\u4e48\u8fd9\u4e9b\u6280\u5de7\u5c06\u8282\u7701\u5927\u91cf\u65f6\u95f4\u3002\u4ee5\u4e0b\u6280\u5de7\u662f\u6211\u5728 UNIX \u4e2d\u591a\u5e74\u7ecf\u9a8c\u7684\u603b\u7ed3\uff0c\u6211\u603b\u7ed3\u4e86\u5728 UNIX \u4e0a\u5feb\u901f\u5de5\u4f5c\u7684 10 \u6761\u6280\u5de7\uff1a\uff09
\n\"\"
\nUNIX\uff0c\u60a8\u5982\u4f55\u5229\u7528Linux\u548c\u5176\u4ed6UNIX\u64cd\u4f5c\u7cfb\u7edf\uff08\u4f8b\u5982Fedora\uff0cUbuntu\uff0cCentOS\u7b49\uff09\u63d0\u4f9b\u7684\u5927\u591a\u6570\u529f\u80fd\u3002\u6211\u671f\u5f85\u7740\u4ece\u4f60\u4eec\u90a3\u91cc\u83b7\u5f97\u66f4\u591a\u6280\u5de7\u6765\u589e\u5f3a\u6211\u7684\u6b66\u5668\u5e93\uff0c\u6240\u4ee5\u8bf7\u5206\u4eab\u60a8\u7684\u5de5\u4f5c\u65b9\u5f0f\u3002\u5f3a\u5927\u7684Linux\u547d\u4ee4\u548cShell\u5b9e\u7528\u7a0b\u5e8f\uff1f<\/p>\n

\u4f7f\u7528\uff01\u7528\u4e8e\u6267\u884c\u6700\u540e\u4e00\u6761\u547d\u4ee4<\/strong><\/div>\n

\u8fd9\u5e73\u5747\u8282\u7701\u4e86\u621130\uff05\u7684\u65f6\u95f4\u3002\u901a\u5e38\uff0c\u60a8\u4f1a\u5728\u51e0\u79d2\u949f\u5185\u591a\u6b21\u89e6\u53d1\u76f8\u540c\u7684UNIX\u547d\u4ee4\uff0c\u7136\u540e\u624d\u77e5\u9053\u6211\u66fe\u7ecf\u4f7f\u7528\u5411\u4e0a\u548c\u5411\u4e0b\u7bad\u5934\u6765\u67e5\u627e\u547d\u4ee4\u7136\u540e\u6267\u884c\u5b83\u4eec\uff0c\u8fd9\u82b1\u8d39\u4e86\u6211\u4e00\u4e9b\u65f6\u95f4\u3002<\/p>\n

\u77e5\u9053\u4e86\u8fd9\u4e2a\u6280\u5de7\u4e4b\u540e\uff0c\u6211\u53ea\u9700\u8981\u8bb0\u4f4f\u547d\u4ee4\u540d\u79f0\u5373\u53ef\uff0c\u4f8b\u5982\uff01ls\u5c06\u6267\u884c\u60a8\u7684\u6700\u540e\u4e00\u4e2a\u201c ls -lrt\u201d\uff0c\u800c \uff01vim\u5c06\u6253\u5f00\u60a8\u7684\u6700\u540e\u4e00\u4e2a\u6587\u4ef6\u800c\u65e0\u9700\u952e\u5165\u5b8c\u6574\u547d\u4ee4\u3002<\/p>\n

\u4f7f\u7528\u6b64\u6280\u5de7\u5e76\u8fdb\u884c\u4f53\u9a8c\uff0c\u5b83\u80af\u5b9a\u53ef\u4ee5\u8282\u7701\u65f6\u95f4\uff0c\u5e76\u4e14\u5728bash shell\uff08\u4f8b\u5982csh\u6216ksh\uff09\u4ee5\u5916\u7684\u5176\u4ed6shell\u4e0a\u4e5f\u5f88\u6709\u7528\uff0c\u5728\u8be5shell\u4e2d\uff0c\u4e0a\u4e0b\u7bad\u5934\u901a\u5e38\u4e0d\u4f1a\u4e3a\u60a8\u63d0\u4f9b\u5148\u524d\u7684\u547d\u4ee4\u3002<\/p>\n

\u4f8b\u5982\uff0c\u5982\u679c\u8981\u6253\u5f00ls \u2013l stocks.txt\uff0cstocks.txt\uff0c\u60a8\u53ef\u4ee5\u5c06vim\u7f16\u8f91\u5668\u5229\u7528 vi\uff01$\uff08\u6700\u540e\u4e00\u4e2a\u53c2\u6570\uff09<\/p>\n

\u4f7f\u7528\u201cCRTL + R\u201d\u91cd\u590d\u4e0a\u4e00\u4e2a\u5339\u914d\u7684\u547d\u4ee4<\/strong><\/div>\n

\u5982\u679c\u60a8\u8bb0\u5f97\u4e0a\u4e00\u4e2a\u547d\u4ee4\u662f\u5728\u67d0\u4e2a\u65f6\u5019\u6267\u884c\u7684\uff0c\u5e76\u4e14\u53ea\u60f3\u67e5\u627e\u5177\u6709\u76f8\u540c\u53c2\u6570\u7684\u547d\u4ee4\u5e76\u6267\u884c\uff0c\u90a3\u4e48\u6700\u597d\u3002\u8fd9\u662f\u60a8\u9700\u8981\u8bb0\u4f4f\u7684\u6280\u5de7\u3002<\/p>\n

\u53ea\u9700\u6309\u201cCRTL + R\u201d\u5e76\u8f93\u5165\u60a8\u5728\u4e0a\u4e00\u4e2a\u547d\u4ee4\u4e2d\u8f93\u5165\u7684\u5355\u8bcd\uff0cUNIX\u5c31\u4f1a\u4e3a\u60a8\u627e\u5230\u8be5\u547d\u4ee4\uff0c\u7136\u540e\u6309Enter\u3002<\/p>\n

\u5982\u679c\u60a8\u80fd\u591f\u6267\u884c\u547d\u4ee4\uff0c\u4ee5\u4e0a\u6280\u5de7\u5c06\u8282\u7701\u5927\u91cf\u65f6\u95f4\uff0c\u5e76\u4e14\u91cd\u590d\u7684\u767e\u5206\u6bd4\u5f88\u9ad8\u3002\u5bf9\u6211\u6765\u8bf4\uff0c\u6211\u8282\u7701\u4e86\u5c06\u8fd150-60\uff05\u7684\u65f6\u95f4\u3002\u8ba9\u6211\u77e5\u9053\u5b83\u5982\u4f55\u66f4\u9ad8\u6548\u7684\u5de5\u4f5c\u3002<\/p>\n

\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u6280\u5de7\uff0c\u5b83\u751a\u81f3\u5728Julia Evans\u56fe\u8868\u4e4b\u4e00\u4e2d\u627e\u5230\u4e86\u4f4d\u7f6e\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0<\/p>\n

\u4f7f\u7528 !! \u7528\u4e8e\u6267\u884c\u6700\u540e\u4e00\u6761\u547d\u4ee4<\/strong><\/div>\n

\u8fd9\u662f\u524d\u4e00\u4e2a\u6280\u5de7\u7684\u6269\u5c55\uff0c\u7528\u4e8e\u6267\u884c\u60a8\u6240\u6267\u884c\u7684\u6700\u540e\u4e00\u6761\u547d\u4ee4\u3002\u7531\u4e8e\u5b83\u53ea\u6d89\u53ca\u4e24\u6b21\u51fb\u952e\uff0c\u800c\u5bf9\u4e8e\u540c\u4e00\u952e\u4e5f\u5982\u6b64\uff0c\u56e0\u6b64\u5b83\u7684\u901f\u5ea6\u975e\u5e38\u5feb\u3002<\/p>\n

\u8fd9\u4e5f\u9002\u7528\u4e8e\u4e0a\u4e0b\u7bad\u5934\u4e0d\u80fd\u50cfK shell\u548cC shell\u4e00\u6837\u5de5\u4f5c\u7684shell\u3002\u5982\u679c\u60a8\u4e3a\u4e86\u91cd\u65b0\u8c03\u8bd5ging\u800c\u505c\u6b62\u6216\u542f\u52a8\u670d\u52a1\u5668\u6216Java\u5e94\u7528\u7a0b\u5e8f\uff0c\u8fd9\u5c06\u975e\u5e38\u6709\u7528\u3002
\n\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0<\/p>\n

\u4f7f\u7528history\u547d\u4ee4\u83b7\u53d6\u4e00\u4e9b\u6700\u5e38\u7528\u7684UNIX\u547d\u4ee4<\/strong><\/div>\n

\u597d\u5427\uff0c\u8fd9\u662f\u6211\u5f00\u59cb\u4f7f\u7528UNIX\u65f6\u5b66\u5230\u7684\u7b2c\u4e00\u4e2a\u6280\u5de7\uff1a\u8fd9\u662fUNIX\u548cShell\u811a\u672c\u4e2d\u6700\u6709\u7528\u7684\u547d\u4ee4\u3002<\/p>\n

\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u90fd\u6709\u67d0\u4e9b\u547d\u4ee4\uff0c\u4f8b\u5982start\uff0cstop\uff0c\u68c0\u67e5\u65e5\u5fd7\u6587\u4ef6\uff0cmaking a build \u6216\u8fdb\u884c\u53d1\u5e03\u7b49\u3002<\/p>\n

\u8fd9\u4e9b\u662f\u60a8\u7ecf\u5e38\u9700\u8981\u6267\u884c\u7684\u547d\u4ee4\uff0c\u5982\u679c\u60a8\u4e0d\u8bb0\u5f97\u5148\u524d\u7684\u547d\u4ee4\uff0c\u5219\u4e0d\u4f1a\u9700\u8981\u62c5\u5fc3\uff0c\u53ea\u9700\u8981 history | grep \u201c\u5173\u952e\u5b57\u201d\uff0c\u60a8\u53ef\u4ee5\u5728Linux\u673a\u5668\u4e0a\u7684\u5386\u53f2\u8bb0\u5f55\u4e2d\u83b7\u53d6\u8be5\u547d\u4ee4\u3002<\/p>\n

\u6709\u67d0\u4e9b\u73af\u5883\u53d8\u91cf\uff0c\u4f8b\u5982HISTSIZE\uff0c\u5b83\u5b9a\u4e49\u4e86UNIX\u5386\u53f2\u8bb0\u5f55\u53ef\u4ee5\u5b58\u50a8\u591a\u5c11\u4e2a\u547d\u4ee4\u3002<\/p>\n

\u5728grep\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u5e76\u67e5\u627e<\/strong><\/div>\n

\u5728grep\u7684\u548cfind\u662f\u4e24\u4e2a\u6700\u597d\u7684\u5de5\u5177UNIX\u63d0\u4f9b\u7ed9\u6211\u4eec\u3002\u51e0\u4e4e\u6bcf\u4e2a\u4eba\u90fd\u9700\u8981\u5728UNIX\u4e2d\u641c\u7d22\u67d0\u4e9b\u5185\u5bb9\uff0c\u4f8b\u5982\u6587\u4ef6\uff0c\u76ee\u5f55\uff0c\u6587\u4ef6\u4e2d\u7684\u67d0\u4e9b\u5355\u8bcd\uff08\u4f8b\u5982ERROR\u6216Exception\uff09\uff0c\u5982\u679c\u60a8\u77e5\u9053\u5982\u4f55\u4f7f\u7528grep\u5e76\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u67e5\u627e\uff0c\u60a8\u5c06\u8282\u7701\u5f88\u591a\u901a\u8fc7\u952e\u5165\u952e\u5165\u7684\u547d\u4ee4\u6765\u8282\u7701\u65f6\u95f4\u3002<\/p>\n

\u4f8b\u5982\uff0c\u901a\u8fc7\u4e86\u89e3egrep\uff0c\u60a8\u53ef\u4ee5\u89e6\u53d1 egrep \"ERROR|Exception\" *.xml\uff0c\u800c\u4e0d\u662f\u89e6\u53d1\u4e24\u4e2agrep\u547d\u4ee4\u5206\u522b\u67e5\u627eERROR\u548cException\u3002<\/p>\n

\u4f7f\u7528\u7ba1\u9053\u4ee3\u66ff\u89e6\u53d1\u4e24\u4e2a\u547d\u4ee4<\/strong><\/div>\n

\u5c31\u50cf\u4e0a\u9762\u8fd9\u4e2a\u5c0f\u5de7\u7684\u6280\u5de7\u6240\u793a\uff0c\u6211\u60f3\u6bcf\u4e2a\u4eba\u90fd\u77e5\u9053:)<\/p>\n

\u4f7f\u7528\u522b\u540d\u5e76\u5728bash\u914d\u7f6e\u6587\u4ef6\u6216bashrc\u6587\u4ef6\u4e2d\u5b9a\u4e49\u5b83\u4eec<\/strong><\/div>\n

\u60a8\u662f\u5426\u770b\u5230\u8fc7\u67d0\u4e9b\u5947\u602a\u7684\u547d\u4ee4\u5728\u67d0\u4eba\u7684\u8ba1\u7b97\u673a\u4e2d\u5de5\u4f5c\uff0c\u800c\u4e0d\u662f\u5728\u60a8\u7684\u8ba1\u7b97\u673a\u4e2d\u5de5\u4f5c\uff0c\u8fd9\u53ef\u80fd\u662f\u4ed6\u5728\u7684.bashrc\u6216.profile\u6587\u4ef6\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u7684\u522b\u540d\uff1f<\/p>\n

\u603b\u662f\u5bf9\u5e38\u7528\u547d\u4ee4\u8fdb\u884c\u8fd9\u79cd\u8bbe\u7f6e\u3002.bashrc\u548c.profile \u6587\u4ef6\u7684\u7528\u6cd5\u5f88\u591a\uff0c\u4f46\u662f\u6700\u91cd\u8981\u7684\u7528\u6cd5\u4e4b\u4e00\u662f\u8bbe\u7f6e\u522b\u540d\uff0c\u4f8b\u5982\u201cl.\u201d\u3002\u67e5\u627e\u6240\u6709\u9690\u85cf\u6587\u4ef6\u3002\u201cls\u201d\u5305\u62ec\u6240\u6709\u6709\u7528\u7684\u9009\u9879\uff0c\u4f8b\u5982 -lrtH \u4ee5\u663e\u793a\u6240\u6709\u76f8\u5173\u4fe1\u606f\u3002<\/p>\n

\u4f7f\u7528push\u3001popd\u3001cd- \u5728\u76ee\u5f55\u4e2d\u79fb\u52a8<\/strong><\/div>\n

\u6839\u636e\u6211\u7684\u7ecf\u9a8c\uff0c\u5728UNIX shell\u4e2d\u8fdb\u884c\u5bfc\u822a\u51e0\u4e4e\u8981\u82b1\u8d3950\uff05\u7684\u65f6\u95f4\uff0c\u5982\u679c\u60a8\u4e0d\u65f6\u7f16\u5199\u76ee\u5f55\u8def\u5f84\uff0c\u90a3\u4e48\u5c31\u5fd8\u4e86\u5feb\u901f\u5de5\u4f5c\u3002\u56e0\u6b64\uff0c\u4e0d\u8981\u4f7f\u7528\u5b8c\u6574\u7684\u540d\u79f0\uff0c\u800c\u8981\u4f7f\u7528\u4e0a\u8ff0\u6240\u6709\u63d0\u793a\uff0c\u5e76\u5145\u5206\u5229\u7528PUSHD\uff0cPOPD\uff0cCD-\u548ccd~\u547d\u4ee4\u3002CD-\u5982\u679c\u5728UNIX\u4e2d\u7684\u4e24\u4e2a\u76ee\u5f55\u4f4d\u7f6e\u4e4b\u95f4\u8fdb\u884c\u5207\u6362\uff0c\u5219\u6700\u597d\u3002<\/p>\n

\u6700\u5c0f\u5316\u6572\u952e\u76d8\u6216\u63d0\u9ad8\u6253\u5b57\u901f\u5ea6<\/strong><\/div>\n

\u6211\u60f3\u60a8\u77e5\u9053\u4e0d\u662f\u5417\uff0c\u60a8\u952e\u5165\u7684\u6b21\u6570\u8d8a\u5c11\uff0c\u4f7f\u7528\u4e0a\u4e00\u4e2a\u952e\u5165\u7684\u547d\u4ee4\u7684\u5de5\u4f5c\u5c31\u8d8a\u5feb\uff0c\u8bf7\u4f7f\u7528bash\u4e2d\u7684\u9009\u9879\u5361\uff0c\u6740\u6b7b\u8ba9UNIX bash shell\u5b8c\u6210\u60a8\u7684\u547d\u4ee4\uff0c\u5982\u679cCtrl + R\u60a8\u952e\u5165\u7684\u6700\u540e\u4e00\u4e2a\u547d\u4ee4\u5f88\u957f\uff0c\u60a8\u53ea\u60f3\u66f4\u6539\u51e0\u884c\u3002<\/p>\n

\u7ee7\u7eed\u5b66\u4e60\u65b0\u7684Linux\u547d\u4ee4<\/strong><\/div>\n

\u5c1d\u8bd5\u5b66\u4e60\u66f4\u591a\u547d\u4ee4\u53ca\u5176\u9009\u9879\uff0c\u5e76\u4f7f\u7528\u5b83\u4f1a\u51cf\u5c11\u601d\u8003\u7279\u5b9a\u4efb\u52a1\u7684\u65f6\u95f4\uff0c\u5e76\u4f7f\u7528ctrl + z\u548cfg\u548cbg\u6682\u505c\u8fdb\u7a0b\u3002<\/p>\n

\u5982\u679c\u60a8\u6b63\u5728\u67e5\u770b\u591a\u4e2a\u6587\u4ef6\u6216\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ea\u9700\u8282\u7701\u8fd110\uff05\u7684\u65f6\u95f4\uff0c\u56e0\u6b64\uff0c\u4e0d\u662f\u7acb\u5373\u6267\u884cvim\u547d\u4ee4\uff0c\u7136\u540e\u7acb\u5373\u6309Ctrl + Z\u6302\u8d77\u5b83\uff0c\u800c\u6267\u884cfg 1\u6216fg 2\u5c06\u5176\u653e\u5728\u524d\u53f0\u3002<\/p>\n

\u8fd9\u662f\u53e6\u4e00\u672c\u6f2b\u753b\uff0c\u4ee5\u8bb0\u4f4f\u4e00\u4e9b\u66f4\u6709\u7528\u7684bash\u6280\u5de7\uff1a
\n\"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5982\u679c\u60a8\u7684\u670d\u52a1\u4e5f\u90e8\u7f72\u5728 Linux \u673a\u5668\u4e0a\uff0c\u5e76\u4e14\u60a8\u6bcf\u5929\u6709\u5927\u91cf\u7684\u65f6\u95f4\u82b1\u8d39\u5728UNIX \u547d\u4ee4\u7684\u5927\u91cf\u641c\u7d22\u548c\u64cd\u4f5c\uff0c\u90a3\u4e48\u8fd9\u4e9b […]<\/p>\n","protected":false},"author":1469,"featured_media":208153,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-207870","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/207870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=207870"}],"version-history":[{"count":6,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/207870\/revisions"}],"predecessor-version":[{"id":208152,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/207870\/revisions\/208152"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/208153"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=207870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=207870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=207870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}