Open main menu

Linux Shell Scripting Tutorial - A Beginner's handbook β

Turn on or off NumLock leds

← Set the keyboard ledsHomeTurn on or off CapsLock leds →

To turn on NumLock, use the setleds command as follows:

setleds -D +num

To turn off NumLock, enter:

setleds -D -num


  • -D : Change both the VT flags and their default settings.
  • +num : Clear NumLock.
  • -num : Set NumLock.

Note: At present, the NumLock setting influences the interpretation of keypad keys. Pressing the NumLock key complements the NumLock setting.

See also