• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

locale Command Examples in Linux

by admin

locale command can be used to get the locale-specific information. This command has very few options to be used with. Run the locale command as the user to check the current locale. For example:

# locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

To change the locale to use the traditional Unix behaviors, set the LANG variable to POSIX.

$ export LANG=POSIX

Note that this change converts the system to use US English (more specifically, ASCII) for its character set, so be sure if this is really what you want. You can make this change permanent by adding this line to your .bashrc file:

$ vi ~/.bashrc
export LANG=POSIX

locale Command Examples

1. To get the locale specific information:

# locale 

2. To get the names of available locale:

# locale -a
# locale --all-locales 

3. To write names of available charmaps:

# locale -m
# locale --charmaps 

4. To write the names of selected categories:

# locale -c 
# locale --category-name 

5. To write names and values of selected keywords:

# locale -k
# locale --keyword-name 

Filed Under: Linux

Some more articles you might also be interested in …

  1. ss: command not found
  2. dvc init: Initialize a new local DVC repository
  3. How to recreate LVM device files under /dev directory using vgmknodes
  4. How to uninstall docker.io software in Ubuntu
  5. “git subtree” Command Examples
  6. Examples of creating command alias in different shells
  7. enum4linux Command Examples in Linux
  8. uvcdynctrl Command Examples in Linux
  9. synopkg: command not found in Linux
  10. brctl: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright