loadkeys is a command line utility used to change the keyboard layout of the console in Linux and Unix-like operating systems. It is used to remap the keys of the keyboard to support different keyboard layouts, such as QWERTY, AZERTY, and Dvorak, or to change the mapping of individual keys.
Note that changes made with loadkeys only persist for the current session. To make the changes permanent, you need to add the appropriate loadkeys command to your system startup script, such as /etc/rc.local or /etc/init.d/keyboard-setup.
It is important to use the correct keyboard layout for your needs, as using an incorrect layout can result in unexpected results when typing. loadkeys provides an easy way to switch between keyboard layouts, making it an essential tool for users who need to work with multiple languages or keyboard configurations.
If you encounter the below error while running the command loadkeys:
loadkeys: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install kbd |
Ubuntu | apt-get install kbd |
Alpine | apk add kbd |
Arch Linux | pacman -S kbd |
Kali Linux | apt-get install kbd |
CentOS | yum install kbd |
Fedora | dnf install kbd |
Raspbian | apt-get install kbd |
loadkeys Command Examples
1. Load a default keymap:
# loadkeys --default
2. Load default keymap when an unusual keymap is loaded and `-` sign cannot be found:
# loadkeys defmap
3. Create a kernel source table:
# loadkeys --mktable
4. Create a binary keymap:
# loadkeys --bkeymap
5. Search and parse keymap without action:
# loadkeys --parse
6. Load the keymap suppressing all output:
# loadkeys --quiet
7. Load a keymap from the specified file for the console:
# loadkeys --console /dev/ttyN /path/to/file
8. Use standard names for keymaps of different locales:
# loadkeys --console /dev/ttyN uk