2018/04/17 daily a Linux command of tar

Source: Internet
Author: User
Tags bz2

10 days did not update this daily learning Linux, because is really busy, evening also to see other knowledge.

But you shouldn't give yourself a reason, or you should stick to it every day.

--

Tar for unzip/file in Linux

There are many parameters under this command, so you can see what you want to see, just write down the usual decompression commands.

Linux tar command

--

Compression

For example, we need to pack the/etc directory

1: Package file directory for. Tar packages

TAR-CVF/TMP/ETC.TAR/ETC <== only packaged, not compressed!

2: Package directory and use gzip compression

Tar-zcvf/tmp/etc.tar.gz/etc <== after packing, compress with gzip

3: Package directory and use BZIP2 compression

TAR-JCVF/TMP/ETC.TAR.BZ2/ETC <== is packaged to bzip2 compressed

4: Package directory and use zip compression

When using ZIP, you must install unzip

Zip-r etc.zip/etc

--

Extract

1, *.tar with TAR-XVF decompression 2, *.gz with gzip-d or Gunzip decompression 3, *.tar.gz and *.tgz with TAR-XZF decompression 4, *.bz2 with bzip2-d or BUNZIP2 decompression 5, *.tar.bz2 with T AR-XJF Decompression 6, *. Z Extract 7, *.tar with Uncompress. Z with TAR-XZF decompression 8, *.rar with Unrar e decompression 9, *.zip with unzip decompression

--

Here are the default decompression to the current directory, if you want to specify the decompression directory, after extracting the file file to specify the location of the decompression.

--

Then what's the use of the words in back to add.

2018/04/17 daily a Linux command of tar

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.