Messages in my terminal are displayed using Russian language by default, which is my native one.
For just a moment I want them to be in English (eg. to paste in forums), then switch back to the default language.
How can I do the switch and switch back using bash?
Best Answer
There are several environment variables available for changing language settings. You can view your current locale settings by executing the
locale
command. To change all locale settings to English, useLANG=C
. ThisC
locale is always available without installing additional language packs. (In order to temporarily change to non-English locales, see @mklement0's post.)Examples:
Executing a command with the default language settings and print the current locale settings:
Temporarily override the language for one program and show that it is really temporary:
Change the locale for all commands executed in the current shell and include proofs again: