About Cacher
Web App
Download
Sign In
Sign Up
menu
Cacher is the code snippet organizer for pro developers
We empower you and your team to get more done, faster
Learn More
Akagi201
9/7/2014 - 1:40 PM
share
Share
add_circle_outline
Save
tar.md
tar.md
content_copy
file_download
Rendered
Source
Specs
tar的第一个参数应该是一个函数/功能(function), 是短选项Acdrtux当中之一, 或者是长选项之一.
一个功能选项(function letter)不必须以"-"为前缀,一个长功能选项(long function name)必须以"--"为前缀.
选项
-c / --create: 创建
-x / --extrace / -- get: 解压
-t / --list: 查看
注意: 在参数下达中, c/x/t 仅能存在一个, 不可同时存在, 因为不可能同时压缩和解压.
-z / --gzip / --gunzip / --ungzip: gzip
-j / --bzip2: bzip2
-J / --xz: xz
-f / --file ARCHIVE: 使用文档名, 注意之后要立即接文档名, 不可再跟其他参数.
例子
仅打包, 不压缩: tar -cvf /tmp/etc.tar /etc
打包后, 以gzip压缩: tar -zcvf /tmp/etc.tar.gz /etc
打包后, 以bzip2压缩: tar -jcvf /tmp/etc.tar.bz2 /etc
解压时, 把c改为x.
解压bzip2(首选, 压缩比更高): tar xvjf linux-x.y.z.tar.bz2
解压gzip: tar xvzf linux-x.y.z.tar.gz
解压后, 源码位于linux-x.y.z目录下
clear