I wan't to remap the Caps Lock key to the Shift Left key, so that when I press Caps Lock the functionality of Shift Left is processed. Is there a file in Ubuntu where I can specify this?

I know, under /etc/default/keyboard you can specify some keyboard options, but not this one.

2 Answers 2


You can use the following command in terminal:

xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L" #this will make Caps Lock to act as Shift_L

To get this change for every session, after you have run the ​​previous commands create a file called .xmodmap with the new keymaps, using the following command:

xmodmap -pke > .xmodmap

Then, create a file called .xinitrc in your home directory, containing the following line/command:

xmodmap .xmodmap
  • Can I just write that first command in .xinitrc directly? Sep 4, 2019 at 13:44

enter in terminal: xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L"

To use the command after restart or shutdown, you can put it in Startup Applications Preferences. Tested on my Ubuntu 18.04.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .