1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| Options: -A, --catenate 追加一个tar包的文件到另一个tar包,即合并两个tar包,将后者合并到前者 -c, --create 创建一个tar包 -d, --diff, --compare 比较tar包中的文件和文件系统中的文件是否相同,可用来判断解压后文件是否有修改 -r, --append 追加文件到tar包 -t, --list 显示tar包中的文件列表 -u, --update 追加变更的文件到tar包,否则不追加 -x, --extract, --get 解压tar包
-k, --keep-old-files 解压时保留已存在的文件并提示,而不是直接覆盖 --keep-newer-files 当已存在的文件比tar包中的文件更新时不要覆盖 --remove-files 当文件被添加到tar包后删除原文件 --skip-old-files 跳过已存在的文件 -O, --to-stdout 解压tar包到标准输出 --group=NAME 修改添加到tar包中的文件的所属组 --mode=CHANGES 修改tar包中的文件权限 --owner=NAME 修改添加到tar包中的文件的所有者 -f, --file=ARCHIVE 指定tar包名称 -a, --auto-compress 根据文件名后缀自动判断压缩格式进行打包压缩 -j, --bzip2 使用bzip2压缩 -J, --xz 使用xz压缩 -z, --gzip 使用gzip压缩 -Z, --compress 使用compress压缩 --backup[=CONTROL] 删除或覆盖前先备份,可选参数number,simple等 -C, --directory=DIR 指定解压缩目录 --exclude=PATTERN 排除指定文件,支持通配符,默认为递归排除 -P, --absolute-names 保留文件开头的/路径,即保留绝对路径.注意该选项可能会覆盖系统文件,慎用! --recursion 递归打包子目录(default) --no-recursion 不递归打包子目录 --suffix=STRING 指定备份文件的后缀,配合--bakcup使用 -T, --files-from=FILE 指定文件列表 -X, --exclude-from=FILE 排除文件列表 --full-time 显示完整的时间戳 --index-file=FILE 将显示内容保存到指定文件 --show-defaults 显示tar命令的默认选项 --utc 使用UTC时间显示mtime -v, --verbose 显示详情 -w, --interactive 交互模式,每次操作均提示
File name matching options (affect both exclude and include patterns): --anchored 匹配文件名 --ignore-case 忽略大小写 --no-anchored patterns match after any `/' (default for exclusion) --no-ignore-case 区分大小写 (default) --no-wildcards 完全字符串匹配 --no-wildcards-match-slash wildcards do not match `/' --wildcards 通配符批评 (default) --wildcards-match-slash wildcards match `/' (default for exclusion)
|