{"id":68440,"date":"2023-08-02T22:03:13","date_gmt":"2023-08-02T14:03:13","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=68440"},"modified":"2023-08-02T22:03:13","modified_gmt":"2023-08-02T14:03:13","slug":"excellent-command-terminal","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/excellent-command-terminal.html","title":{"rendered":"\u5e72\u8d27\uff1a4 \u4e2a\u7edd\u4f73\u7684\u547d\u4ee4\u884c\u7ec8\u7aef\u7a0b\u5e8f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8ba9\u6211\u4eec\u6765\u770b\u51e0\u4e2a\u7cbe\u5fc3\u8bbe\u8ba1\u7684 CLI \u7a0b\u5e8f\uff0c\u4ee5\u53ca\u5982\u4f55\u89e3\u51b3\u4e00\u4e9b\u53ef\u53d1\u73b0\u6027\u95ee\u9898\u3002\u5728 GUI \u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u83dc\u5355\u3001\u5de5\u5177\u63d0\u793a\u548c\u56fe\u6807\u7528\u4e8e\u5411\u7528\u6237\u5c55\u793a\u529f\u80fd\u3002\u800c\u547d\u4ee4\u884c\u7f3a\u4e4f\u8fd9\u79cd\u80fd\u529b\uff0c\u4f46\u662f\u6709\u529e\u6cd5\u514b\u670d\u8fd9\u4e2a\u95ee\u9898\u3002\u5728\u6df1\u5165\u89e3\u51b3\u65b9\u6848\u4e4b\u524d\uff0c\u6211\u4f1a\u6765\u770b\u770b\u51e0\u4e2a\u6709\u95ee\u9898\u7684 CLI \u7a0b\u5e8f\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4f1a\u6307\u51fa\u547d\u4ee4\u884c\u754c\u9762\u7684\u53ef\u53d1\u73b0\u6027\u7f3a\u70b9\u4ee5\u53ca\u514b\u670d\u8fd9\u4e9b\u95ee\u9898\u7684\u51e0\u79cd\u65b9\u6cd5\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8ba9\u6211\u4eec\u6765\u770b\u51e0\u4e2a\u7cbe\u5fc3\u8bbe\u8ba1\u7684 CLI \u7a0b\u5e8f\uff0c\u4ee5\u53ca\u5982\u4f55\u89e3\u51b3\u4e00\u4e9b\u53ef\u53d1\u73b0\u6027\u95ee\u9898\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4f1a\u6307\u51fa\u547d\u4ee4\u884c\u754c\u9762\u7684\u53ef\u53d1\u73b0\u6027\u7f3a\u70b9\u4ee5\u53ca\u514b\u670d\u8fd9\u4e9b\u95ee\u9898\u7684\u51e0\u79cd\u65b9\u6cd5\u3002
\n\"4
\n\u6211\u559c\u6b22\u547d\u4ee4\u884c\u3002\u6211\u7b2c\u4e00\u6b21\u63a5\u89e6\u547d\u4ee4\u884c\u662f\u5728 1997 \u7684 DOS 6.2 \u4e0a\u3002\u6211\u5b66\u4e60\u4e86\u5404\u79cd\u547d\u4ee4\u7684\u8bed\u6cd5\uff0c\u5e76\u5c55\u793a\u4e86\u5982\u4f55\u5728\u76ee\u5f55\u4e2d\u5217\u51fa\u9690\u85cf\u7684\u6587\u4ef6\uff08attrib<\/span>\uff09\u3002\u6211\u4f1a\u6bcf\u6b21\u4ed4\u7ec6\u68c0\u67e5\u547d\u4ee4\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26\u3002 \u5f53\u6211\u72af\u4e86\u4e00\u4e2a\u9519\u8bef\uff0c\u6211\u4f1a\u4ece\u5934\u5f00\u59cb\u91cd\u65b0\u8f93\u5165\u547d\u4ee4\u3002\u76f4\u5230\u6709\u4e00\u5929\uff0c\u6709\u4eba\u5411\u6211\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528\u5411\u4e0a\u548c\u5411\u4e0b\u7bad\u5934\u6309\u952e\u904d\u5386\u547d\u4ee4\u884c\u5386\u53f2\uff0c\u6211\u88ab\u9707\u60ca\u4e86\u3002<\/p>\n

\u540e\u6765\u5f53\u6211\u63a5\u89e6\u5230 Linux \u65f6\uff0c\u8ba9\u6211\u611f\u5230\u60ca\u559c\u7684\u662f\uff0c\u4e0a\u4e0b\u7bad\u5934\u4fdd\u7559\u4e86\u5b83\u4eec\u904d\u5386\u5386\u53f2\u8bb0\u5f55\u7684\u80fd\u529b\u3002\u6211\u4ecd\u7136\u5f88\u4ed4\u7ec6\u5730\u6253\u5b57\uff0c\u4f46\u662f\u73b0\u5728\uff0c\u6211\u4e86\u89e3\u5982\u4f55\u76f2\u6253\uff0c\u5e76\u4e14\u6211\u80fd\u6253\u7684\u5f88\u5feb\uff0c\u6bcf\u5206\u949f\u53ef\u4ee5\u8fbe\u5230 55 \u4e2a\u5355\u8bcd\u7684\u901f\u5ea6\u3002\u63a5\u7740\u6709\u4eba\u5411\u6211\u5c55\u793a\u4e86 tab \u8865\u5b8c\uff0c\u518d\u4e00\u6b21\u6539\u53d8\u4e86\u6211\u7684\u751f\u6d3b\u3002<\/p>\n

\u5728 GUI \u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u83dc\u5355\u3001\u5de5\u5177\u63d0\u793a\u548c\u56fe\u6807\u7528\u4e8e\u5411\u7528\u6237\u5c55\u793a\u529f\u80fd\u3002\u800c\u547d\u4ee4\u884c\u7f3a\u4e4f\u8fd9\u79cd\u80fd\u529b\uff0c\u4f46\u662f\u6709\u529e\u6cd5\u514b\u670d\u8fd9\u4e2a\u95ee\u9898\u3002\u5728\u6df1\u5165\u89e3\u51b3\u65b9\u6848\u4e4b\u524d\uff0c\u6211\u4f1a\u6765\u770b\u770b\u51e0\u4e2a\u6709\u95ee\u9898\u7684 CLI \u7a0b\u5e8f\uff1a<\/p>\n

1\u3001 MySQL<\/strong><\/div>\n

\u9996\u5148\u8ba9\u6211\u4eec\u770b\u770b\u6211\u4eec\u6240\u949f\u7231\u7684 MySQL REPL\u3002\u6211\u7ecf\u5e38\u53d1\u73b0\u81ea\u5df1\u5728\u8f93\u5165SELECT * FROM<\/span>\u7136\u540e\u6309Tab<\/span>\u7684\u4e60\u60ef\u3002MySQL \u4f1a\u8be2\u95ee\u6211\u662f\u5426\u60f3\u770b\u5230\u6240\u6709\u7684 871 \u79cd\u53ef\u80fd\u6027\u3002\u6211\u7684\u6570\u636e\u5e93\u4e2d\u7edd\u5bf9\u6ca1\u6709 871 \u5f20\u8868\u3002\u5982\u679c\u6211\u9009\u62e9yes<\/span>\uff0c\u5b83\u4f1a\u663e\u793a\u4e00\u5806 SQL \u5173\u952e\u5b57\u3001\u8868\u3001\u51fd\u6570\u7b49\u3002\uff08LCTT \u8bd1\u6ce8\uff1aREPL \u2014\u2014 Read-Eval-Print Loop\uff0c\u4ea4\u4e92\u5f0f\u5f00\u53d1\u73af\u5883\uff09<\/p>\n

\"4<\/p>\n

2\u3001 Python<\/strong><\/div>\n

\u6211\u4eec\u6765\u770b\u53e6\u4e00\u4e2a\u4f8b\u5b50\uff0c\u6807\u51c6\u7684 Python REPL\u3002\u6211\u5f00\u59cb\u8f93\u5165\u547d\u4ee4\uff0c\u7136\u540e\u4e60\u60ef\u6309Tab<\/span>\u952e\u3002\u77a7\uff0c\u63d2\u5165\u4e86\u4e00\u4e2aTab<\/span>\u5b57\u7b26\uff0c\u8003\u8651\u5230Tab<\/span>\u5728 Python \u6e90\u4ee3\u7801\u4e2d\u6ca1\u6709\u7279\u5b9a\u4f5c\u7528\uff0c\u8fd9\u662f\u4e00\u4e2a\u95ee\u9898\u3002<\/p>\n

\"4<\/p>\n

\u597d\u7684\u7528\u6237\u4f53\u9a8c<\/strong><\/span><\/div>\n

\u8ba9\u6211\u770b\u4e0b\u8bbe\u8ba1\u826f\u597d\u7684 CLI \u7a0b\u5e8f\u4ee5\u53ca\u5b83\u4eec\u662f\u5982\u4f55\u514b\u670d\u8fd9\u4e9b\u53ef\u53d1\u73b0\u6027\u95ee\u9898\u7684\u3002<\/p>\n

\u81ea\u52a8\u8865\u5168\uff1a bpython<\/strong><\/span><\/div>\n

Bpython<\/a>\u00a0\u662f\u5bf9 Python REPL \u7684\u4e00\u4e2a\u5f88\u597d\u7684\u66ff\u4ee3\u3002\u5f53\u6211\u8fd0\u884c bpython \u5e76\u5f00\u59cb\u8f93\u5165\u65f6\uff0c\u5efa\u8bae\u4f1a\u7acb\u5373\u51fa\u73b0\u3002\u6211\u6ca1\u7528\u901a\u8fc7\u7279\u6b8a\u7684\u952e\u76d8\u7ed1\u5b9a\u89e6\u53d1\u5b83\uff0c\u751a\u81f3\u6ca1\u6709\u6309\u4e0bTab<\/span>\u952e\u3002<\/p>\n

\"4<\/p>\n

\u5f53\u6211\u51fa\u4e8e\u4e60\u60ef\u6309\u4e0bTab<\/span>\u952e\u65f6\uff0c\u5b83\u4f1a\u7528\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5efa\u8bae\u8865\u5168\u3002\u8fd9\u662f\u7ed9 CLI \u8bbe\u8ba1\u5e26\u6765\u53ef\u53d1\u73b0\u6027\u6027\u7684\u4e00\u4e2a\u5f88\u597d\u7684\u4f8b\u5b50\u3002<\/p>\n

bpython \u7684\u53e6\u4e00\u4e2a\u65b9\u9762\u662f\u53ef\u4ee5\u5c55\u793a\u6a21\u5757\u548c\u51fd\u6570\u7684\u6587\u6863\u3002\u5f53\u6211\u8f93\u5165\u4e00\u4e2a\u51fd\u6570\u7684\u540d\u5b57\u65f6\uff0c\u5b83\u4f1a\u663e\u793a\u8fd9\u4e2a\u51fd\u6570\u9644\u5e26\u7684\u7b7e\u540d\u4ee5\u53ca\u6587\u6863\u5b57\u7b26\u4e32\u3002\u8fd9\u662f\u4e00\u4e2a\u591a\u4e48\u4ee4\u4eba\u96be\u4ee5\u7f6e\u4fe1\u7684\u5468\u5230\u8bbe\u8ba1\u554a\u3002<\/p>\n

\u4e0a\u4e0b\u6587\u611f\u77e5\u8865\u5168\uff1amycli<\/strong><\/div>\n

mycli<\/a> \u662f\u9ed8\u8ba4\u7684 MySQL \u5ba2\u6237\u7aef\u7684\u73b0\u4ee3\u66ff\u4ee3\u54c1\u3002\u8fd9\u4e2a\u5de5\u5177\u5bf9 MySQL \u6765\u8bf4\u5c31\u50cf bpython \u4e4b\u4e8e\u6807\u51c6 Python REPL \u4e00\u6837\u3002mycli \u5c06\u5728\u4f60\u8f93\u5165\u65f6\u81ea\u52a8\u8865\u5168\u5173\u952e\u5b57\u3001\u8868\u540d\u3001\u5217\u548c\u51fd\u6570\u3002<\/p>\n

\u8865\u5168\u5efa\u8bae\u662f\u4e0a\u4e0b\u6587\u76f8\u5173\u7684\u3002\u4f8b\u5982\uff0c\u5728SELECT * FROM<\/span>\u4e4b\u540e\uff0c\u53ea\u6709\u6765\u81ea\u5f53\u524d\u6570\u636e\u5e93\u7684\u8868\u624d\u4f1a\u5217\u51fa\uff0c\u800c\u4e0d\u662f\u6240\u6709\u53ef\u80fd\u7684\u5173\u952e\u5b57\u3002<\/p>\n

\"4<\/p>\n

\u6a21\u7cca\u641c\u7d22\u548c\u5728\u7ebf\u5e2e\u52a9\uff1a pgcli<\/strong><\/div>\n

\u5982\u679c\u60a8\u6b63\u5728\u5bfb\u627e PostgreSQL \u7248\u672c\u7684 mycli\uff0c\u8bf7\u770b\u770b pgcli<\/a>\u3002 \u4e0e mycli \u4e00\u6837\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e0a\u4e0b\u6587\u611f\u77e5\u7684\u81ea\u52a8\u8865\u5168\u3002\u83dc\u5355\u4e2d\u7684\u9879\u76ee\u4f7f\u7528\u6a21\u7cca\u641c\u7d22\u7f29\u5c0f\u8303\u56f4\u3002\u6a21\u7cca\u641c\u7d22\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6574\u4f53\u5b57\u7b26\u4e32\u4e2d\u7684\u4efb\u610f\u5b50\u5b57\u7b26\u4e32\u6765\u5c1d\u8bd5\u627e\u5230\u6b63\u786e\u7684\u5339\u914d\u9879\u3002<\/p>\n

\"4<\/p>\n

pgcli \u548c mycli \u5728\u5176 CLI \u4e2d\u90fd\u5b9e\u73b0\u4e86\u8fd9\u4e2a\u529f\u80fd\u3002\u659c\u6760\u547d\u4ee4\u7684\u6587\u6863\u4e5f\u4f5c\u4e3a\u8865\u5168\u83dc\u5355\u7684\u4e00\u90e8\u5206\u5c55\u793a\u3002<\/p>\n

\u53ef\u53d1\u73b0\u6027: fish<\/strong><\/div>\n

\u5728\u4f20\u7edf\u7684 Unix shell\uff08Bash\u3001zsh \u7b49\uff09\u4e2d\uff0c\u6709\u4e00\u79cd\u641c\u7d22\u5386\u53f2\u8bb0\u5f55\u7684\u65b9\u6cd5\u3002\u6b64\u641c\u7d22\u6a21\u5f0f\u7531Ctrl-R<\/span>\u89e6\u53d1\u3002\u5f53\u518d\u6b21\u8c03\u7528\u4f60\u4e0a\u5468\u8fd0\u884c\u8fc7\u7684\u547d\u4ee4\u65f6\uff0c\u4f8b\u5982 ssh<\/strong>\u6216 docker<\/strong>\uff0c\u8fd9\u662f\u4e00\u4e2a\u4ee4\u4eba\u96be\u4ee5\u7f6e\u4fe1\u7684\u6709\u7528\u7684\u5de5\u5177\u3002 \u4e00\u65e6\u4f60\u77e5\u9053\u8fd9\u4e2a\u529f\u80fd\uff0c\u4f60\u4f1a\u53d1\u73b0\u81ea\u5df1\u7ecf\u5e38\u4f1a\u4f7f\u7528\u5b83\u3002<\/p>\n

\u5982\u679c\u8fd9\u4e2a\u529f\u80fd\u662f\u5982\u6b64\u6709\u7528\uff0c\u90a3\u4e3a\u4ec0\u4e48\u4e0d\u6bcf\u6b21\u90fd\u641c\u7d22\u5462\uff1f\u8fd9\u6b63\u662f fish<\/strong>\u00a0shell<\/a> \u6240\u505a\u7684\u3002\u4e00\u65e6\u4f60\u5f00\u59cb\u8f93\u5165\u547d\u4ee4\uff0cfish<\/strong> \u5c06\u5f00\u59cb\u5efa\u8bae\u4e0e\u5386\u53f2\u8bb0\u5f55\u7c7b\u4f3c\u7684\u547d\u4ee4\u3002\u7136\u540e\uff0c\u4f60\u53ef\u4ee5\u6309\u53f3\u7bad\u5934\u952e\u63a5\u53d7\u8be5\u5efa\u8bae\u3002<\/p>\n

\u547d\u4ee4\u884c\u89c4\u77e9<\/strong><\/div>\n

\u6211\u5df2\u7ecf\u56de\u987e\u4e86\u4e00\u4e9b\u89e3\u51b3\u53ef\u53d1\u73b0\u6027\u7684\u95ee\u9898\u7684\u521b\u65b0\u65b9\u6cd5\uff0c\u4f46\u4e5f\u6709\u4e00\u4e9b\u57fa\u672c\u7684\u547d\u4ee4\u884c\u529f\u80fd\u5e94\u8be5\u4f5c\u4e3a\u6bcf\u4e2a REPL \u6240\u5b9e\u73b0\u57fa\u7840\u529f\u80fd\u7684\u4e00\u90e8\u5206\uff1a<\/p>\n