loadkeys

file managementLinux/Unix
The loadkeys command is one of the most frequently used commands in Linux/Unix-like operating systems. loadkeys Load keyboard translation tables

Quick Reference

Command Name:

loadkeys

Category:

file management

Platform:

Linux/Unix

Basic Usage:

loadkeys [options] [arguments]

Common Use Cases

    Syntax

    loadkeys [options] [keymap]

    Options

    Option Description
    -a, --ascii Force conversion to ASCII
    -b, --bkeymap Output a binary keymap
    -c, --clearcompose Clear kernel compose table
    -C, --console=FILE Specify console device to use
    -d, --default Load the default keymap
    -h, --help Display help text and exit
    -m, --mktable Output a "defkeymap.c" file
    -p, --parse Search and parse keymap without action
    -q, --quiet Suppress all normal output
    -s, --clearstrings Clear kernel string table
    -u, --unicode Force conversion to Unicode
    -v, --verbose Report the changes made
    -V, --version Display version and exit

    Examples

    How to Use These Examples

    The examples below show common ways to use the loadkeys command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

    # Basic Examples Basic
    loadkeys us
    Load the US keyboard layout.
    loadkeys de
    Load the German keyboard layout.
    # Advanced Examples Advanced
    loadkeys -d Load the default keyboard mapping. loadkeys -b Force binary keymap output. loadkeys -c Clear the kernel keymap table. loadkeys -s Force symbolic keymap output. loadkeys -v Be verbose: show what is being loaded. loadkeys fr-latin1 Load the French keyboard layout with Latin-1 encoding. loadkeys < /usr/share/keymaps/i386/qwerty/us.map.gz Load a keymap from a file using input redirection. dumpkeys | loadkeys Reload the current keymap.

    Try It Yourself

    Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

    Understanding Syntax

    Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

    Notes

    The 'loadkeys' command is a utility for loading keyboard translation tables (keymaps) into the Linux kernel. This tool allows users to configure their keyboard layout to match their physical keyboard or preferences, making it an essential component for internationalization and keyboard customization in Linux systems. Key features of the loadkeys command: 1. Keyboard Layout Switching: loadkeys enables users to change keyboard layouts on-the-fly, allowing for switching between different language layouts or special-purpose configurations without requiring a system restart. 2. Localization Support: The command supports a wide range of international keyboard layouts, making it possible to type in various languages with their specific characters and diacritical marks. 3. Custom Keymap Creation: Advanced users can create and load custom keymaps, allowing for personalized keyboard configurations tailored to specific needs or preferences. 4. Console Control: loadkeys only affects the Linux console keyboard mapping, not X Window System or graphical environments, which have their own keyboard configuration mechanisms. 5. Keymap Manipulation: In addition to loading complete keymaps, loadkeys can modify existing mappings, clear specific tables, and perform selective updates to the keyboard configuration. 6. System Integration: The command is often used in system initialization scripts to set up the correct keyboard layout during boot, based on the system's locale settings. 7. Diagnostic Tools: With verbose mode, loadkeys can provide information about the changes being made, helping to troubleshoot keyboard configuration issues. Common use cases for the loadkeys command include: - Setting up the appropriate national keyboard layout on a new Linux installation - Temporarily switching to a different keyboard layout for specific tasks - Implementing special keyboard configurations for accessibility purposes - Customizing keyboard behavior for specific applications or workflows - Restoring default keyboard settings after modifications - System maintenance and configuration in multi-language environments The loadkeys command typically reads keymap definitions from files stored in directories such as /usr/share/keymaps/ or /usr/lib/kbd/keymaps/. These keymap files define the translation between the physical keys pressed and the characters or actions they should produce. It's important to note that loadkeys is specific to the Linux console and does not affect keyboard layouts in graphical environments like GNOME, KDE, or other desktop environments, which use X.org or Wayland configuration mechanisms instead. For users primarily working in graphical environments, desktop-specific keyboard configuration tools would be used alongside or instead of loadkeys.

    Related Commands

    These commands are frequently used alongside loadkeys or serve similar purposes:

    Use Cases

    Learn By Doing

    The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the loadkeys command works in different scenarios.

    $ loadkeys
    View All Commands