kbd

systemLinux
The kbd command is one of the most frequently used commands in Linux/Unix-like operating systems. kbd A collection of tools for managing Linux console (keyboard and fonts)

Quick Reference

Command Name:

kbd

Category:

system

Platform:

Linux

Basic Usage:

kbd [options] [arguments]

Common Use Cases

    Syntax

    Various commands including loadkeys, setfont, showkey, etc.

    Options

    Command Description
    loadkeys Load keyboard translation tables
    setfont Load console font and screen mapping table
    showkey Examine the codes sent by the keyboard
    kbdinfo Obtain information about the console
    kbdrate Reset keyboard repeat rate and delay time
    dumpkeys Dump keyboard translation tables
    chvt Change to another virtual terminal
    deallocvt Deallocate unused virtual terminals
    setleds Set the keyboard leds
    setmetamode Define the keyboard meta key handling
    showconsolefont Show the current console font
    unicode_start Put the console in Unicode mode
    unicode_stop Take the console out of Unicode mode

    Examples

    How to Use These Examples

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

    # Basic examples of kbd utilities
    loadkeys us
    Load the US keyboard layout.
    setfont lat1-16
    Load the Latin-1 font with 16 pixel height.
    showkey -k
    Show keycodes when keys are pressed. # Advanced examples loadkeys -d Load the default keyboard layout. setfont -u iso01.sfm Load a font with a specific Unicode map. kbdinfo kbd Show current keyboard type. kbdrate -r 30 -d 250 Set keyboard repeat rate and delay. showconsolefont Display the current console font. dumpkeys > keyboard.map Dump the current keyboard map to a file. chvt 2 Switch to virtual console 2.

    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 kbd package is a collection of utilities for managing the Linux console (virtual terminal) environment. It provides tools for controlling keyboard layouts, console fonts, keyboard repeat rates, and other aspects of the Linux text console. These tools are essential for system administrators and users who need to configure or customize console behavior, especially on systems without graphical interfaces or during text-mode administration. Key components of the kbd package: 1. Keyboard Layout Management: Tools like loadkeys and dumpkeys allow users to set and modify keyboard layouts, which is particularly useful for non-US keyboard configurations or specialized layouts. 2. Console Font Control: Utilities such as setfont and showconsolefont enable changing and displaying console fonts, supporting different character sets and languages in the text console. 3. Keyboard Diagnostics: Tools like showkey help diagnose keyboard issues by displaying keycodes, scancodes, or keypress events in real-time. 4. Virtual Terminal Management: Commands such as chvt and deallocvt allow users to switch between and manage virtual terminals (the text consoles accessible via Alt+F1, Alt+F2, etc.). 5. Keyboard Behavior Configuration: Utilities like kbdrate and setleds adjust keyboard repeat rates, delay times, and LED indicators (Num Lock, Caps Lock, Scroll Lock). 6. Unicode Support: Tools such as unicode_start and unicode_stop enable or disable Unicode mode in the console, which is essential for displaying international characters correctly. 7. Meta Key Handling: setmetamode configures how the console handles the Meta key (Alt key), which affects special character input methods. Common use cases for kbd utilities include: - Setting up keyboard layouts for different languages - Configuring console fonts for better readability or multilingual support - Diagnosing keyboard hardware issues - Customizing keyboard behavior (repeat rate, delays) - Setting up the console for internationalization - Managing virtual terminals in server environments - Creating custom keyboard mappings for specialized applications These tools primarily work with the Linux text console and may not affect keyboard behavior in graphical environments like X11 or Wayland, which have their own keyboard configuration mechanisms. The kbd package is typically pre-installed on most Linux distributions, as it provides essential functionality for the base system.

    Related Commands

    These commands are frequently used alongside kbd 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 kbd command works in different scenarios.

    $ kbd
    View All Commands
    kbd - Linux Command Guide | LinuxConcept