当前位置:   article > 正文

Linux-tar命令_bsdtar -c

bsdtar -c

tar(bsdtar)操作归档文件

第一个选项必须是一个模式说明

  • -c Create创建
  • -r Add/Replace添加/替换
  • -t List列表
  • -u Update更新
  • -x Extract解压缩

常见的选项:

  • -b # Use # 512-byte records per I/O block每个I/O块使用512字节的记录
  • -f Location of archive存档位置
  • -v Verbose详细
  • -w Interactive互动

创建:tar -c[选项][<file> | <dir> | @<archive> | -c <dir>] <file>,<dir>添加这些项到存档

  • -z, -j, -J, --lzma Compress archive with gzip/bzip2/xz/lzma 使用gzip/bzip2/xz/lzma压缩归档文件
  • –format {ustar|pax|cpio|shar} Select archive format 选择archive format(存档格式)
  • –exclude Skip files that match pattern 排除<模式>跳过匹配模式的文件
  • -C Change to before processing remaining files 在处理剩余文件之前更改为
  • @ Add entries from to output 添加中的条目到输出

列表:tar -t [options] [<patterns>]

  • If specified, list only entries that match 如果指定,则只列出匹配的条目

提取:tar -x [options] [<patterns>]

If specified, extract only entries that match 如果指定,则只提取匹配的条目

  • -k Keep (don’t overwrite) existing files 保留(不要覆盖)现有文件
  • -m Don’t restore modification times 不恢复修改时间
  • -O Write entries to stdout, don’t restore to disk 将项写入标准输出,不要还原到磁盘
  • -p Restore permissions (including ACLs, owner, file flags) 恢复权限(包括acl、所有者、文件标志)

bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号