Compressed and decompressed under Linux. zipand. rar

Source: Internet
Author: User
Linux also has corresponding methods to decompress the compressed files .zipand .rar in Windows:

1)for. Zip

Linux provides zip and unzip programs, Zip is a compression program, and unzip is a decompression program. They have many Parameter options, which can be viewed by the command zip-help and unzip-help. Here we will only give a brief introduction and give an example to illustrate their usage:

# Zip yajiu.zip yajiu.jpg yajiu.png
This command compresses yajiu.jpgand yajiu.png into a zip package
# Zip yajiu.zip *. jpg
This command compresses all .jpg files into a zip package.
# Zip-r yajiu.zip yajiu
This command compresses the folder yajiu into a zip package
# Unzip yajiu.zip
This command decompress all the files in yajiu.zip.

Yajiu @ yajiu-desktop :~ $ CD image
Yajiu @ yajiu-desktop :~ /Image zip yajiu.zip yajiu.jpg yajiu.png
Updating: yajiu.jpg (deflated 34%)
Updating: yajiu.png (deflated 0%)
Yajiu @ yajiu-desktop :~ /Image $ zip yajiu.zip *. jpg
Adding: 1.jpg (deflated 34%)
Adding: 2.jpg (deflated 0%)
Yajiu @ yajiu-desktop :~ /Image $ zip-r yajiu.zip yajiu
Adding: yajiu/(stored 0%)
Adding: yajiu/yajiu.zip (stored 0%)
Adding: yajiu/yajiu.jpg (deflated 34%)
Adding: yajiu/yajiu.rar (deflated 0%)
Adding: yajiu/yajiu.7z (deflated 0%)
Adding: yajiu/yajiu.png (deflated 0%)
Yajiu @ yajiu-desktop :~ /Image $ unzip yajiu.zip
Archive: yajiu.zip
Replace 1.jpg? [Y] es, [N] o, [a] ll, [N] One, [R] ename: Y
Inflating: 1.jpg
Replace 2.jpg? [Y] es, [N] o, [a] ll, [N] One, [R] ename: Y
Inflating: 2.jpg
Yajiu @ yajiu-desktop :~ /Image $

2XX vs. .rar

Install: sudo apt-Get install RAR unrar

You can also download RAR for Linux compilation and installation from http://www.rarsoft.com/download.htm.
# Tar-xzpvf rarlinux-3.8.0.tar.gz
# Cd RAR
# Make
In this way, after the installation, there will be the RAR and unrar programs, rar is the compression program, and unrar is the decompression program. They have many Parameter options, which can be viewed by commands rar-help and unrar-help. Here, we also give a simple example to illustrate their usage:

# Rar a yajiu.rar yajiu.jpg yajiu.png
This command compresses yajiu.jpgand yajiu.png into a RAR package
# Rar a yajiu.rar *. jpg
This command compresses all .jpg files into a RAR package
# Rar a yajiu.rar yajiu
This command compresses the folder yajiu into a RAR package
# Unrar e yajiu.rar
This command is to extract all the files in yajiu.rar

Yajiu @ yajiu-desktop :~ $ CD image
Yajiu @ yajiu-desktop :~ /Image $ rar a yajiu.rar yajiu.jpg yajiu.png

RAR 3.80 beta 2 copyright (c) 1993-2008 Alexander roshal 16 Jun 2008
Shareware version type rar -? For help

Evaluation copy. Please register.

Creating archive yajiu.rar

Adding yajiu.jpg OK
Adding yajiu.png OK
Done
Yajiu @ yajiu-desktop :~ /Image $ rar a yajiu.rar *. jpg

RAR 3.80 beta 2 copyright (c) 1993-2008 Alexander roshal 16 Jun 2008
Shareware version type rar -? For help

Evaluation copy. Please register.

Creating archive yajiu.rar

Adding 1.jpg OK
Adding 2.jpg OK
Done
Yajiu @ yajiu-desktop :~ /Image $ rar a yajiu.rar yajiu

RAR 3.80 beta 2 copyright (c) 1993-2008 Alexander roshal 16 Jun 2008
Shareware version type rar -? For help

Evaluation copy. Please register.

Creating archive yajiu.rar

Adding yajiu/yajiu.zip OK
Adding yajiu/yajiu.jpg OK
Adding yajiu/yajiu.rar OK
Adding yajiu/yajiu.7z OK
Adding yajiu/yajiu.png OK
Adding yajiu OK
Done
Yajiu @ yajiu-desktop :~ /Image $ unrar e yajiu.rar

Unrar 3.80 beta 2 freeware copyright (c) 1993-2008 Alexander roshal

Extracting from yajiu.rar

1. jpg already exists. Overwrite it?
[Y] es, [N] o, [a] ll, N [e] ver, [R] ename, [Q] uit y

Extracting 1.jpg OK

7a008fc287fe680c0ff477e9.jpg already exists. Overwrite it?
[Y] es, [N] o, [a] ll, N [e] ver, [R] ename, [Q] uit y

Extracting 2.jpg OK
All OK
Yajiu @ yajiu-desktop :~ /Image $

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.