Linux/Unix下使用tar命令压缩和解压[tar Examples]
来源:互联网 发布:floydwarshall算法 编辑:程序博客网 时间:2024/06/06 10:54
压缩
tar -cvf xxx.tar.gz yourdirectory
解压
解压tar gz(Gzip)文件tar -xzvf mystuff.tgz解压普通的tar文件tar -xvf mystuff.tar
参数的意义
c Create a new archive.
t List the contents of an archive.
x Extract the contents of an archive.
f The archive file name is given on the command line (required whenever the tar output is going to a file)
M The archive can span multiple floppies.
v Print verbose output (list file names as they are processed).
u Add files to the archive if they are newer than the copy in the tar file.
z Compress or decompress files automatically.
tar,tar.gz/tgz
特别要注意的是,".tar"文件不是一个压缩过后的文件,它只是把所有文件集中在了一个文件里,这个文件时没有进行压缩过。而".tar.gz"或者".tgz"文件是被压缩过的。
如果你想对你的tar文件,进行压缩,那么你需要再运行gzip命令。所以如果你想直接压缩,最好在执行tar命令的时候,就加上"z"选项,这样就可以省去gzip这一步。
从文件大小也能看出来.tar和.tar.gz的区别,我的一个目录下有很多源文件,不做任何处理前目录文件的大小为88M,tar命令执行后.tar文件的大小是80M,再gzip之后的大小是9.9M,可以看出.tar文件基本是未经压缩的文件,只有gzip后,文件才会被压缩。
另外需要注意的是,linux/unix中没有untar这个命令
====EOF====
转载请注明出处:http://blog.csdn.net/pan_tian/article/details/7686408
- Linux/Unix下使用tar命令压缩和解压[tar Examples]
- Linux/Unix下使用tar命令压缩和解压[tar Examples]
- linux下的tar压缩解压命令
- Linux下压缩与解压命令tar
- Linux命令 tar 压缩和解压
- Linux 压缩和解压命令tar
- Unix/linux解压tar命令
- Linux压缩解压命令tar
- Linux tar 命令 压缩、解压
- Linux-tar压缩解压命令
- linux tar压缩解压命令
- linux下压缩解压tar
- linux tar压缩和解压
- linux tar 解压和压缩
- Linux tar压缩和解压
- linux下tar.gz、tar、bz2、zip等解压缩、压缩命令小结(tar包解压)
- Linux下压缩与解压tar, tar.gz和tar.bz2
- linux下 解压 tar 命令
- Photoshop把杂乱的人像图片简化处理
- win7中oracle10g的安装出现TNS12465:权限被拒绝的错误
- 申请内存
- WSAAsyncSelect模型
- java程序报错经验
- Linux/Unix下使用tar命令压缩和解压[tar Examples]
- size_t内存申请
- 使用grails框架在service中接受controller中的请求值是取出出现[Ljava.lang.String;@d22647形式
- 访问内存越界
- 15 个顶级 HTML5 游戏引擎
- NULL指针
- 开源浏览器引擎Webkit引发浏览器格局变化
- ps一步修复偏灰暗的风景照片教程
- 完全卸载Oracle 10g win7系统 同样适用xp系统