Setleds command

From Linux Bash Shell Scripting Tutorial Wiki
Jump to navigation Jump to search

The setleds command is used to report and change the led flag settings of a VT i.e. NumLock, CapsLock and ScrollLock keys. Without any command line arguments, setleds displays the current settings about VT. With arguments you can set or clear the indicated flags for VT.

Display Current VT Settings

Type the following command:


Turn on Numlock For All VTs

You can use bash for loop to turn NumLock leds for all VTs as follows:

for t in $_input
  setleds -D +num < $t

See also