Home  >  Article  >  System Tutorial  >  Linux files are garbled. "Linux common commands" is a simple, fast and practical method to operate.

Linux files are garbled. "Linux common commands" is a simple, fast and practical method to operate.

WBOY
WBOYforward
2024-04-02 08:13:01704browse

linux文件乱码 “linux常用命令”操作简单快捷实用性强的方法

This article mainly explains "how to solve the problem of garbled files in some files under the Linux operating system". Interested students may wish to take a look. The method introduced in this article is simple and quick to operate Linux file garbled, and is highly practical. Let the editor take you to learn "how to solve the problem of garbled files under the Linux operating system"!

The original Windows rar compressed file is LINUX community. After decompressing it under the Linux system and opening the file next to it, the contents are all garbled.

The reason why garbled characters appear is because some of the compressed files are named in English. The encoding of English under Windows is usually gbk, while the encoding of English under Linux is usually utf8, so files that are opened normally under Windows are likely to be garbled under Linux.

The solution is: use the iconv command to convert the file content encoding. For example, I have a file "Linux Common Commands" that opens normally under Windows, but garbled characters when opened under Linux. The solution is to enter in the terminal:

iconv-fgbk-tutf8linux common commands.txt>linux common commands.txt.utf8

Then open the file "Linux Common Commands.txt.utf8" and the garbled code problem seen in this article will be solved.

At this point, I believe you have a deeper understanding of "how to solve the problem of garbled files in some files under the Linux operating system". You might as well come and practice it! Here is the Yisu Cloud website. For more related content, you can enter the relevant channels to query linux file garbled. Follow us and continue to learn!

The above is the detailed content of Linux files are garbled. "Linux common commands" is a simple, fast and practical method to operate.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:itcool.net. If there is any infringement, please contact admin@php.cn delete