Linux command-tar

Source: Internet
Author: User

    • The tar command is used to package files for compression or decompression
    • Format: tar [option-c specifies the directory to extract] [file]
    • To package and compress files:
TAR-ZCVF compressed package name. tar.gz file name
    • Unzip and expand the ZIP package
TAR-ZXVF compressed package name. tar.gz

[[email protected] testb]# ls111. txt222. txt
Save the file name by using gzip package for 111.txt file 111.tar.gz [Email protected] testb]# tar zcvf111. tar.gz111. txt111. Txt[[email protected] testb]# ls111. tar.gz111. txt222. Txt[[email protected] testb]# RM-rf111. Txt[[email protected] testb]# ls111. tar.gz222. txt
Unzip 111.tar.gz to current directory
[Email protected] testb]# tar zxvf111. tar.gz111. Txt[[email protected] testb]# ls111. tar.gz111. txt222. txt
unzip the 111.tar.gz to the specified directory/ROOT/TESTC [Email protected] testb]# tar-zxvf111. tar.gz-c/root/testc/111. Txt[[email protected] testb]# ll/root/testc/Total Dosage4-rw-r--r--.1Root root3September7 the: at 111. txt

Linux command-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.