Change keyboard back to English in command line from Cyrillic
I switched to Russian keyboard via loadkeys ru command and now cannot switch back.
A directory and subsequent files I have are titled in Cyrillic characters and I am trying to get to them by a combination of commands in Latin characters and Cyrillic ones. So far I've been stuck on Cyrillic.
Does anyone know how to switch back if I have only Cyrillic characters available?
03 Answers
I feel there must be a much more logical/sane solution compared to what I'm about to propose, such as running sudo loadkeys us from the graphical terminal whose layout is independent, or restarting the machine (as already suggested).
If none of those are an option, however, you could use the following pants-on-the-head technique:
- Find the original line in shell history with the ↑ key. It should be
sudo loadkeys ru. Alternatively, find any line that hasuandsin it. - Remove all characters except for
us. Press Enter. (Bash will complain thatcommand not found.) - Now go back to your
loadkeys ruline. - Press Alt+/. In the Russian layout / is mapped to .. And Alt+. is mapped
yank-last-argin bash, which is the command that inserts the last argument from the previous command. In this case, it will beusthat we've assembled in the previous step. - This should leave you
loadkeys us. All it takes now is to press Enter.
If it happens that there are no commands with both u and s in them, you could do steps 2 and 3 twice, and pick those characters from 2 different commands.
The Russian keymap probably has a modifier key for Latin text.
Some likely suspects are the Caps Lock key (Latin lock), the right Alt (AltGr) key, or possibly the combination of Alt and Shift together.
If you could look at the keymap file (or run dumpkeys) then you'd know for sure. But it might be difficult to find information while your keyboard is stuck in an unfamiliar mapping!
The keymap file
The comment at the top of /usr/share/keymaps/i386/qwerty/ru.kmap.gz in Ubuntu 16.04 LTS (Xenial Xerus) says:
"Cyrillic" mode is toggled by Right_Ctrl key and shifted by AltGr key.
I hope your keyboard has a right-Ctrl key! If it doesn't, you'll need to hold down right-Alt (AltGr) while you switch.
1Have you tried the standard(ish) shortcut that is ctrl+space ?
If, when installing a new keyboard you didn't suppress the English one, this shortcut should switch between one and the other.