kali linux解压tar.xz,Linux—解压缩命令总结(tar/zip)

本文介绍了Linux系统中常用的压缩和解压缩命令tar和zip的使用方法,包括tar命令的参数介绍,如-c创建压缩文件,-x解压缩,-v显示过程,-f指定压缩文件,-z支持gzip解压,-j支持bzip2解压,-C切换目录,-r添加或更新文件,-u更新文件,-t列出内容,-d删除压缩包内文件,以及zip命令的-f,-d,-r,-j,-u,-v等参数的用法。同时,文章还给出了多个实用的压缩和解压缩示例。
摘要由CSDN通过智能技术生成

1 tar

1.2 tar介绍

tar命令是linux系统中对文件和目录解压缩命令。tar命令可以用于对后缀名为.tar,tar.gz等常用文件。

1.3 tar参数

系统中通过tar --help查看:

Main operation mode:

-A, --catenate, --concatenate append tar files to an archive

-c, --create create a new archive

-d, --diff, --compare find differences between archive and file system

--delete delete from the archive (not on mag tapes!)

-r, --append append files to the end of an archive

-t, --list list the contents of an archive

--test-label test the archive volume label and exit

-u, --update only append files newer than copy in archive

-x, --extract, --get extract files from an archive

Operation modifiers:

--check-device check device numbers when creating incremental

archives (default)

-g, --listed-incremental=FILE handle new GNU-format incremental backup

-G, --incremental handle old GNU-format incremental backup

--ignore-failed-read do not exit with nonzero on unreadable files

--level=NUMBER dump level for created listed-incremental archive

-n, --seek archive is seekable

--no-check-device do not check device numbers when creating

incremental archives

--no-seek archive is not seekable

--occurrence[=NUMBER] process only the NUMBERth occurrence of each file

in the archive; this option is valid only in

conjunction with one of the subcommands --delete,

--diff, --extract or --list and when a list of

files is given either on the command line or via

the -T option; NUMBER defaults to 1

--sparse-version=MAJOR[.MINOR]

set version of the sparse format to use (implies

--sparse)

-S, --sparse handle sparse files efficiently

Overwrite control:

-k, --keep-old-files don't replace existing files when extracting,

treat them as errors

--keep-newer-files don't replace existing files that are newer than

their archive copies

--no-overwrite-dir preserve metadata of existing directories

--overwrite overwrite existing files when extracting

--overwrite-dir overwrite metadata of existing directories when

extracting (default)

--recursive-unlink empty hierarchies prior to extracting directory

--remove-files remove files after adding them to the archive

--skip-old-files don't replace existing files when extracting,

silently skip over them

-U, --unlink-first remove each file prior to extracting over it

-W, --verify attempt to verify the archive after writing it

Select output stream:

--ignore-command-error ignore exit codes of children

--no-ignore-command-error treat non-zero exit codes of children as

error

-O, --to-stdout extract files to standard output

--to-command=COMMAND pipe extracted files to another program

Handling of file attributes:

--atime-preserve[=METHOD] preserve access times on dumped files, either

by restoring the times after reading

(METHOD='replace'; default) or by not setting the

times in the first place (METHOD='system')

--delay-directory-restore delay setting modification times and

permissions of extracted directories until the end

of extraction

--group=NAME force NAME as group for added files

--mode=CHANGES force (symbolic) mode CHANGES for added files

--mtime=DATE-OR-FILE set mtime for added files from DATE-OR-FILE

-m, --touch don't extract file modified time

--no-delay-directory-restore

cancel the effect of --delay-directory-restore

option

--no-same-owner extract files as yourself (default for ordinary

users)

--no-same-permissions apply the user's umask when extracting permissions

from the archive (default for ordinary users)

--numeric-owner always use numbers for user/group

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值