Changing the keyboard layout in CentOS 7 via terminal

Which of us has never been through the situation of typing a bar and exiting a semicolon on the console? yes, we know it's awful. So here's a simple tip on how to change your keyboard layout in CentOS 7.

To see your current layout, go with the command:

In the output of this command, look for the VC Keymap property, which will probably be us. Now, let's change it to the good old ABNT2 keyboard by entering with the command:
localectl set-keymap b

One more tip: if you need to see what layouts are available, just enter the following command:

list-keymaps localectl