Sometimes we change keyboard keys behavior to improve work efficiency or for special uses. Ubuntu desktop provides keyboard layout options under Keyboard Preferences, there we can define the key behavior of Ctrl, Alt/Win, CapsLock, and so forth. Here’s going to exchange Esc and Caps Lock keys behavior.
1.) Head to System -> Preferences -> Keyboard, in the pop-up Keyboard Preferences window click Options button under Layouts tab.
2.) Now we are at keyboard layout options window, and under CapsLock key behavior check the last.