LANG and LC_TIME are set to Japanese UTF-8.
Temporarily override every locale category to C.
Which setting is appropriate?
LC_ALL is the highest-priority override for all locale categories, including individual LC_* variables and LANG.
Detailed explanation
LANG=CIncorrect. LANG is overridden by an existing LC_TIME and by LC_ALL.
Incorrect. LANG is overridden by an existing LC_TIME and by LC_ALL.
LC_TIME=CIncorrect. This changes only the time category.
Incorrect. This changes only the time category.
LC_CTYPE=CIncorrect. This changes only character classification.
Incorrect. This changes only character classification.
LC_ALL=CCorrect. LC_ALL=C overrides all categories.
Correct. LC_ALL=C overrides all categories.
Try it yourself
An example you can run in a temporary verification environment.
LANG=ja_JP.UTF-8 LC_TIME=ja_JP.UTF-8 LC_ALL=C locale | sed -n '1,6p'Expected result
各LC_*の有効値がCとなる表示Key points
- LC_ALL has highest priority
- It overrides LC_*
- Useful as a temporary override
Notes
- Environment: POSIX locale / 子プロセス環境だけ変更
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.