Ubuntu text console display English graphics console display Chinese

Source: Internet
Author: User
When using Linux systems such as Ubuntu, you often need to switch to the text Console (Press Ctrl + Alt + F [1-6]), but if the system uses Chinese by default, garbled characters are displayed in the Chinese prompt on the text console, and Chinese characters are displayed in the graphic console. So I thought I could not display the English prompt in the text Console (after all, if zhcon is not installed, it would not display Chinese, but it would be better to display English), and display Chinese in the graphic console, this is actually VeryGood. After online search, you can find that

When using Linux systems such as Ubuntu, you often need to switch to the text Console (Press Ctrl + Alt + F [1-6]), but if the system uses Chinese by default, garbled characters are displayed in the Chinese prompt on the text console, and Chinese characters are displayed in the graphic console. So I thought I could not display the English prompt in the text Console (after all, if zhcon is not installed, it would not display Chinese, but it would be better to display English), and display Chinese in the graphic console, this is actually Very Good.

After searching online, you can find that using the "export LANG = C" command in the console can make the console prompt in English. However, in this way, the graphic console will also be in English. Is there any way to determine whether the text console or the graphic console is used now?

Haha, yes, that is, the environment variable "TERM". Enter "echo $ TERM" in my Ubuntu graphics console and the returned result is "xterm ", in the text console, "linux" is returned (the results may be different in different Linux systems, and I have not tested the results. You can define the results as needed ). Therefore, you only need to add the following judgment at the end of the ". bashrc" file:

  1. If ["$ TERM" = "linux"]; then
  2. ExportLANG=C
  3. Fi
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.