﻿{"id":814,"date":"2012-05-10T21:00:34","date_gmt":"2012-05-10T13:00:34","guid":{"rendered":"http:\/\/notes.zerobox.org\/?p=814"},"modified":"2012-05-10T21:00:34","modified_gmt":"2012-05-10T13:00:34","slug":"linux-man%e5%91%bd%e4%bb%a4%e7%9a%84%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/zerobox.org\/notes\/814.html","title":{"rendered":"Linux man\u547d\u4ee4\u7684\u4f7f\u7528\u65b9\u6cd5"},"content":{"rendered":"<p>Linux\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5e2e\u52a9\u624b\u518c\uff0c\u5f53\u4f60\u9700\u8981\u67e5\u770b\u67d0\u4e2a\u547d\u4ee4\u7684\u53c2\u6570\u65f6\u4e0d\u5fc5\u5230\u5904\u4e0a\u7f51\u67e5\u627e\uff0c\u53ea\u8981man\u4e00\u4e0b\u5373\u53ef\u3002<br \/>\nLinux\u7684man\u624b\u518c\u5171\u6709\u4ee5\u4e0b\u51e0\u4e2a\u7ae0\u8282\uff1a<\/p>\n<p>1 Executable programs or shell commands<br \/>\n2 System calls (functions provided by the kernel)<br \/>\n3 Library calls (functions within program libraries)<br \/>\n4 Special files (usually found in \/dev)<br \/>\n5 File formats and conventions eg \/etc\/passwd<br \/>\n6 Games<br \/>\n7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)<br \/>\n8 System administration commands (usually only for root)<br \/>\n9 Kernel routines [Non standard]<\/p>\n<p>1\u3001Standard commands \uff08\u6807\u51c6\u547d\u4ee4\uff09<br \/>\n2\u3001System calls \uff08\u7cfb\u7edf\u8c03\u7528\uff09<br \/>\n3\u3001Library functions \uff08\u5e93\u51fd\u6570\uff09<br \/>\n4\u3001Special devices \uff08\u8bbe\u5907\u8bf4\u660e\uff09<br \/>\n5\u3001File formats \uff08\u6587\u4ef6\u683c\u5f0f\uff09<br \/>\n6\u3001Games and toys \uff08\u6e38\u620f\u548c\u5a31\u4e50\uff09<br \/>\n7\u3001Miscellaneous \uff08\u6742\u9879\uff09<br \/>\n8\u3001Administrative Commands \uff08\u7ba1\u7406\u5458\u547d\u4ee4\uff09<br \/>\n9 \u5176\u4ed6\uff08Linux\u7279\u5b9a\u7684\uff09\uff0c \u7528\u6765\u5b58\u653e\u5185\u6838\u4f8b\u884c\u7a0b\u5e8f\u7684\u6587\u6863\u3002<\/p>\n<p>n \u65b0\u6587\u6863\uff0c \u53ef\u80fd\u8981\u79fb\u5230\u66f4\u9002\u5408\u7684\u9886\u57df\u3002<br \/>\no \u8001\u6587\u6863\uff0c \u53ef\u80fd\u4f1a\u5728\u4e00\u6bb5\u671f\u9650\u5185\u4fdd\u7559\u3002<br \/>\nl \u672c\u5730\u6587\u6863\uff0c \u4e0e\u672c\u7279\u5b9a\u7cfb\u7edf\u6709\u5173\u7684\u3002<\/p>\n<p>\u4f8b\u5982\uff1a\u6211\u4eec\u8f93\u5165 man ls\uff0c\u5b83\u4f1a\u5728\u6700\u5de6\u4e0a\u89d2\u663e\u793a\u201cLS\uff081\uff09\u201d\uff0c\u5728\u8fd9\u91cc\uff0c\u201cLS\u201d\u8868\u793a\u624b\u518c\u540d\u79f0\uff0c\u800c\u201c\uff081\uff09\u201d\u8868\u793a\u8be5\u624b\u518c\u4f4d\u4e8e\u7b2c\u4e00\u8282\u7ae0\uff0c\u540c\u6837\uff0c\u6211\u4eec\u8f93\u5165\u201cman ifconfig\u201d\u5b83\u4f1a\u5728\u6700\u5de6\u4e0a\u89d2\u663e\u793a\u201cIFCONFIG\uff088\uff09\u201d\u3002\u4e5f\u53ef\u4ee5\u8fd9\u6837\u8f93\u5165\u547d\u4ee4\uff1a\u201cman [\u7ae0\u8282\u53f7] \u624b\u518c\u540d\u79f0\u201d\u3002<\/p>\n<p>man\u662f\u6309\u7167\u624b\u518c\u7684\u7ae0\u8282\u53f7\u7684\u987a\u5e8f\u8fdb\u884c\u641c\u7d22\u7684\uff0c\u6bd4\u5982\uff1a<br \/>\nman sleep<br \/>\n\u53ea\u4f1a\u663e\u793asleep\u547d\u4ee4\u7684\u624b\u518c,\u5982\u679c\u60f3\u67e5\u770b\u5e93\u51fd\u6570sleep\uff0c\u5c31\u8981\u8f93\u5165:<br \/>\nman 3 sleep<\/p>\n<p>ubuntu\u9ed8\u8ba4\u662f\u6ca1\u6709\u5b89\u88c5c\u8bed\u8a00\u7684\u5e93\u51fd\u6570man\u624b\u518c\u7684<\/p>\n<p>1.\u6dfb\u52a0\u5e93\u51fd\u6570\u624b\u518c<br \/>\nubuntu\u9ed8\u8ba4\u662f\u6ca1\u6709\u5b89\u88c5c\u8bed\u8a00\u7684\u5e93\u51fd\u6570man\u624b\u518c\u7684\uff0c\u6240\u4ee5\u4f60\u5728man perror \u548csendto\u4e4b\u7c7b\u7684\u51fd\u6570\u65f6\u4f1a\u663e\u793a\u6ca1\u6709\u76f8\u5173\u6587\u6863\u7684\u95ee\u9898\uff0c\u8fd9\u4e2a\u95ee\u9898\u8ba9\u6211\u90c1\u95f7\u4e86\u6211\u597d\u4e45\u3002\u89e3\u51b3\u65b9\u6cd5\uff1a<br \/>\nsudo apt-get install manpages-dev<br \/>\n2.\u8ba9man\u663e\u793a\u4e2d\u6587<br \/>\nubuntu\u6e90\u91cc\u9762\u5df2\u7ecf\u5305\u542b\u4e86\u4e2d\u6587\u7684man\u5305\uff0c\u6240\u4ee5\u4e0d\u7528\u4ece\u5176\u4ed6\u5730\u65b9down\u4e86\uff0c\u76f4\u63a5<br \/>\nsudo apt-get install manpages-zh<br \/>\n\u4f46\u662f\u8fd9\u6837man\u9ed8\u8ba4\u663e\u793a\u7684\u8fd8\u4e0d\u662f\u4e2d\u6587\uff0c\u8fd8\u9700\u8981\u4ee5\u4e0b\u4e24\u6b65<br \/>\na.\u628a\u4e2d\u6587man\u5305\u8f6c\u6362\u6210utf8\u683c\u5f0f\u7684<br \/>\n\u65b0\u5efa\u4e00\u4e2a\u811a\u672c\u6587\u4ef6<br \/>\ngedit t.sh<br \/>\n\u628a\u4e0b\u9762\u5185\u5bb9\u6dfb\u52a0\u8fdb\u53bb<br \/>\n#!\/bin\/bashcd \/usr\/share\/man\/zh_CN\/for k in *docd $kfor i in *.gzdo j=`echo ${i%.gz}` gunzip $i iconv -f gb18030 -t utf8 $j &gt;tmp mv tmp $j gzip $jdonecd ..done<br \/>\n\u7136\u540e<br \/>\nsudo .\/t<br \/>\nb.\u4fee\u6539man\u9ed8\u8ba4\u7684\u8bed\u8a00<br \/>\nsudo gedit \/etc\/manpath.config \u628a\u91cc\u9762\u7684\u6240\u6709\u7684 \/usr\/share\/man \u6539\u6210 \/usr\/share\/man\/zh_CN<br \/>\n\u4fdd\u5b58\u540e\u9000\u51fa\uff0c\u7136\u540e\u4f60\u518d\u8bd5\u4e00\u4e0bman ls<br \/>\n3.\u8ba9\u6ca1\u6709\u4e2d\u6587\u5e2e\u52a9\u7684\u663e\u793a\u82f1\u6587<br \/>\n\u505a\u5b8c\u4e0a\u9762\u7b2c\u4e8c\u90e8\u8fd8\u4e0d\u591f\uff0c\u8fd9\u65f6\u4f60\u518dman \u4e00\u4e0b\u4e00\u4e9bc\u8bed\u8a00\u51fd\u6570\uff08\u4e0d\u8981\u7528printf\uff0csocket\u4e4b\u7c7b\u6bd4\u8f83\u6709\u540d\u7684\u51fd\u6570\uff0c\u8fd9\u4e9b\u5df2\u7ecf\u6709\u4e2d\u6587\u5e2e\u52a9\u4e86\uff09\u7684\u65f6\u5019\u5c31\u4f1a\u53d1\u73b0\u7adf\u7136\u6ca1\u6709\u5e2e\u52a9\uff0c\u800c\u521a\u624d\u660e\u660e\u5728\u7b2c\u4e00\u6b65\u5df2\u7ecf\u5b89\u88c5\u4e86\u554a\u3002\u8fd9\u662f\u56e0\u4e3a\u4f60\u4e0a\u9762 \u628a\/usr\/share\/man \u6539\u6210 \/usr\/share\/man\/zh_CN\u7684\u64cd\u4f5c\u4f7fman\u53ea\u5728\u4e2d\u6587\u5e2e\u52a9\u4e2d\u641c\u7d22\uff0c\u5982\u679c\u6ca1\u6709\u5c31\u76f4\u63a5\u653e\u5f03\uff0c\u56e0\u6b64\u8fd8\u9700\u8981\u4ee5\u4e0b\u64cd\u4f5c\uff0c\u624d\u80fd\u8ba9man\u5728\u6ca1\u6709\u4e2d\u6587\u5e2e\u52a9\u7684\u65f6\u5019\u81ea\u52a8\u663e\u793a\u82f1\u6587\u7684\u5e2e\u52a9\uff0c\u5982\u679c\u82f1\u6587\u7684\u4e5f\u6ca1\u6709\uff0c\u54ea\u5c31\u771f\u7684\u6ca1\u6709\u4e86\u3002<br \/>\nsudo gedit \/etc\/manpath.config<br \/>\n\u7136\u540e\u641c\u7d22\u4f60\u521a\u624d\u6539\u8fc7\u7684\u5730\u65b9\uff0c\u7136\u540e\u5728\u5176\u540e\u9762\u6dfb\u52a0\u540c\u6837\u7684\u4e00\u884c\uff0c\u53ea\u662f\u540e\u9762\u7684\u76ee\u5f55\u8fd8\u7528\u539f\u6765\u7684\/usr\/share\/man\uff0c\u6bd4\u5982\u5728\u4fee\u6539\u540e\u7684<br \/>\nMANPATH_MAP \/bin\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/usr\/share\/man\/zh_CN<br \/>\n\u518d\u6dfb\u52a0\u4e00\u884c<br \/>\nMANPATH_MAP \/bin\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/usr\/share\/man<\/p>\n<p>\u65b0\u5b89\u88c5\u4e86ubuntu 8.04\u7248\u672c\uff0c\u53d1\u73b0\u5b89\u88c5\u8fc7\u7684\u7cfb\u7edf\u4e2d\u7f3a\u5c11\u5f88\u591a\u624b\u518c\u9875\u3002<br \/>\n\u7528\u4ee5\u4e0b\u547d\u4ee4\u641e\u5b9a\u4e86<br \/>\nsudo apt-get install manpages<br \/>\nsudo apt-get install manpages-de<br \/>\nsudo apt-get install manpages-de-dev<br \/>\nsudo apt-get install manpages-dev<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5e2e\u52a9\u624b\u518c\uff0c\u5f53\u4f60\u9700\u8981\u67e5\u770b\u67d0\u4e2a\u547d\u4ee4\u7684\u53c2\u6570\u65f6\u4e0d\u5fc5\u5230\u5904\u4e0a\u7f51\u67e5\u627e\uff0c\u53ea &hellip;<\/p>\n<p class=\"read-more\"><a href=\"http:\/\/zerobox.org\/notes\/814.html\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[29],"class_list":["post-814","post","type-post","status-publish","format-standard","hentry","tag-linux-2"],"views":846,"_links":{"self":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/comments?post=814"}],"version-history":[{"count":0,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/814\/revisions"}],"wp:attachment":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/media?parent=814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/categories?post=814"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/tags?post=814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}