Solution to decompressing rar garbled characters in Linux: 1. Install RAR for Linux; 2. Open the command window; 3. Decompress it through the unrar decompression program.
The operating environment of this article: linux5.9.8 system, Dell G3 computer.
How to solve the garbled problem of decompressing rar in linux?
Decompressing rar, zip garbled characters, etc. under linux:
For Window Common compressed files .zip and .rar under Linux also have corresponding methods to decompress them:
1: For .zip
linux provides zip and unzip programs, zip is a compression program , unzip is the decompression program. They have many parameter options. Here is a brief introduction and an example of their usage:
# zip all.zip *.jpg(这条命令是将所有.jpg的文件压缩成一个zip包) # unzip all.zip(这条命令是将all.zip中的所有文件解压出来)
Decompressing ZIP files with garbled characters
unzip -O GBK mycpmpressfile.zip -d filename (用CP936, GB18030也可以,-d 指定要解压缩的路径)
2: For .rar
To process .rar files under Linux, you need to install RAR for Linux, which can be downloaded from the Internet, but remember that RAR for Linux is not free; you can download RAR 3 from http://www.rarsoft.com/download.htm. 60 for Linux, and then install the installation operation as follows:
# tar -xzpvf rarlinux-3.2.0.tar.gz # cd rar # make
In this way, the installation is completed. After installation, there are two programs, rar and unrar. rar is a compression program and unrar is a decompression program. They have many parameter options. Here is an example of their usage.
# rar a all *.jpg
This command is to compress all .jpg files into a rar package named all.rar. The program will automatically append the .rar extension. After the package name.
# unrar x all.rar
This command is to extract all files in all.rar.
ps:
3. For .tar.gz and .tgz
Decompression: tar xzvf all *.tar.gz -C filepath
Compression: tar czvf all *.tar.gz DirName
4.For .tar.bz
Decompression: tar xjvf FileName.tar.bz
Recommended learning: "linux video tutorial"
The above is the detailed content of How to solve the problem of garbled characters when decompressing rar in Linux. For more information, please follow other related articles on the PHP Chinese website!