linux 中的 tar 解压

简介: Type at the command prompt tar xvzf file-1.0.tar.gz - tgfo uncompress a gzip tar file (.tgz or .tar.
  1. Type at the command prompt
    tar xvzf file-1.0.tar.gz - tgfo uncompress a gzip tar file (.tgz or .tar.gz)
    tar xvjf file-1.0.tar.bz2 - to uncompress a bzip2 tar file (.tbz or .tar.bz2) to extract the contents.
    tar xvf file-1.0.tar - to uncompressed tar file (.tar)
    tar xvC /var/tmp -f file-1.0.tar - to uncompress tar file (.tar) to another directory
    • x = eXtract, this indicated an extraction c = create to create )  提取
    • v = verbose (optional) the files with relative locations will be displayed. 
    • z = gzip-ped; j = bzip2-zipped   z 对应 gzip类型压缩包  j对应bzip2类型压缩包
    • f = from/to file ... (what is next after the f is the archive file)  f 代表 from哪个压缩包
    • C = directory. In c and r mode, this changes the directory before adding the following files. In x mode, changes directoriy after opening the archive but before extracting entries from the archive. C  代表
  2. The files will be extracted in the current folder (most of the times in a folder with the name 'file-1.0').文件将被解压到与压缩包同一目录中。(很多时候被解压到 file-1.0文件夹中)
开始做,坚持做,重复做
相关文章
|
4月前
|
存储 数据管理 Linux
区分Linux中.tar文件与.tar.gz文件的不同。
总之,".tar"文件提供了一种方便的文件整理方式,其归档但不压缩的特点适用于快速打包和解压,而".tar.gz"文件通过额外的压缩步骤,尽管处理时间更长,但可以减小文件尺寸,更适合于需要节约存储空间或进行文件传输的场景。用户在选择时应根据具体需求,考虑两种格式各自的优劣。
692 13
Linux中将文件解压到指定目录
Linux中将文件解压到指定目录
|
9月前
|
Linux
Linux压缩与解压“助手”
gzip压缩解压 因为都是系统自带的我们不需要安装; ls 看一下目录当前的文件,创建一个 touch 123.txt 文件; 原文件消失,压缩解压 gzip 进行压缩,(“ gzip 123.txt ”),这样就压缩完毕了; gzip 进行解压,(“ gzip -d 123.txt.gz”),这样就解压完毕了; 原文件保留,gzip -k 123.txt、gzip -dk 123.txt.gz ;
191 9
|
算法 Linux 数据安全/隐私保护
“Linux压缩大师”:gzip、bzip2、tar与zip
在Linux系统管理中,文件压缩与解压至关重要,能有效减少存储空间占用并加快文件传输。常用工具包括gzip、bzip2、tar和zip。gzip采用Lempel-Ziv算法,压缩率高且速度快,适用于单个文件压缩,扩展名为.gz。bzip2压缩率更高但速度稍慢,同样用于单个文件,扩展名为.bz2。tar主要用于打包文件而不直接压缩,常与gzip或bzip2结合使用实现压缩打包。zip则是一种通用压缩工具,支持多文件压缩及密码保护,兼容性好。这些工具让Linux环境下的文件管理更加高效便捷。
424 1
在Linux中,如何使用tar命令归档文件?
在Linux中,如何使用tar命令归档文件?
|
Linux
【Deepin 20系统】Linux系统批量解压*.gz文件(不是.tar.gz)
在Deepin 20 Linux系统中如何使用命令行批量解压*.gz文件,提供了具体的命令示例,并简要提及了批量解压*.tar.gz和*.tar.bz2文件的方法。
276 2
|
存储 算法 Linux
.bz2是什么格式的文件?Linux如何解压这种类型的文件?
【8月更文挑战第3天】.bz2是什么格式的文件?Linux如何解压这种类型的文件?
2618 1
|
数据建模 Linux vr&ar
Linux下解压命令大全
Linux下解压命令大全
419 0
在Linux中,如何进行备份或归档文件(tar 命令)?
在Linux中,如何进行备份或归档文件(tar 命令)?
|
存储 Linux
在Linux中,如何通过tar命令创建和还原备份?
在Linux中,如何通过tar命令创建和还原备份?