是否可以选择以不同语言输出手册页?我不想完全改变计算机语言,而只想改变特定的手册页。例如
$ man -English man
Man is a manual program
…
$ man -Russian man
?????????? ??? Unix, BSD ? Linux.
…
Run Code Online (Sandbox Code Playgroud)
jof*_*fel 17
如果你man从男人-DB包(人2.x中,像大多数的GNU / Linux发行版),最快的方法是使用-L的标志man。您只需要知道所需语言环境的缩写。
man -Len man # -> English man-page of man
man -Lru man # -> Russian man-page of man
Run Code Online (Sandbox Code Playgroud)
如果您使用其他man 实现(man 1.x),唯一的方法是更改其他答案中描述的环境变量$LC_MESSAGES或$LANG类似内容。
要获得本地化的手册页,请设置LC_MESSAGES locale环境变量。对于单个调用man:
LC_MESSAGES=ru_RU man man
Run Code Online (Sandbox Code Playgroud)
如果您总是想要俄语的手册页,但想要其他命令说英语,您可以在您的.bashrc或其他 shell 初始化文件中设置别名:
alias man='LC_MESSAGES=ru_RU man'
Run Code Online (Sandbox Code Playgroud)
阅读man man,看来您应该更改环境变量,然后像往常一样使用 man 。如果它没有您的语言版本,它仍会显示英文版本。
International support is available with this package. Native lan\xe2\x80\x90\n guage manual pages are accessible (if available on your system) via\n use of locale functions. To activate such support, it is necessary\n to set either $LC_MESSAGES, $LANG or another system dependent envi\xe2\x80\x90\n ronment variable to your language locale, usually specified in the\n POSIX 1003.1 based format:\n\n <language>[_<territory>[.<character-set>[,<version>]]]\n\n If the desired page is available in your locale, it will be dis\xe2\x80\x90\n played in lieu of the standard (usually American English) page.\nRun Code Online (Sandbox Code Playgroud)\n