List the values applied to LC_CTYPE, LC_TIME, and other locale categories in the current process environment.
Which command is appropriate?
locale without arguments displays LANG, LC_ALL, and each current LC_* category value.
Detailed explanation
localeCorrect. locale displays the current category settings.
Correct. locale displays the current category settings.
locale -aIncorrect. locale -a lists available locale names, not current category values.
Incorrect. locale -a lists available locale names, not current category values.
iconv -lIncorrect. iconv -l lists recognized encodings.
Incorrect. iconv -l lists recognized encodings.
tzselectIncorrect. tzselect helps choose a timezone identifier.
Incorrect. tzselect helps choose a timezone identifier.
Try it yourself
An example you can run in a temporary verification environment.
locale | sed -n '1,4p'Expected result
LANG、LANGUAGEまたはLC_CTYPE等、現在環境のlocale設定(値は環境依存)Key points
- locale shows current values
- -a lists available locales
- Category-specific
Notes
- Environment: glibc 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.