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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. Understanding rsyslog Actions
  2. rbash – Set Restricted shell in Linux
  3. localectl Command Examples in Linux
  4. How to Use “repoquery” Command to List Package Dependencies
  5. mt: command not found
  6. printf: command not found
  7. Understanding the dm-multipath Configuration file /etc/multipath.conf
  8. beep: command not found
  9. Understanding the rc Scripts in Linux
  10. Basic vim commands (cheat sheet)

You May Also Like

Primary Sidebar

Recent Posts

  • pw-cat Command Examples in Linux
  • pvs: command not found
  • pulseaudio: command not found
  • pulseaudio Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright