{"id":162859,"date":"2019-11-29T10:34:39","date_gmt":"2019-11-29T02:34:39","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=162859"},"modified":"2019-11-29T14:52:50","modified_gmt":"2019-11-29T06:52:50","slug":"linux-type-student","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-type-student.html","title":{"rendered":"type \u547d\u4ee4\u7684\u7b80\u5355\u6559\u5b66"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\ntype \u547d\u4ee4\u7528\u4e8e\u67e5\u627e Linux \u547d\u4ee4\u7684\u4fe1\u606f\u3002\u987e\u540d\u601d\u4e49\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 type \u547d\u4ee4\u8f7b\u677e\u627e\u51fa\u7ed9\u5b9a\u7684\u547d\u4ee4\u662f\u5426\u662f\u522b\u540d\u3001shell \u5185\u7f6e\u547d\u4ee4\u3001\u6587\u4ef6\u3001\u51fd\u6570\u6216\u5173\u952e\u5b57\u3002\u53e6\u5916\uff0c\u4f60\u4e5f\u53ef\u4ee5\u627e\u5230\u547d\u4ee4\u7684\u5b9e\u9645\u8def\u5f84\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u4e3a\u4ec0\u4e48\u6709\u4eba\u9700\u8981\u627e\u5230\u547d\u4ee4\u7c7b\u578b\uff1f\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7ecf\u5e38\u5728\u5171\u4eab\u7684\u8ba1\u7b97\u673a\u4e0a\u5de5\u4f5c\uff0c\u5219\u67d0\u4e9b\u4eba\u53ef\u80fd\u4f1a\u6545\u610f\u6216\u610f\u5916\u5730\u4e3a\u7279\u5b9a\u7684 Linux \u547d\u4ee4\u521b\u5efa\u522b\u540d\u6765\u6267\u884c\u4e0d\u9700\u8981\u7684\u64cd\u4f5c\uff0c\u4f8b\u5982 alias ls = rm -rf \/\u3002\u56e0\u6b64\uff0c\u5728\u53d1\u751f\u66f4\u7cdf\u7cd5\u7684\u4e8b\u60c5\u4e4b\u524d\u68c0\u67e5\u5b83\u4eec\u603b\u662f\u4e00\u4e2a\u597d\u4e3b\u610f\u3002\u8fd9\u662f type \u547d\u4ee4\u6709\u7528\u7684\u5730\u65b9\u3002<\/p>\n

\u8ba9\u6211\u7ed9\u4f60\u770b\u4e00\u4e9b\u4f8b\u5b50\u3002<\/p>\n

\u4e0d\u5e26\u4efb\u4f55\u9009\u9879\u8fd0\u884c type \u547d\u4ee4\u3002<\/p>\n

$ type ls\r\nls is aliased to `ls --color=auto'<\/pre>\n

\u6b63\u5982\u4f60\u5728\u4e0a\u9762\u7684\u8f93\u51fa\u4e2d\u770b\u5230\u7684\u90a3\u6837\uff0cls \u547d\u4ee4\u5df2\u88ab\u522b\u540d\u4e3a ls -color-auto\u3002\u4f46\u662f\uff0c\u5b83\u662f\u65e0\u5bb3\u7684\u3002\u4f46\u53ea\u8981\u60f3\u60f3 ls \u5982\u679c\u88ab\u522b\u540d\u4e3a\u4e86\u5176\u4ed6\u4e00\u4e9b\u5371\u9669\u7684\u547d\u4ee4\u3002\u4f60\u4e0d\u60f3\u90a3\u6837\uff0c\u662f\u5417\uff1f<\/p>\n

\u4f60\u53ef\u4ee5\u4f7f\u7528 -t \u9009\u9879\u4ec5\u627e\u51fa Linux \u547d\u4ee4\u7684\u7c7b\u578b\u3002\u4f8b\u5982\uff1a<\/p>\n

$ type -t ls\r\nalias\r\n$ type -t mkdir\r\nfile\r\n$ type -t pwd\r\nbuiltin\r\n$ type -t if\r\nkeyword\r\n$ type -t rvm\r\nfunction<\/pre>\n

\u8be5\u547d\u4ee4\u4ec5\u663e\u793a\u547d\u4ee4\u7684\u7c7b\u578b\uff0c\u4f8b\u5982\u522b\u540d\u3002\u5b83\u4e0d\u663e\u793a\u88ab\u522b\u540d\u7684\u5185\u5bb9\u3002\u5982\u679c\u8be5\u547d\u4ee4\u627e\u4e0d\u5230\uff0c\u4f60\u5c06\u5728\u7ec8\u7aef\u4e2d\u770b\u4e0d\u5230\u4efb\u4f55\u5185\u5bb9\u3002<\/p>\n

type \u547d\u4ee4\u7684\u53e6\u4e00\u4e2a\u6709\u7528\u7684\u5730\u65b9\u662f\u6211\u4eec\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u627e\u51fa\u7ed9\u5b9a Linux \u547d\u4ee4\u7684\u7edd\u5bf9\u8def\u5f84\u3002\u4e3a\u6b64\uff0c\u8bf7\u4f7f\u7528 -p \u9009\u9879\uff0c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n

$ type -p cal\r\n\/usr\/bin\/cal<\/pre>\n

\u8fd9\u4e0e which ls \u547d\u4ee4\u7c7b\u4f3c\u3002\u5982\u679c\u7ed9\u5b9a\u7684\u547d\u4ee4\u662f\u522b\u540d\uff0c\u5219\u4e0d\u4f1a\u6253\u5370\u4efb\u4f55\u5185\u5bb9\u3002<\/p>\n

\u8981\u663e\u793a\u547d\u4ee4\u7684\u6240\u6709\u4fe1\u606f\uff0c\u8bf7\u4f7f\u7528 -a \u9009\u9879\u3002<\/p>\n

$ type -a ls\r\nls is aliased to `ls --color=auto'\r\nls is \/usr\/bin\/ls\r\nls is \/bin\/ls<\/pre>\n

\u5982\u4f60\u6240\u89c1\uff0c-a \u6807\u5fd7\u663e\u793a\u7ed9\u5b9a\u547d\u4ee4\u7684\u7c7b\u578b\u53ca\u5176\u7edd\u5bf9\u8def\u5f84\u3002\u6709\u5173\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u624b\u518c\u9875\u3002<\/p>\n

$ man type<\/pre>\n

\u5e0c\u671b\u8fd9\u6709\u5e2e\u52a9\u3002\u4f1a\u6709\u66f4\u591a\u7684\u597d\u4e1c\u897f\u3002\u8bf7\u7ee7\u7eed\u8bbf\u95ee\uff01<\/p>\n

via: https:\/\/www.ostechnix.com\/the-type-command-tutorial-with-examples-for-beginners\/<\/p>\n

\u4f5c\u8005\uff1aSK \u8bd1\u8005\uff1ageekpi \u6821\u5bf9\uff1awxy<\/p>\n

\u672c\u6587\u7531 LCTT \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd \u8363\u8a89\u63a8\u51fa<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e3a\u4ec0\u4e48\u6709\u4eba\u9700\u8981\u627e\u5230\u547d\u4ee4\u7c7b\u578b\uff1f\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7ecf\u5e38\u5728\u5171\u4eab\u7684\u8ba1\u7b97\u673a\u4e0a\u5de5\u4f5c\uff0c\u5219\u67d0\u4e9b\u4eba\u53ef\u80fd\u4f1a\u6545\u610f\u6216\u610f\u5916\u5730\u4e3a\u7279\u5b9a\u7684 Linu […]<\/p>\n","protected":false},"author":1482,"featured_media":87214,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-162859","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\/162859","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\/1482"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=162859"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/162859\/revisions"}],"predecessor-version":[{"id":162904,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/162859\/revisions\/162904"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/87214"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=162859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=162859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=162859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}