{"id":234593,"date":"2022-02-03T10:41:47","date_gmt":"2022-02-03T02:41:47","guid":{"rendered":"https:\/\/gulass.cn\/?p=234593"},"modified":"2022-01-29T15:42:15","modified_gmt":"2022-01-29T07:42:15","slug":"linux-commands-and-techniques","status":"publish","type":"post","link":"https:\/\/gulass.cn\/linux-commands-and-techniques.html","title":{"rendered":"\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e00\u4e0b20\u4e2a\u63d0\u9ad8\u751f\u4ea7\u529b\u7684 Linux \u547d\u4ee4\u4e0e\u6280\u5de7"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8fd9\u91cc\u6709\u4e00\u4e9b\u5f88\u6709\u7528\u7684Linux\u547d\u4ee4\uff0c\u7ec8\u7aef\u6280\u5de7\u548c\u5feb\u6377\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5728\u4f7f\u7528Linux\u547d\u4ee4\u884c\u65f6\u8282\u7701\u5927\u91cf\u65f6\u95f4\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5c06\u5411\u60a8\u6f14\u793a\u4e00\u4e9b\u4e13\u4e1a\u7684Linux\u547d\u4ee4\u6280\u5de7\uff0c\u8fd9\u4e9b\u6280\u5de7\u5c06\u4f7f\u60a8\u8282\u7701\u5927\u91cf\u65f6\u95f4\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u8fd8\u53ef\u4ee5\u907f\u514d\u5f88\u591a\u9ebb\u70e6\uff0c\u800c\u4e14\u5b83\u4e5f\u5c06\u5e2e\u52a9\u60a8\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002
\n\u5e76\u4e0d\u662f\u8bf4\u8fd9\u4e9b\u53ea\u662f\u9488\u5bf9\u521d\u5b66\u8005\u7684Linux\u6280\u5de7\u3002\u5373\u4f7f\u6709\u7ecf\u9a8c\u7684Linux\u7528\u6237\u4e5f\u6709\u53ef\u80fd\u6ca1\u6709\u53d1\u73b0\u8fd9\u4e9b\uff0c\u5c3d\u7ba1\u4f60\u8fd9\u4e9b\u5e74\u6765\u4e00\u76f4\u5728\u4f7f\u7528Linux\u3002
\n\u5f88\u9177\u7684Linux\u7ec8\u7aef\u6280\u5de7\uff0c\u5e2e\u52a9\u60a8\u8282\u7701\u65f6\u95f4\u548c\u63d0\u9ad8\u751f\u4ea7\u529b
\n\u60a8\u5f88\u53ef\u80fd\u5df2\u7ecf\u77e5\u9053\u8fd9\u4e9bLinux\u547d\u4ee4\u4e2d\u7684\u4e00\u4e9b\u6216\u5168\u90e8\u3002\u65e0\u8bba\u54ea\u79cd\u60c5\u51b5\uff0c\u90fd\u6b22\u8fce\u60a8\u5728\u8bc4\u8bba\u90e8\u5206\u4e2d\u5206\u4eab\u60a8\u559c\u6b22\u7684\u6280\u5de7\u3002
\n\u5176\u4e2d\u4e00\u4e9b\u6280\u5de7\u8fd8\u53d6\u51b3\u4e8eshell\u7684\u914d\u7f6e\u65b9\u5f0f\u3002\u73b0\u5728\u8ba9\u6211\u4eec\u5f00\u59cb\uff01<\/p>\n

1\u3001\u4f7f\u7528tab\u952e\u8fdb\u884c\u81ea\u52a8\u5b8c\u6210<\/strong><\/div>\n

\u6211\u5c06\u4ece\u4e00\u4e9b\u770b\u5f97\u89c1\u4f46\u53c8\u975e\u5e38\u91cd\u8981\u7684\u4e8b\u60c5\u5f00\u59cb\uff1atab\u8865\u5168\u3002
\n\u5f53\u60a8\u5f00\u59cb\u5728Linux\u7ec8\u7aef\u4e2d\u952e\u5165\u5185\u5bb9\u65f6\uff0c\u60a8\u53ef\u4ee5\u6309Tab\u952e\uff0c\u5b83\u4f1a\u5efa\u8bae\u6240\u6709\u53ef\u80fd\u7684\u9009\u9879\uff0c\u8fd9\u4e9b\u9009\u9879\u4ee5\u60a8\u5230\u76ee\u524d\u4e3a\u6b62\u6240\u952e\u5165\u7684\u5b57\u7b26\u4e32\u5f00\u5934\u3002
\n\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u8981\u590d\u5236\u540d\u4e3alinuxidc.txt\u7684\u6587\u4ef6\uff0c\u5219\u53ea\u9700\u952e\u5165\u201c cp l \u201d\uff0c\u7136\u540e\u6309tab\u952e\u67e5\u770b\u53ef\u80fd\u7684\u9009\u9879\u3002
\n\"\"
\n\u4f7f\u7528Tab\u952e\u8fdb\u884c\u81ea\u52a8\u5b8c\u6210
\n\u60a8\u4e5f\u53ef\u4ee5\u5728\u5b8c\u6210\u547d\u4ee4\u65f6\u4f7f\u7528Tab\u952e\u3002<\/p>\n

2\u3001\u5207\u6362\u56de\u4e0a\u4e00\u4e2a\u5de5\u4f5c\u76ee\u5f55<\/strong><\/div>\n

\u5047\u8bbe\u60a8\u4ee5\u957f\u76ee\u5f55\u8def\u5f84\u7ed3\u5c3e\uff0c\u7136\u540e\u8f6c\u5230\u5b8c\u5168\u4e0d\u540c\u7684\u8def\u5f84\u4e2d\u7684\u53e6\u4e00\u4e2a\u76ee\u5f55\u3002\u7136\u540e\u60a8\u610f\u8bc6\u5230\u5fc5\u987b\u8fd4\u56de\u5230\u5148\u524d\u6240\u5728\u7684\u76ee\u5f55\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u8981\u505a\u7684\u5c31\u662f\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a
\ncd -
\n\u8fd9\u4f1a\u5c06\u60a8\u5e26\u56de\u5230\u4e0a\u4e00\u4e2a\u5de5\u4f5c\u76ee\u5f55\u3002\u60a8\u65e0\u9700\u8f93\u5165\u957f\u76ee\u5f55\u8def\u5f84\uff0c\u4e5f\u65e0\u9700\u590d\u5236\u7c98\u8d34\u3002
\n\"\"
\n\u5728\u76ee\u5f55\u4e4b\u95f4\u8f7b\u677e\u5207\u6362
\n\u5982\u679c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

[linuxidc@localhost ~\/www.linuxidc.com]$cd -\r\nbash: cd: OLDPWD \u672a\u8bbe\u5b9a<\/pre>\n

\u662f\u56e0\u4e3a cd \u547d\u4ee4\u8bbe\u7f6e\u4e86 OLDPWD \u73af\u5883\u53d8\u91cf\u503c\u3002\u9664\u975e\u4f60\u81f3\u5c11\u6267\u884c\u4e86\u4e00\u6b21 cd \u547d\u4ee4\uff0c\u5426\u5219 OLDPWD \u73af\u5883\u53d8\u91cf\u4e0d\u4f1a\u5305\u542b\u4efb\u4f55\u503c
\ncd - \u548c cd $OLDWPD \u547d\u4ee4\u7684\u6267\u884c\u7ed3\u679c\u5e76\u975e\u5728\u6240\u6709\u73af\u5883\u4e0b\u90fd\u76f8\u540c\u3002<\/p>\n

3\u3001\u8fd4\u56de\u4e3b\u76ee\u5f55<\/strong><\/div>\n

\u8fd9\u592a\u660e\u663e\u4e86\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4eceLinux\u547d\u4ee4\u884c\u4e2d\u7684\u4efb\u4f55\u4f4d\u7f6e\u79fb\u81f3\u4e3b\u76ee\u5f55\uff1a
\ncd ~
\n\u4f46\u662f\uff0c\u60a8\u4e5f\u53ef\u4ee5\u4ec5\u4f7f\u7528cd\u8fd4\u56de\u4e3b\u76ee\u5f55\uff1a
\ncd
\n\u5927\u591a\u6570\u73b0\u4ee3Linux\u53d1\u884c\u7248\u5747\u5df2\u4e3a\u6b64\u547d\u4ee4\u9884\u914d\u7f6e\u4e86shell\u3002\u5728\u8fd9\u91cc\u81f3\u5c11\u53ef\u4ee5\u8282\u7701\u4e24\u6b21\u51fb\u952e\u3002
\n\u5feb\u901f\u8fd4\u56de\u4e3b\u76ee\u5f55<\/p>\n

4\u3001\u5217\u51fa\u76ee\u5f55\u7684\u5185\u5bb9<\/strong><\/div>\n

\u60a8\u4e00\u5b9a\u5728\u60f3\u5728\u5217\u51fa\u76ee\u5f55\u5185\u5bb9\u7684\u547d\u4ee4\u4e2d\u8fd8\u6709\u4e86\u4ec0\u4e48\u6280\u5de7\u3002\u6bcf\u4e2a\u4eba\u90fd\u77e5\u9053\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u4f7f\u7528ls -l\u3002
\n\u5c31\u662f\u8fd9\u6837\u3002\u5927\u591a\u6570\u4eba\u4f7f\u7528ls -l\u6765\u5217\u51fa\u76ee\u5f55\u7684\u5185\u5bb9\uff0c\u800c\u540c\u6837\u7684\u4e8b\u60c5\u4e5f\u53ef\u4ee5\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u5b8c\u6210:
\nll
\n\u540c\u6837\uff0c\u8fd9\u4e5f\u53d6\u51b3\u4e8eLinux\u53d1\u884c\u7248\u548cshell\u914d\u7f6e\uff0c\u4f46\u662f\u60a8\u5f88\u53ef\u80fd\u80fd\u591f\u5728\u5927\u591a\u6570Linux\u53d1\u884c\u7248\u4e2d\u4f7f\u7528\u5b83\u3002
\n\u4f7f\u7528ll\u800c\u4e0d\u662fls -l<\/p>\n

5\u3001\u5728\u4e00\u4e2a\u547d\u4ee4\u4e2d\u8fd0\u884c\u591a\u4e2a\u547d\u4ee4<\/strong><\/div>\n

\u5047\u8bbe\u60a8\u5fc5\u987b\u4e00\u4e2a\u63a5\u4e00\u4e2a\u5730\u8fd0\u884c\u51e0\u4e2a\u547d\u4ee4\u3002\u60a8\u662f\u5426\u5728\u7b49\u5f85\u7b2c\u4e00\u4e2a\u547d\u4ee4\u5b8c\u6210\u8fd0\u884c\uff0c\u7136\u540e\u6267\u884c\u4e0b\u4e00\u4e2a\u547d\u4ee4\uff1f
\n\u90a3\u4e48\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u201c;\u201d\u5206\u9694\u7b26\u3002\u8fd9\u6837\uff0c\u60a8\u53ef\u4ee5\u5728\u4e00\u884c\u4e2d\u8fd0\u884c\u8bb8\u591a\u547d\u4ee4\u3002\u65e0\u9700\u7b49\u5f85\u5148\u524d\u7684\u547d\u4ee4\u5b8c\u6210\u540e\u518d\u6267\u884c\u5176\u4ed6\u4efb\u52a1\u3002<\/p>\n

command_1; command_2; command_3<\/pre>\n
6\u3001\u4ec5\u5728\u4e0a\u4e00\u4e2a\u547d\u4ee4\u6210\u529f\u7684\u60c5\u51b5\u4e0b\uff0c\u624d\u80fd\u5728\u4e00\u4e2a\u547d\u4ee4\u4e2d\u8fd0\u884c\u591a\u4e2a\u547d\u4ee4<\/strong><\/div>\n

\u5728\u4e0a\u4e00\u4e2a\u547d\u4ee4\u4e2d\uff0c\u60a8\u4e86\u89e3\u4e86\u5982\u4f55\u5728\u4e00\u4e2a\u547d\u4ee4\u4e2d\u8fd0\u884c\u591a\u4e2a\u547d\u4ee4\u4ee5\u8282\u7701\u65f6\u95f4\u3002\u4f46\u5f88\u591a\u65f6\u5019\u4f60\u5fc5\u987b\u786e\u4fdd\u547d\u4ee4\u4e0d\u4f1a\u5931\u8d25\u624d\u80fd\u6267\u884c\u4e0b\u4e00\u6761\u547d\u4ee4\uff0c\u90a3\u600e\u4e48\u534a\uff1f
\n\u6bd4\u5982\u60a8\u8981\u6784\u5efa\u4ee3\u7801\uff0c\u7136\u540e\u5728\u6784\u5efa\u6210\u529f\u7684\u60c5\u51b5\u4e0b\u624d\u63a5\u7740\u8fd0\u884cmake\u3002
\n\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528&&\u5206\u9694\u7b26\u3002&&\u786e\u4fdd\u4e0b\u4e00\u6761\u547d\u4ee4\u4ec5\u5728\u4e0a\u4e00\u6761\u547d\u4ee4\u6210\u529f\u6267\u884c\u65f6\u8fd0\u884c\u3002<\/p>\n

command_1 && command_2<\/pre>\n

\u6b64\u547d\u4ee4\u7684\u4e00\u4e2a\u5f88\u597d\u7684\u4f8b\u5b50\u662f\u5f53\u60a8\u4f7f\u7528sudo apt update && sudo apt upgrade\u5347\u7ea7\u7cfb\u7edf\u65f6\u3002<\/p>\n

7\u3001\u8f7b\u677e\u641c\u7d22\u60a8\u4f7f\u7528\u8fc7\u7684\u547d\u4ee4<\/strong><\/div>\n

\u60f3\u8c61\u4e00\u4e0b\u4e00\u79cd\u60c5\u51b5\uff0c\u60a8\u5728\u51e0\u5206\u949f\/\u51e0\u5c0f\u65f6\u524d\u4f7f\u7528\u4e86\u5f88\u957f\u7684\u547d\u4ee4\uff0c\u800c\u60a8\u4e0d\u5f97\u4e0d\u518d\u6b21\u4f7f\u7528\u5b83\u3002\u95ee\u9898\u662f\u60a8\u4e0d\u518d\u8bb0\u5f97\u786e\u5207\u7684\u547d\u4ee4\u4e86\u3002
\n\u53cd\u5411\u641c\u7d22\u662f\u60a8\u7684\u6551\u661f\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u641c\u7d22\u8bcd\u5728\u5386\u53f2\u8bb0\u5f55\u4e2d\u641c\u7d22\u547d\u4ee4\u3002
\n\u53ea\u9700\u4f7f\u7528ctrl + r\u952e\u5373\u53ef\u542f\u52a8\u53cd\u5411\u641c\u7d22\u5e76\u952e\u5165\u547d\u4ee4\u7684\u67d0\u4e9b\u90e8\u5206\u3002\u5b83\u5c06\u67e5\u8be2\u5386\u53f2\u8bb0\u5f55\uff0c\u5e76\u5411\u60a8\u663e\u793a\u4e0e\u641c\u7d22\u8bcd\u5339\u914d\u7684\u547d\u4ee4\u3002
\nctrl + r \u641c\u7d22\u8bcd
\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5b83\u5c06\u4ec5\u663e\u793a\u4e00\u4e2a\u7ed3\u679c\u3002\u8981\u67e5\u770b\u66f4\u591a\u4e0e\u60a8\u7684\u641c\u7d22\u5b57\u8bcd\u5339\u914d\u7684\u7ed3\u679c\uff0c\u60a8\u5c06\u4e0d\u5f97\u4e0d\u53cd\u590d\u4f7f\u7528ctrl + r\u3002\u8981\u9000\u51fa\u53cd\u5411\u641c\u7d22\uff0c\u53ea\u9700\u4f7f\u7528Ctrl + C\u3002
\n\"\"
\n\u5728\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4e2d\u8fdb\u884c\u53cd\u5411\u641c\u7d22
\n\u8bf7\u6ce8\u610f\uff0c\u5728\u67d0\u4e9bBash Shell\u4e2d\uff0c\u8fd8\u53ef\u4ee5\u5728\u641c\u7d22\u8bcd\u4e2d\u4f7f\u7528Page Up\u548cDown\u952e\uff0c\u5b83\u5c06\u81ea\u52a8\u5b8c\u6210\u547d\u4ee4\u3002<\/p>\n

8\u3001\u89e3\u9664Linux\u7ec8\u7aef\u610f\u5916\u51bb\u7ed3\u7684Ctrl + S<\/strong><\/div>\n

\u5728\u5f88\u591a\u7c7bUnix \u7684\u7cfb\u7edf\u4e0a\uff0cCtrl-S \u90fd\u6709\u7279\u6b8a\u7684\u542b\u4e49\uff1a\u5b83\u4f1a\u201c\u51bb\u7ed3\u201d\u7ec8\u7aef\uff08\u5b83\u66fe\u7ecf\u88ab\u7528\u6765\u6682\u505c\u5feb\u901f\u6eda\u52a8\uff09\u3002\u56e0\u4e3a\u201c\u4fdd\u5b58\u201d\u4e00\u822c\u4e5f\u662f\u7528\u8fd9\u4e2a\u5feb\u6377\u952e\uff0c\u6240\u4ee5\u7ecf\u5e38\u4f1a\u6709\u4eba\u4e0d\u5047\u601d\u7d22\u5730\u6309\u4e0b\u8fd9\u4e2a\u5feb\u6377\u952e\uff0c\u7ed3\u679c\u5927\u591a\u6570\u4eba\u90fd\u4f1a\u88ab\u641e\u7cca\u6d82\uff08\u6211\u4e5f\u7ecf\u5e38\u72af\u8fd9\u4e2a\u9519\u8bef\uff09\u3002\u89e3\u51bb\u7ec8\u7aef\u662f\u7528Ctrl-Q\uff0c\u6240\u4ee5\u5982\u679c\u4f60\u5ffd\u7136\u53d1\u89c9\u7ec8\u7aef\u770b\u8d77\u6765\u88ab\u51bb\u7ed3\u4e86\uff0c\u8bd5\u4e00\u4e0bCtrl-Q\uff0c\u770b\u80fd\u4e0d\u80fd\u91ca\u653e\u5b83\u3002<\/p>\n

9\u3001\u79fb\u81f3\u884c\u9996\u6216\u884c\u5c3e<\/strong><\/div>\n

\u5047\u8bbe\u60a8\u6b63\u5728\u952e\u5165\u4e00\u4e2a\u957f\u547d\u4ee4\uff0c\u5e76\u4e14\u5728\u9014\u4e2d\u60a8\u610f\u8bc6\u5230\u5fc5\u987b\u5728\u5f00\u59cb\u65f6\u8fdb\u884c\u4e00\u4e9b\u66f4\u6539\u3002\u60a8\u5c06\u4f7f\u7528\u51e0\u6b21\u5411\u5de6\u952e\u51fb\u79fb\u52a8\u5230\u884c\u7684\u5f00\u5934\u3002\u5e76\u4e14\u7c7b\u4f3c\u5730\u8fdb\u884c\u5230\u8be5\u884c\u7684\u672b\u5c3e\u3002
\n\u5f53\u7136\uff0c\u60a8\u53ef\u4ee5\u5728\u6b64\u5904\u4f7f\u7528Home\u548cEnd\u952e\uff0c\u4f46\u662f\u4e5f\u53ef\u4ee5\u4f7f\u7528Ctrl + A\u8f6c\u5230\u884c\u7684\u5f00\u5934\uff0c\u5e76\u4f7f\u7528Ctrl + E\u8f6c\u5230\u7ed3\u5c3e\u3002
\n\"\"<\/p>\n

\u79fb\u81f3\u8be5\u884c\u7684\u5f00\u5934\u6216\u7ed3\u5c3e
\n\u6211\u53d1\u73b0\u5b83\u6bd4\u4f7f\u7528Home\u548cEnd\u952e\u66f4\u65b9\u4fbf\uff0c\u5c24\u5176\u662f\u5728\u7b14\u8bb0\u672c\u7535\u8111\u4e0a\u3002<\/p>\n

10\u3001\u5b9e\u65f6\u8bfb\u53d6\u65e5\u5fd7\u6587\u4ef6<\/strong><\/div>\n

\u5728\u9700\u8981\u5728\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u65f6\u5206\u6790\u65e5\u5fd7\u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u5c06tail\u547d\u4ee4\u4e0e-F\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002
\ntail -F linuxidc_log
\n\u7b49\u540c\u4e8e--follow=name --retry\uff0c\u6839\u636e\u6587\u4ef6\u540d\u8fdb\u884c\u8ffd\u8e2a\uff0c\u5e76\u4fdd\u6301\u91cd\u8bd5\uff0c\u5373\u8be5\u6587\u4ef6\u88ab\u5220\u9664\u6216\u6539\u540d\u540e\uff0c\u5982\u679c\u518d\u6b21\u521b\u5efa\u76f8\u540c\u7684\u6587\u4ef6\u540d\uff0c\u4f1a\u7ee7\u7eed\u8ffd\u8e2a\u3002<\/p>\n

11\u3001\u8bfb\u53d6\u538b\u7f29\u65e5\u5fd7\u800c\u4e0d\u89e3\u538b\u7f29<\/strong><\/div>\n

\u670d\u52a1\u5668\u65e5\u5fd7\u901a\u5e38\u88abgzip\u538b\u7f29\u4ee5\u8282\u7701\u78c1\u76d8\u7a7a\u95f4\u3002\u8fd9\u7ed9\u5206\u6790\u65e5\u5fd7\u7684\u5f00\u53d1\u4eba\u5458\u6216\u7cfb\u7edf\u7ba1\u7406\u5458\u5e26\u6765\u4e86\u4e00\u4e2a\u95ee\u9898\u3002\u60a8\u53ef\u80fd\u5fc5\u987b\u5c06\u5176scp\u5230\u672c\u5730\uff0c\u7136\u540e\u63d0\u53d6\u5b83\u6765\u8bbf\u95ee\u6587\u4ef6\uff0c\u56e0\u4e3a\u6709\u65f6\u60a8\u6ca1\u6709\u63d0\u53d6\u65e5\u5fd7\u7684\u5199\u6743\u9650\u3002
\n\u503c\u5f97\u5e86\u5e78\u7684\u662f\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cz\u547d\u4ee4\u53ef\u4ee5\u5e2e\u52a9\u60a8\u3002z\u547d\u4ee4\u63d0\u4f9b\u4e86\u7528\u4e8e\u5904\u7406\u65e5\u5fd7\u6587\u4ef6\uff08\u4f8b\u5982less\uff0ccat\uff0cgrep\u7b49\uff09\u7684\u5e38\u89c4\u547d\u4ee4\u7684\u66ff\u4ee3\u65b9\u6cd5\u3002
\n\u8fd9\u6837\u60a8\u5c31\u53ef\u4ee5\u4f7f\u7528zless\uff0czcat\uff0czgrep\u7b49\u547d\u4ee4\u67e5\u770b\u538b\u7f29\u5305\u7684\u5185\u5bb9\uff0c\u751a\u81f3\u4e0d\u5fc5\u663e\u5f0f\u63d0\u53d6\u538b\u7f29\u6587\u4ef6\u3002<\/p>\n

\"\"
\n\u4e0d\u89e3\u538b\u7f29\u8bfb\u53d6\u538b\u7f29\u6587\u4ef6<\/p>\n

12\u3001\u4f7f\u7528 less\u8bfb\u53d6\u6587\u4ef6<\/strong><\/div>\n

\u8981\u67e5\u770b\u6587\u4ef6\u7684\u5185\u5bb9\uff0ccat\u4e0d\u662f\u6700\u4f73\u9009\u62e9\uff0c\u7279\u522b\u662f\u5982\u679c\u6587\u4ef6\u5f88\u5927\u3002cat\u547d\u4ee4\u5c06\u5728\u5c4f\u5e55\u4e0a\u663e\u793a\u6574\u4e2a\u6587\u4ef6\u3002
\n\u60a8\u53ef\u4ee5\u4f7f\u7528Vi\uff0cVim\u6216\u5176\u4ed6\u57fa\u4e8e\u7ec8\u7aef\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u4f46\u662f\u5982\u679c\u60a8\u53ea\u60f3\u8bfb\u53d6\u6587\u4ef6\uff0c\u5219 less \u547d\u4ee4\u662f\u66f4\u597d\u7684\u9009\u62e9\u3002
\nless -N linuxidc.txt
\n\/\/\u6309\u4e0bv\u952e\u6765\u7f16\u8f91\u6587\u4ef6
\n\/\/\u9000\u51fa\u7f16\u8f91\u5668\u540e\uff0c\u4f60\u53ef\u4ee5\u7ee7\u7eed\u7528less\u6d4f\u89c8\u4e86
\n\"\"
\n\u60a8\u53ef\u4ee5\u5728\u66f4\u5c11\u7684\u8303\u56f4\u5185\u641c\u7d22\u5b57\u8bcd\uff0c\u6309\u9875\u79fb\u52a8\uff0c\u9ad8\u4eae\u4e0e\u884c\u53f7\u7b49\u3002<\/p>\n

13\u3001\u4f7f\u7528 !$ \u91cd\u65b0\u4f7f\u7528\u4e0a\u4e00\u4e2a\u547d\u4ee4\u4e2d\u7684\u6700\u540e\u4e00\u9879<\/strong><\/div>\n

\u5728\u8bb8\u591a\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528\u4e0a\u4e00\u4e2a\u547d\u4ee4\u7684\u53c2\u6570\u5f88\u65b9\u4fbf\u3002
\n\u5047\u8bbe\u60a8\u5fc5\u987b\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u7136\u540e\u8fdb\u5165\u65b0\u521b\u5efa\u7684\u76ee\u5f55\u3002\u90a3\u4e48\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528!$\u9009\u9879\u3002
\n\"\"
\n\u4f7f\u7528 !$
\n\u66f4\u597d\u7684\u65b9\u6cd5\u60a8\u53ef\u4ee5\u4f7f\u7528\u4f7f\u7528alt + . \u3002\u5728\u6700\u540e\u4e00\u4e2a\u547d\u4ee4\u7684\u9009\u9879\u4e4b\u95f4\u6765\u56de\u79fb\u52a8\u7684\u6b21\u6570\u3002<\/p>\n

13\u3001\u7528!!\u91cd\u7528\u5f53\u524d\u547d\u4ee4\u4e2d\u7684\u4e0a\u4e00\u4e2a\u547d\u4ee4\u3002<\/strong><\/div>\n

\u60a8\u53ef\u4ee5\u4f7f\u7528!!\u8c03\u7528\u524d\u9762\u7684\u6574\u4e2a\u547d\u4ee4\u3002\u5f53\u60a8\u5fc5\u987b\u8fd0\u884c\u4e00\u4e2a\u547d\u4ee4\u5e76\u610f\u8bc6\u5230\u5b83\u9700\u8981root\u7279\u6743\u65f6\uff0c\u8fd9\u4e00\u70b9\u7279\u522b\u6709\u7528\u3002
\n\u4e00\u4e2a\u5feb\u901f sudo !! \u7701\u53bb\u4e86\u5f88\u591a\u51fb\u952e\u3002
\n\"\"
\n\u7528!!\u91cd\u7528\u5f53\u524d\u547d\u4ee4\u4e2d\u7684\u4e0a\u4e00\u4e2a\u547d\u4ee4\u3002<\/p>\n

15\u3001\u4f7f\u7528\u522b\u540d\u6765\u4fee\u6b63\u9519\u522b\u5b57<\/strong><\/div>\n

\u60a8\u53ef\u80fd\u5df2\u7ecf\u77e5\u9053Linux\u4e2d\u7684\u522b\u540d\u547d\u4ee4\u662f\u4ec0\u4e48\u3002\u4f60\u80fd\u505a\u7684\u662f\uff0c\u7528\u5b83\u4eec\u6765\u4fee\u6b63\u6253\u5b57\u9519\u8bef\u3002
\n\u4f8b\u5982\uff0c\u60a8\u53ef\u80fd\u7ecf\u5e38\u5c06grep\u8f93\u5165\u4e3agerp\u3002\u5982\u679c\u60a8\u4ee5\u8fd9\u79cd\u65b9\u5f0f\u5728\u60a8\u7684bashrc\u4e2d\u653e\u7f6e\u4e00\u4e2a\u522b\u540d\uff1a
\nalias gerp=grep
\n\u8fd9\u6837\uff0c\u60a8\u65e0\u9700\u518d\u6b21\u8f93\u5165\u547d\u4ee4\u3002<\/p>\n

16\u3001\u5728Linux\u7ec8\u7aef\u4e2d\u590d\u5236\u7c98\u8d34<\/strong><\/div>\n

\u8fd9\u4e00\u70b9\u6709\u70b9\u6a21\u68f1\u4e24\u53ef\uff0c\u56e0\u4e3a\u5b83\u53d6\u51b3\u4e8eLinux\u53d1\u884c\u7248\u548c\u7ec8\u7aef\u5e94\u7528\u7a0b\u5e8f\u3002\u4f46\u901a\u5e38\uff0c\u60a8\u5e94\u8be5\u80fd\u591f\u4f7f\u7528\u4ee5\u4e0b\u5feb\u6377\u952e\u590d\u5236\u7c98\u8d34\u547d\u4ee4\uff1a
\n\u9009\u62e9\u8981\u590d\u5236\u7684\u6587\u672c\uff0c\u7136\u540e\u53f3\u952e\u5355\u51fb\u4ee5\u7c98\u8d34\uff08\u5728Putty\u548c\u5176\u4ed6Windows SSH\u5ba2\u6237\u7aef\u4e2d\u6709\u6548\uff09<\/p>\n

\u9009\u62e9\u8981\u590d\u5236\u7684\u6587\u672c\uff0c\u7136\u540e\u5355\u51fb\u9f20\u6807\u4e2d\u952e\uff08\u6eda\u52a8\u6309\u94ae\uff09\u4ee5\u8fdb\u884c\u7c98\u8d34<\/p>\n

Ctrl + Shift + C\u8868\u793a\u590d\u5236\uff0cCtrl + Shift + V\u8868\u793a\u7c98\u8d34<\/p>\n

17\u3001\u7ec8\u6b62\u6b63\u5728\u8fd0\u884c\u7684\u547d\u4ee4\/\u8fdb\u7a0b<\/strong><\/div>\n

\u8fd9\u53ef\u80fd\u592a\u660e\u663e\u4e86\u3002\u5982\u679c\u6709\u4e00\u4e2a\u547d\u4ee4\u6b63\u5728\u8fd0\u884c\u8fd0\u884c\uff0c\u5e76\u4e14\u60a8\u60f3\u9000\u51fa\u8be5\u547d\u4ee4\uff0c\u5219\u53ef\u4ee5\u6309Ctrl + C\u505c\u6b62\u8be5\u6b63\u5728\u8fd0\u884c\u7684\u547d\u4ee4\u3002<\/p>\n

18\u3001\u6e05\u7a7a\u6587\u4ef6\u800c\u4e0d\u5220\u9664\u5b83<\/strong><\/div>\n

\u5982\u679c\u53ea\u60f3\u6e05\u7a7a\u6587\u672c\u6587\u4ef6\u7684\u5185\u5bb9\u800c\u4e0d\u5220\u9664\u6587\u4ef6\u672c\u8eab\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e8e\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

> \u6587\u4ef6\u540d<\/p>\n

\"\"<\/p>\n

19\u3001\u67e5\u627e\u662f\u5426\u6709\u5305\u542b\u7279\u5b9a\u6587\u672c\u7684\u6587\u4ef6<\/strong><\/div>\n

\u5728Linux\u547d\u4ee4\u884c\u4e2d\u6709\u591a\u79cd\u641c\u7d22\u548c\u67e5\u627e\u65b9\u6cd5\u3002\u4f46\u662f\uff0c\u5f53\u60a8\u53ea\u60f3\u67e5\u770b\u662f\u5426\u6709\u5305\u542b\u7279\u5b9a\u6587\u672c\u7684\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

grep -Pri \u8981\u641c\u7d22\u7684\u5b57\u7b26\u4e32 \u8def\u5f84<\/p>\n

\u6211\u5f3a\u70c8\u5efa\u8bae\u60a8\u7cbe\u901afind\u547d\u4ee4\u3002\u300a\u5982\u4f55\u4f7f\u7528find\u547d\u4ee4\u5728Linux\u4e2d\u67e5\u627e\u6587\u4ef6\u300b \u89c1 https:\/\/www.linuxidc.com\/Linux\/2018-07\/153205.htm<\/p>\n

20\u3001\u5bf9\u4efb\u4f55\u547d\u4ee4\u90fd\u53ef\u4f7f\u7528\u5e2e\u52a9\u547d\u4ee4\uff08help\uff09<\/strong><\/div>\n

\u6700\u540e\u6211\u5c06\u7528\u4e00\u4e2a\u66f4\u660e\u663e\u4f46\u5374\u975e\u5e38\u91cd\u8981\u7684\u201c\u6280\u5de7\u201d\u6765\u7ed3\u675f\u672c\u6587\uff0c\u5373\u4f7f\u7528\u547d\u4ee4\u6216\u547d\u4ee4\u884c\u5de5\u5177\u7684\u5e2e\u52a9\u547d\u4ee4\uff08help\uff09\u3002<\/p>\n

\u51e0\u4e4e\u6240\u6709\u7684\u547d\u4ee4\u548c\u547d\u4ee4\u884c\u5de5\u5177\u90fd\u5e26\u6709\u4e00\u4e2a\u5e2e\u52a9\u9875\u9762\uff0c\u663e\u793a\u5982\u4f55\u4f7f\u7528\u8be5\u547d\u4ee4\u3002\u7ecf\u5e38\u4f7f\u7528\u5e2e\u52a9\u4f1a\u544a\u8bc9\u4f60\u8fd9\u4e2a\u5de5\u5177\/\u547d\u4ee4\u7684\u57fa\u672c\u7528\u6cd5\u3002<\/p>\n

\u6bd4\u5982bc\u547d\u4ee4\u7684\u5e2e\u52a9\uff1a<\/p>\n

[linuxidc@localhost ~\/www.linuxidc.com]$bc -help\r\n<\/pre>\n

\"\"<\/p>\n

\u60a8\u6700\u559c\u6b22\u7684Linux\u547d\u4ee4\u884c\u6280\u5de7\uff1f<\/p>\n

\u672c\u6587\u8ba8\u8bba\u7684\u6280\u5de7\u5e94\u8be5\u53ef\u4ee5\u5728\u51e0\u4e4e\u6240\u6709Linux\u53d1\u884c\u7248\u548cshell\u4e2d\u4f7f\u7528\uff0c\u800c\u4e0d\u9700\u8981\u5b89\u88c5\u65b0\u5de5\u5177\u3002\u6211\u8fd8\u5efa\u8bae\u5728Linux\u4e2d\u4f7f\u7528alias\u547d\u4ee4\u5c06\u590d\u6742\u7684\u547d\u4ee4\u66ff\u6362\u4e3a\u7b80\u5355\u7684\u547d\u4ee4\u3002\u53ef\u4ee5\u8ba9\u4f60\u8282\u7701\u5f88\u591a\u65f6\u95f4\u3002<\/p>\n

\u4f60\u4eec\u5e94\u8be5\u8fd8\u6709\u66f4\u591aLinux\u547d\u4ee4\u6280\u5de7\u53ef\u4ee5\u8282\u7701\u65f6\u95f4\u3002\u90a3\u5c31\u8bf7\u5206\u4eab\u4e0b\u5427\uff0c\u8c22\u8c22\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5c06\u5411\u60a8\u6f14\u793a\u4e00\u4e9b\u4e13\u4e1a\u7684Linux\u547d\u4ee4\u6280\u5de7\uff0c\u8fd9\u4e9b\u6280\u5de7\u5c06\u4f7f\u60a8\u8282\u7701\u5927\u91cf\u65f6\u95f4\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u8fd8\u53ef\u4ee5\u907f\u514d\u5f88\u591a\u9ebb\u70e6 […]<\/p>\n","protected":false},"author":1469,"featured_media":234609,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-234593","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\/234593","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=234593"}],"version-history":[{"count":7,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/234593\/revisions"}],"predecessor-version":[{"id":234896,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/234593\/revisions\/234896"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/234609"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=234593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=234593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=234593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}