Home > Article > Operation and Maintenance > How to decompress files in Linux
How to decompress .zip and .rar files under Linux. Linux also has corresponding methods for common compressed files .zip and .rar under Windows. To decompress them: (Recommended learning: linux operation and maintenance)
1) For zip, linux provides zip and unzip programs, zip is a compression program, and unzip is Unzip program. They have many parameter options. Here is just a brief introduction and an example to illustrate their usage:
# zip all.zip *.jpg 这条命令是将所有.jpg的文件压缩成一个zip包 # unzip all.zip
This command is to extract all the files in all.zip
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:
# tar -xzpvf rarlinux-3.2.0.tar.gz # cd rar # make
This is installed. 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 are some examples to illustrate their usage:
# rar a all *.jpg
This command compresses all .jpg files into a rar package named all.rar. The program will automatically Appended to the package name.
# unrar e all.rar
This command is to extract all the files in all.rar
Summary
1. Use tar –xvf to decompress *.tar
2. Use gzip -d or gunzip to decompress *.gz.
3. Use tar –xzf to decompress *.tar.gz and *.tgz.
4. *. bz2 Use bzip2 -d or bunzip2 to decompress
5, *.tar.bz2 use tar –xjf to decompress
6, *.Z use uncompress to decompress
7, * .tar.Z Use tar –xZf to decompress
8, *.rar Use unrar e to decompress
9, *.zip Use unzip to decompress
The above is the detailed content of How to decompress files in Linux. For more information, please follow other related articles on the PHP Chinese website!