Inspect current LANG, LC_CTYPE, LC_TIME, and other locale-category values.
Which command is appropriate?
locale without arguments displays current locale environment variables and category values.
Detailed explanation
localeCorrect. It displays the current locale and category values.
locale -aIncorrect. -a lists available locale names rather than active values.
locale charmapIncorrect. locale charmap prints only the current character-map name.
iconv -lIncorrect. iconv -l lists encodings supported by iconv.
Try it yourself
An example you can run in a temporary verification environment.
localeExpected result
LANG、LC_CTYPE、LC_TIME、LC_ALLなどの一覧Key points
- locale shows current values
- -a lists available locales
- charmap shows encoding
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
Locale category
A setting that controls language, numeric formatting, collation, or date display.
Character encoding
A mapping between characters and the bytes used to represent them.
Timezone
A rule set that converts timestamps for a region or display context.