change keyboard layout in shell

to change keyboard layout within the shell type

sudo dpkg-reconfigure console-setup

and

sudo dpkg-reconfigure xserver-xorg