The ultimate solution for garbled Linux commands in linux

Source: Internet
Author: User

Programmers who are new to linux often receive garbled greetings from linux commands. It can be described as "starting from chaos ". Because of the garbled code, and finally gave up linux is not a minority. Well, let's get down to the point. First, let's take a look at how various linux commands are garbled.

Linux Command garbled characters with Chinese characters

In this case, the Chinese control terminal is installed, but the Chinese application is not enabled. You only need to start the corresponding software, such as zhcon. Or the corresponding software is enabled, but the character set is incorrect, you need to set the corresponding character set, such as export LANG = zh_CN.UTF-8

ORACLE Installation interface linux Command garbled

Although ORACLE supports multiple languages and automatically selects character sets based on environment variables, it seems that there are still problems with Chinese installation, but it does not seem to be a problem in Versions later than 10.2, you can execute the command export LANG = en_US to set it to the English character set environment.

Linux Command garbled characters

Generally, when the linux Command garbled by this character is more than the cat binary file, the linux Command garbled on the terminal interface may be caused by many control codes in the binary file, the general solution is to use the reset command on the reset terminal to solve the problem.

Other Pseudo Terminal linux Command garbled

Sometimes, when a remote LINUX server is accessed through SSH, a core file is cat and the reset command cannot be used successfully. What should I do? It's easy. Let's take a look at the following experiment. First, cat a python compilation file.

Oracle @ linux-suse: ~> Cat fibo. pyc

M?

{? C @ sd

Zd

ZdS (cCs: d \} x 'jo G} qWdS (Nii (ii (tatbtn (RRR (tfibo. pytfibs

CCsIg} d \} x0jo "I} qW S (Nii (ii (tresultRRRtappend (RRRR (rtfiber 2 s)

N (RR (Rt? S oracle @ linux-suse: ~> VT102VT102

\-Bash: VT102VT102: command not found

Oracle @ linux-suse: ~>

On the SSH terminal, we can see that the linux Command is garbled and the prompt is messy. You can use the following command to restore

Oracle @ linux-suse: ~> Tput sgr0

The cause of linux Command garbled is SSH, because cat uses a sample file on other terminals and does not produce garbled characters, so the cause of linux Command garbled

Oracle @ linux-suse: ~> ^ N

If you use ctrl + v and ctrl + n, the linux Command on the screen is garbled. Of course, try again after recovery.

Oracle @ linux-suse: ~> Echo-e '\ xe'

The screen is garbled again. OK, recover again.

Oracle @ linux-suse: ~> Echo-e '\ xf'

The above needs to be played blindly, because the linux Command garbled characters are displayed on the screen. The cause of the final problem is that the hexadecimal character E is generated, and the solution is very simple. The hexadecimal character F is enough.

The above is the ultimate solution for Linux Command garbled characters in linux. I hope it will help you.

  1. Modify the time zone in Linux Command Line Mode in Ubuntu linux
  2. Use a proxy server to access the Internet on the Linux command line interface
  3. How to switch between linux mode and linux Command Line Mode

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.