• 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. Input/Output Errors During XFS Filesystem Access In CentOS/RHEL 7
  2. CentOS / RHEL : How to setup session idle timeout (inactivity timeout) for ssh auto logout
  3. Understanding Variables in Bash Shell Under Linux
  4. lvconvert Command Examples in Linux
  5. How to enable SFTP Logging without chroot in CentOS/RHEL
  6. Using cut on Linux Terminal
  7. passwd Command Examples in Linux
  8. pvdisplay Command Examples in Linux
  9. How to Set “dev_loss_tmo” Value Persistently Using Udev Rule
  10. CentOS / RHEL : Beginners guide to vsftpd (installation and configuration)

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright