Ubuntu下解压缩zip,tar,tar.gz,tar.bz2格式的文件

zip:

压缩目录:  zip -r archive_name.zip directory_to_compress

解压zip文件:unzip archive_name.zip

tar:

打包: tar -cvf archive_name.tar directory_to_compress

解包: tar -xvf archive_name.tar.gz

tar.gz:

压缩目录: tar -zcvf archive_name.tar.gz directory_to_compress

解压tar.gz文件到当前目录: tar -zxvf archive_name.tar.gz

解压tar.gz文件到指定目录: tar -zxvf archive_name.tar.gz -C /tmp/extract_here/

tar.bz2:

压缩成tar.bz2:  tar -jcvf archive_name.tar.bz2 directory_to_compress

解压到指定目录: tar -jxvf archive_name.tar.bz2 -C /tmp/extract_here/

# zip -r archive_name.zip directory_to_compress

猜你喜欢

转载自www.cnblogs.com/confessionlouis/p/9162653.html
今日推荐