您必须在当前shell中更改LANG变量。
放
export LANG=en_US.UTF-8
在您的shell rc文件中(对于bash而言~/.bashrc
),然后重新启动终端会话(或者仅使用一次再次提供rc文件,source ~/.bashrc
甚至使用来重新启动bash exec bash
)
请注意,您必须先生成此语言环境。
您也可以使用export LANG=C
。
另外还有其他LANG变量(来自man bash):
LANG Used to determine the locale category for any category not
specifically selected with a variable starting with LC_.
LC_ALL This variable overrides the value of LANG and any other LC_
variable specifying a locale category.
LC_COLLATE
This variable determines the collation order used when sorting
the results of pathname expansion, and determines the behavior
of range expressions, equivalence classes, and collating
sequences within pathname expansion and pattern matching.
LC_CTYPE
This variable determines the interpretation of characters and
the behavior of character classes within pathname expansion and
pattern matching.
LC_MESSAGES
This variable determines the locale used to translate double-
quoted strings preceded by a $.
LC_NUMERIC
This variable determines the locale category used for number
formatting.
export LANGUAGE=English