1)对于找不到的命令,man会报错:
[jing@CentOS locale]$ man abc
Cannot open the message catalog "man" for locale "zh_CN.UTF-8"
(NLSPATH="/usr/share/locale/%l/LC_MESSAGES/%N")
No manual entry for abc
[jing@CentOS locale]$
2)用strace看了一下,发现在最后:
...
open("/usr/share/locale/zh/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh/LC_MESSAGES/man", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/zh_CN.UTF-8/man", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "Cannot open the message catalog "..., 112Cannot open the message catalog "man" for locale
"zh_CN.UTF-8"
(NLSPATH="/usr/share/locale/%l/LC_MESSAGES/%N")
) = 112
write(2, "No manual entry for abc\n", 24No manual entry for abc
) = 24
exit_group(1) = ?
3)将en下的man复制过来,先凑合用用:
cp /usr/share/locale/en/LC_MESSAGES/man /usr/share/locale/zh/LC_MESSAGES/
4)不报错了:
[jing@CentOS locale]$ man abc
No manual entry for abc
[jing@CentOS locale]$