Linux Shell Script Raiders Note sixth: packaging compression

Source: Internet
Author: User
Tags compress archive

Linux Shell Script Raiders notes Sixth chapter: Packing Compression1, package, unpack [[email protected] program_test]# tar-cf output.tar 11.txt 22.txt 33.txt [[email protected] program_test]# Tar- XF output.tar-c./tar-file///-c Specify which path to extract to? List the contents of the archive [[email protected] program_test]# TAR-TVF Output2.tar
-rw-rw-r--yy/yy 101843 2014-12-18 07:40 33.txt
Drwxrwxr-x yy/yy 0 2014-12-31 18:11 abc/
-rw-rw-r--yy/yy 0 2014-12-31 18:11 abc/def//[[email protected] program_test]# TAR-TF Output.tar
11.txt
22.txt
33.txt
33.txt
abc/
abc/def//Delete a file from a given archive file
[Email protected] program_test]# tar-f Output.tar--delete 33.txt
[Email protected] program_test]# TAR-TF Output.tar
11.txt
22.txt
abc/
Abc/def
2, compression//bulk packaging and compression implementation [[email protected] touch_more]# cat gzip_all_files.sh
#!/bin/bash
textfiles= ' ls | grep "TXT" | Xargs '

Echo $textfiles
for textfile in $textfiles;
Do
TAR-RVF Archive.tar $textfile//package files in an additional form.
Done

Gzip Archive.tar//Compress archive files

Extract-x extracts the file, and-Z uses the gzip style. [Email protected] touch_more]# tar-zxvf archive.tar.gz-c./test_unzip/

Ming Yi World

Reprint please indicate source, original address: http://blog.csdn.net/laoyang360/article/details/42364849

If you feel this article is helpful, please click on the ' top ' support, your support is I insist on writing the most power, thank you!


Linux Shell Script Raiders Note sixth: packaging compression

Related Article

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.