Here are tar
some summary 12 of the commands:
# tar -cvf test.tar test 仅打包,不压缩 # tar -zcvf test.tar.gz test 打包后,以gzip压缩 在参数f后面的压缩文件名是自己取的,习惯上用tar来做,如果加z参数,则以tar.gz 或tgz来代表gzip压缩过的tar file文件
Decompression operation:
#tar -zxvf /usr/local/test.tar.gz
Detailed description of the TAR decompression command
-c: 建立压缩档案-x:解压-t:查看内容-r:向压缩归档文件末尾追加文件-u:更新原压缩包中的文件
These five are stand-alone commands, which use one of the compression decompression, and can be used with other commands but only one. The following parameters are optional when compressing or extracting files as needed.
-z:有gzip属性的-j:有bz2属性的-J:具有xz属性的(注3)-Z:有compress属性的-v:显示所有过程-O:将文件解开到标准输出
The following parameter-F is required
-F: Use the file name, remember that this parameter is the last parameter, can only be followed by the file name.
This command adds all the. gif files to the All.tar package. -R is meant to increase the file.
This command is to update the original tar package All.tar in the logo.gif file,-U is to indicate the meaning of the update file.
This command is to list all the files in the All.tar package,-T is to list the meaning of the file
This command is to solve all the files in the All.tar package,-X is the meaning
Compression
tar –cvf jpg.tar *.jpg //将目录里所有jpg文件打包成tar.jpgtar –czf jpg.tar.gz *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用gzip压缩,生成一个gzip压缩过的包,命名为jpg.tar.gztar –cjf jpg.tar.bz2 *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用bzip2压缩,生成一个bzip2压缩过的包,命名为jpg.tar.bz2tar –cZf jpg.tar.Z *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用compress压缩,生成一个umcompress压缩过的包,命名为jpg.tar.Zrar a jpg.rar *.jpg //rar格式的压缩,需要先下载rar for linuxzip jpg.zip *.jpg //zip格式的压缩,需要先下载zip for linux
Extract
tar –xvf file.tar //解压 tar包tar -xzvf file.tar.gz //解压tar.gztar -xjvf file.tar.bz2 //解压 tar.bz2tar –xZvf file.tar.Z //解压tar.Zunrar e file.rar //解压rarunzip file.zip //解压zip
Summarize
(1) *.tar 用 tar –xvf 解压 (2) *.gz 用 gzip -d或者gunzip 解压 (3) *.tar.gz和*.tgz 用 tar –xzf 解压 (4) *.bz2 用 bzip2 -d或者用bunzip2 解压 (5) *.tar.bz2用tar –xjf 解压 (6) *.Z 用 uncompress 解压 (7) *.tar.Z 用tar –xZf 解压 (8) *.rar 用 unrar e解压 (9) *.zip 用 unzip 解压 (10) *.xz 用 xz -d 解压 (11) *.tar.xz 用 tar -zJf 解压
- Source: http://blog.chinaunix.net/uid-1840233-id-3147304.html?
- Reference: Http://www.jb51.net/LINUXjishu/43356.html?
- The original text does not have
.xz
a description of the format, the transfer is added?
Linux Unzip files