{"id":200455,"date":"2020-09-23T08:48:35","date_gmt":"2020-09-23T00:48:35","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=200455"},"modified":"2020-09-11T09:50:07","modified_gmt":"2020-09-11T01:50:07","slug":"ubuntu-linux-terminal","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/ubuntu-linux-terminal.html","title":{"rendered":"Ubuntu Linux\u7ec8\u7aef\u989c\u8272\u4e2a\u6027\u5316\u8bbe\u7f6e\u6280\u5de7"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nLinux\u7ed9\u4eba\u6700\u5927\u7684\u4f18\u70b9\u4e4b\u4e00\u5c31\u662f\u53ef\u4ee5\u6839\u636e\u4e2a\u4eba\u559c\u597d\u53bb\u5b9a\u5236\u4ee4\u81ea\u5df1\u559c\u6b22\u7684\u7cfb\u7edf\u914d\u7f6e\uff0c\u6bd4\u5982\u7ec8\u7aef\u989c\u8272\u7684\u8bbe\u7f6e\u5c31\u662f\u4e00\u4e2a\u7ecf\u5178\u4f8b\u5b50\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5bf9\u4e8e\u521d\u6b21\u4f7f\u7528Ubuntu\u7684\u540c\u5b66\u4eec\uff0c\u6253\u5f00\u7ec8\u7aef\uff08\u5feb\u6377\u952e\u4e3aCtrl + Alt + T\uff09\uff0c\u5c31\u4f1a\u53d1\u73b0\u547d\u4ee4\u884c\u91cc\u7684\u7528\u6237\u540d\u3001\u4e3b\u673a\u540d\u8fd8\u662f\u547d\u4ee4\u90fd\u662f\u767d\u8272\u7684\uff0c\u5f53\u7136\uff0c\u6211\u4eec\u7528 ls \u5217\u51fa\u6587\u4ef6\u7684\u65f6\u5019\u662f\u4f1a\u591a\u4e00\u79cd\u989c\u8272\u7684\u3002\u4f46\u662f\u5bf9\u4e8e\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u8fd8\u662f\u4e0d\u591f\u9ad8\u6548\u7684\u56e0\u4e3a\u6709\u65f6\u5019\u4f60\u9700\u8981\u53bb\u51e0\u5341\u884c\u751a\u81f3\u4e0a\u767e\u884c\u4ee3\u7801\u91cc\u9762\u53bb\u627e\u4e00\u4e9b\u4f60\u8fd0\u884c\u8fc7\u7684\u547d\u4ee4\u6216\u4f60\u60f3\u8981\u7684\u4fe1\u606f\u3002\u56e0\u6b64\u5c06\u7ec8\u7aef\uff08Terminal\uff09\u914d\u8272\u4e5f\u53d8\u7684\u5f88\u91cd\u8981\u3002<\/p>\n

\u672c\u6587\u64cd\u4f5c\u7684\u4f8b\u5b50\u64cd\u4f5c\u7cfb\u7edf\u4e3a\uff1aUbuntu 18.04 LTS<\/p>\n

\u5bf9\u4e8e\u7528\u6237\u7684\u914d\u7f6e\uff0c\u6211\u4eec\u5e94\u8be5\u5c06\u914d\u7f6e\u4fe1\u606f\u5199\u5165~\/.bashrc\u6587\u4ef6\u3002<\/p>\n

\"\" \"\" \"\"<\/p>\n

1\u3001\u989c\u8272\u914d\u7f6e<\/strong><\/span><\/div>\n

\u4e3a\u4e86\u8bbe\u7f6e\u7ec8\u7aef\u989c\u8272\uff0c\u6211\u4eec\u9700\u8981\u5bf9\uff5e\/.bashrc\u6587\u4ef6\u4e2d\u7684PS1\u53d8\u91cf\u8fdb\u884c\u5b9a\u5236\u3002\u9996\u5148\u901a\u8fc7\u201cvim ~\/.bashrc\u201c\u547d\u4ee4\u6253\u5f00\u6587\u4ef6\uff0c\u627e\u5230PS1\u53d8\u91cf\u6240\u5728\u4f4d\u7f6e\uff1a<\/p>\n

\"\"<\/p>\n

bashrc\u6587\u4ef6\u4e2d\u7684PS1\u53d8\u91cf<\/p>\n

\u4e0a\u56fe\u5c31\u662f\u6211\u4eec\u9700\u8981\u4fee\u6539\u7684\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u7684\u989c\u8272\u8bbe\u7f6e\u3002<\/p>\n

\u6ce8\u91ca\u6389 #force_color_prompt=yes\u3002\u5728\u989c\u8272\u6a21\u5f0f\u6253\u5f00\u7684\u60c5\u51b5\u4e0b\uff0cPS1\u53d8\u91cf\u4ee3\u8868\u7684\u5185\u5bb9\u5c31\u662f\u7528\u6237\u540d+\u4e3b\u673a\u540d+\u8def\u5f84\u540d\uff08\u957f\u8def\u5f84\uff09+ $<\/p>\n

PS1='${debian_chroot:+($debian_chroot)}\\u@\\h:\\w\\$ '<\/pre>\n

\u73b0\u5728\uff0c\u6211\u4eec\u5c31\u9700\u8981\u5bf9\u663e\u793a\u7684\u4fe1\u606f\u7684\u5b57\u4f53\u989c\u8272\u8fdb\u884c\u8bbe\u7f6e\uff0c\u9996\u5148\u770b\u4e00\u4e0b\u989c\u8272\u662f\u5982\u4f55\u8bbe\u7f6e\u7684\uff1a<\/p>\n

\u4e00\u4e2a\u5355\u72ec\u7684\u989c\u8272\u8bbe\u7f6e:\u00a0 \\033[\u4ee3\u7801;\u524d\u666f;\u80cc\u666fm\u00a0 \u00a0 \u00a0 \uff0c\u5982\uff1a\\[\\033[1;32;40m\\]\u8868\u793a\u9ad8\u4eae\u663e\u793a\u5b57\u4f53\u4e3a\u7eff\u8272\uff0c\u80cc\u666f\u8272\u4e3a\u9ed1\u8272\u3002<\/p>\n

\u6ce8\u610f\uff1a\u989c\u8272\u7684\u8bbe\u7f6e\uff0c\u653e\u5728\u76f8\u5e94\u7684\u8981\u8bbe\u7f6e\u7684\u524d\u9762\uff0c\u5982\u7528\u6237\u540d\u989c\u8272\u8bbe\u7f6e\uff1a\u00a0 \\[\\033[01;35;40m\\]\\u<\/p>\n

\u6211\u4eec\u53ef\u4ee5\u628a\u7b2c\u4e00\u4e2aPS1\u66ff\u6362\u6210\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n

PS1='${debian_chroot:+($debian_chroot)}\\[\\033[01;35;40m\\]\\u\\[\\033[00;00;40m\\]@\\[\\033[01;35;40m\\]\\h\\[\\033[00;31;40m\\]:\\[\\033[00;00;40m\\]\\w\u00a0\\[\\033[01;32;40m\\]\\$\u00a0\\[\\033[01;36;40m\\]'<\/pre>\n

\"\"<\/p>\n

\u6216\u8005\u6211\u4eec\u628a\u7b2c\u4e00\u4e2aPS1\u66ff\u6362\u6210\u5982\u4e0b\u4ee3\u7801<\/p>\n

#PS1='\\[\\e[37;1m\\][\\[\\e[31;1m\\]\\u\\[\\e[34;1m\\]@\\[\\e[32;1m\\]\\h\u00a0\\[\\e[31;1m\\]\\w\u00a0\\[\\e[33;1m\\]\\t\\[\\e[37;1m\\]]\\[\\e[32;1m\\]\\$\\[\\e[m\\]'<\/pre>\n

\u7136\u540e\u4f60\u91cd\u542f\u7ec8\u7aef\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u521a\u624d\u7684\u914d\u8272\u6548\u679c\uff0c\u6216\u8005\u6267\u884c source ~\/.bashrc \u547d\u4ee4\u4e5f\u53ef\u4ee5\u8fd0\u884c\u521a\u624d\u7684\u65b0\u914d\u8272\u7ec8\u7aef\u3002\u5982\u4e0b\uff1a<\/p>\n

\u4ee5\u4e0b\u5bf9PS1\u53d8\u91cf\u7684\u8bbe\u7f6e\u8fdb\u884c\u5177\u4f53\u5206\u6790\uff0c\u9996\u5148\u6211\u4eec\u8981\u77e5\u9053\u5982\u4e0b\u51e0\u5f20\u8868\uff1a<\/p>\n

\u4e0b\u9762\u6765\u8bf4\u8bf4\u914d\u8272\u7684\u8fc7\u7a0b\uff1a<\/p>\n

\u524d\u666f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u80cc\u666f\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u989c\u8272<\/strong><\/p>\n

30\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 40\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u9ed1\u8272<\/p>\n

31\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 41\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u7d05\u8272<\/p>\n

32\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 42\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u7da0\u8272<\/p>\n

33\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 43\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u9ec3\u8272<\/p>\n

34\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 44\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u85cd\u8272<\/p>\n

35\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 45\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u7d2b\u7d05\u8272<\/p>\n

36\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 46\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u9752\u85cd\u8272<\/p>\n

37\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 47\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u767d\u8272<\/p>\n

1\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u900f\u660e\u8272<\/p>\n

\u4ee3\u7801\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u610f\u4e49<\/strong><\/p>\n

0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0OFF<\/p>\n

1\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u9ad8\u4eae\u663e\u793a<\/p>\n

4\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0underline<\/p>\n

5\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u95ea\u70c1<\/p>\n

7\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u53cd\u767d\u663e\u793a<\/p>\n

8\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4e0d\u53ef\u89c1<\/p>\n

\u6211\u4e2a\u4eba\u6bd4\u8f83\u559c\u6b22\u628a\u7ec8\u7aef\u6846\u8bbe\u7f6e\u6210\u534a\u900f\u660e\u7684\uff0c\u5728\u7ec8\u7aef\u83dc\u5355\u2192\u7f16\u8f91\u2192\u9996\u9009\u9879\u2192\u672a\u547d\u540d\u2192\u989c\u8272\uff0c\u9009\u62e9\u900f\u660e\u80cc\u666f\uff0c\u8c03\u6210\u4f60\u559c\u6b22\u7684\u900f\u660e\u5ea6\u5373\u53ef\u3002<\/p>\n

\"\"<\/p>\n

\u6548\u679c\u56fe\u5982\u4e0b\uff1a<\/p>\n

\"\"<\/p>\n

\"\"<\/p>\n

\u4e00\u4e9b\u9002\u5408\u7ec8\u7aef\u7684\u5b57\u4f53\uff1a<\/p>\n

[linuxmi@linux:~\/Linux\u8ff7$]\u00a0sudo\u00a0apt-get\u00a0install\u00a0ttf-dejavu\r\n[linuxmi@linux:~\/Linux\u8ff7$]\u00a0sudo\u00a0apt-get\u00a0install\u00a0xfonts-terminus<\/pre>\n

\"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5bf9\u4e8e\u521d\u6b21\u4f7f\u7528Ubuntu\u7684\u540c\u5b66\u4eec\uff0c\u6253\u5f00\u7ec8\u7aef\uff08\u5feb\u6377\u952e\u4e3aCtrl + Alt + T\uff09\uff0c\u5c31\u4f1a\u53d1\u73b0\u547d\u4ee4\u884c\u91cc\u7684\u7528\u6237\u540d\u3001 […]<\/p>\n","protected":false},"author":323,"featured_media":113031,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-200455","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/200455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=200455"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/200455\/revisions"}],"predecessor-version":[{"id":200750,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/200455\/revisions\/200750"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/113031"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=200455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=200455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=200455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}