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