• 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

localectl Command Examples in Linux

by admin

The localectl command is used to view and configure the system locale and keyboard layout settings. A system’s locale determines how it will represent various culture-specific elements, the most prominent of which is the language used in the interface. However, a locale can also determine factors such as how date and time are formatted, how monetary values are formatted, and more. Keyboard layouts can be configured independently of the locale and will determine how each physical key press is interpreted by the operating system. There are many keyboards with different physical layouts, so the system needs to be configured with the correct one or else the wrong character may be entered.

Like the timedatectl command, the localectl command offers various subcommands for managing the system locale and keyboard layout.

Subcommand Used To
status Show the current locale and keyboard layout. This is the same as issuing localectl by itself.
set-locale Set the system locale to the locale provided.
list-locales List all available locales on the system.
set-keymap Set the keyboard layout to the provided layout.
list-keymaps List all available keyboard layouts on the system.

Syntax

The syntax of the localectl command is:

# localectl [options] [subcommand]

localectl Command Examples

1. Show the current settings of the system locale and keyboard mapping:

# localectl

2. List available locales:

# localectl list-locales

3. Set a system locale variable:

# localectl set-locale LANG=en_US.UTF-8

4. List available keymaps:

# localectl list-keymaps

5. Set the system keyboard mapping for the console and X11:

# localectl set-keymap us

Filed Under: Linux

Some more articles you might also be interested in …

  1. Defining System Jobs Using Cron under Linux
  2. md5sum: command not found
  3. sox: command not found
  4. How to delete a partition using fdisk
  5. How to set children-max for udev Service in CentOS/RHEL 7
  6. How to Disable rpc.quotad Service in CentOS/RHEL 6 and 7
  7. pvcreate Fails With Error: “Device /dev/mapper/mpatha Not Found (or Ignored By Filtering).”
  8. User Unable To Edit crontab, Error: “/tmp/crontab.Lm34gsJV: Permission denied”
  9. CentOS / RHEL : How to configure vsftpd to use ports other than the default ports 20 and 21
  10. How to use tar command under Linux

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright