Linux setleds Command

Linux 命令大全Linux Command Encyclopedia

The Linux setleds command is used to set the status of the three LEDs above the keyboard. In Linux, each virtual console has independent settings.

Syntax

setleds [-v] [-L] [-D] [-F] [{+|-}num] [{+|-}caps] [{+|-}scroll]

Parameters:

  • -F: Default option, sets the state of the virtual console.
  • -D: Besides changing the state of the virtual console, also changes the default state.
  • -L: Does not change the state of the virtual console, but directly changes the LED display state. This will cause the LED display to be inconsistent with the current state of the virtual console. We can later restore the normal state with the setleds command using -L without other options.
  • -num +num: Turn Num Lock on or off.
  • -caps +caps: Turn Caps Lock on or off.
  • -scroll +scroll: Turn Scroll Lock on or off.

Examples

Turn the Num Lock on, and the other two lights off.

# setleds +num -caps -scroll

Linux 命令大全Linux Command Encyclopedia

Other Extensions