Linux setleds command
The Linux setleds command is used to set the status of the three LEDs above the keyboard. In Linux, each virtual console has its own settings.
Syntax
setleds [-v] [-L] [-D] [-F] [{+|-}num] [{+|-}caps] [{+|-}scroll]
Parameters:
- -F: The default option, sets the status of the virtual console.
- -D: In addition to changing the status of the virtual console, also changes the default status.
- -L: Does not change the status of the virtual console, but directly changes the state of the LED display. This makes the LED display inconsistent with the current virtual console status. We can later use the setleds command with -L and no other options to restore the normal state.
- -num +num: Turn the Num Lock key on or off.
- -caps +caps: Turn the Caps Lock key on or off.
- -scroll +scroll: Turn the Scroll Lock key on or off.
Example
Turn on the Num Lock key and turn off the other two lights.
# setleds +num -caps -scroll
Linux Command Reference