List locale names generated or installed on the system without changing settings.
Which command is appropriate?
locale -a lists locale names available on the current system.
Detailed explanation
localeIncorrect. locale displays active settings.
locale -aCorrect. -a lists available locale names.
locale -mIncorrect. -m lists available character maps.
iconv -lIncorrect. iconv -l lists conversion encodings, not locale names.
Try it yourself
An example you can run in a temporary verification environment.
locale -a | sed -n '1,10p'Expected result
C、C.utf8など環境に導入されたロケール名Key points
- -a lists all locales
- -m lists charmaps
- The list depends on installed data
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.