{"id":1102,"date":"2019-04-25T12:12:33","date_gmt":"2019-04-25T04:12:33","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=1102"},"modified":"2024-01-27T05:35:53","modified_gmt":"2024-01-26T21:35:53","slug":"alias","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/alias","title":{"rendered":"alias\u547d\u4ee4 &#8211; \u8bbe\u7f6e\u547d\u4ee4\u522b\u540d"},"content":{"rendered":"\n<p>alias\u547d\u4ee4\u6765\u81ea\u82f1\u6587\u5355\u8bcdalias\uff0c\u4e2d\u6587\u8bd1\u4e3a\u201c\u522b\u540d\u201d\uff0c\u5176\u529f\u80fd\u662f\u8bbe\u7f6e\u547d\u4ee4\u522b\u540d\u4fe1\u606f\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528alias\u5c06\u4e00\u4e9b\u8f83\u957f\u7684\u547d\u4ee4\u8fdb\u884c\u7b80\u5199\uff0c\u5f80\u5f80\u51e0\u5341\u4e2a\u5b57\u7b26\u7684\u547d\u4ee4\u4f1a\u53d8\u6210\u51e0\u4e2a\u5b57\u6bcd\uff0c\u4ece\u800c\u5927\u5927\u63d0\u9ad8\u6211\u4eec\u7684\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n\n\n\n<p> \u5fc5\u987b\u4f7f\u7528\u5355\u5f15\u53f7\u5c06\u539f\u6765\u7684\u547d\u4ee4\u5f15\u8d77\u6765\uff0c\u9632\u6b62\u7279\u6b8a\u5b57\u7b26\u5bfc\u81f4\u9519\u8bef\u3002\u5e76\u4e14alias\u547d\u4ee4\u7684\u4f5c\u7528\u53ea\u5c40\u9650\u4e8e\u8be5\u6b21\u767b\u5165\u7684\u64cd\u4f5c\uff0c\u82e5\u8981\u6bcf\u6b21\u767b\u5165\u90fd\u80fd\u4f7f\u7528\u8fd9\u4e9b\u547d\u4ee4\u522b\u540d\uff0c\u5219\u53ef\u5c06\u76f8\u5e94\u7684alias\u547d\u4ee4\u5b58\u653e\u5230bash\u7684\u521d\u59cb\u5316\u6587\u4ef6\/etc\/bashrc\u4e2d\u3002<\/p>\n\n\n\n<p><strong>\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>alias \u53c2\u6570 \u5bf9\u8c61<\/p>\n\n\n\n<p><strong>\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>-p<\/td><td> \u663e\u793a\u7cfb\u7edf\u4e2d\u5df2\u6709\u7684\u547d\u4ee4\u522b\u540d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>\u53c2\u8003\u793a\u4f8b<\/strong><\/p>\n\n\n\n<p>\u67e5\u770b\u7cfb\u7edf\u4e2d\u5df2\u6709\u7684\u547d\u4ee4\u522b\u540d\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[root@linuxcool ~]# alias -p \r\nalias cp='cp -i' \r\nalias egrep='egrep --color=auto' \r\nalias fgrep='fgrep --color=auto' \r\nalias grep='grep --color=auto' \r\nalias l.='ls -d .* --color=auto' \r\nalias ll='ls -l --color=auto' \r\nalias ls='ls --color=auto' \r\nalias mv='mv -i' \r\nalias rm='rm -i' \r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026 \r<\/pre>\n\n\n\n<p>\u65b0\u589e\u4e00\u4e2a\u547d\u4ee4\u522b\u540d\uff08lc\uff09\uff0c\u5176\u4f5c\u7528\u662f\u67e5\u770b\u5f53\u524d\u76ee\u5f55\u4e0b\u6587\u4ef6\u5217\u8868\u53ca\u6743\u9650\u7b49\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[root@linuxcool ~]# alias lc='ls -al' \r\n[root@linuxcool ~]# lc \r\ntotal 48 \r\ndr-xr-x---. 15 root root 4096 Jan 22 14:41 . \r\ndr-xr-xr-x. 17 root root  224 Jan 22 06:34 .. \r\n-rw-------.  1 root root 1387 Jan 22 06:41 anaconda-ks.cfg \r\n-rw-------.  1 root root  127 Jan 22 14:42 .bash_history \r\n-rw-r--r--.  1 root root   18 Aug 13  2023 .bash_logout \r\n-rw-r--r--.  1 root root  176 Aug 13  2023 .bash_profile \r\n-rw-r--r--.  1 root root  176 Aug 13  2023 .bashrc \r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>alias\u547d\u4ee4\u6765\u81ea\u82f1\u6587\u5355\u8bcdalias\uff0c\u4e2d\u6587\u8bd1\u4e3a\u201c\u522b\u540d\u201d\uff0c\u5176\u529f\u80fd\u662f\u8bbe\u7f6e\u547d\u4ee4\u522b\u540d\u4fe1\u606f\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528alias\u5c06\u4e00\u4e9b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1102","post","type-post","status-publish","format-standard","hentry","category-file"],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=1102"}],"version-history":[{"count":24,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1102\/revisions"}],"predecessor-version":[{"id":17383,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1102\/revisions\/17383"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=1102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=1102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=1102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}