-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, -...
5 追加-r, --append append files to the end of an archive:附加文件tar rvf applepen.tar a1 a2把a1、a2追加到已经打好的包里 6 删除--delete delete from the archive (not on mag tapes!):删除包里的文件tar --delete -vf applepen.tar a1 a2 a3删除包里面的文件a1、a2、a3,没有的话会报错...
LOG.warn("The name of the file to append in the archive is null or empty."); return; } ArchiveStreamFactory asf = new ArchiveStreamFactory(); File tempFile = new File(tarPath, "tmpTar.tar"); tempFile.createNewFile(); try { FileInputStream fis = new FileInputStream(tarFile); Archive...
}finalFile tarFile =newFile(tarPath, tarFileName);finalFile fileToAdd =newFile(tarPath, file2WriteName); FileUtils.write(fileToAdd, file2WriteContent);if(file2WriteName ==null||file2WriteName.isEmpty()) { LOG.warn("The name of the file to append in the archive is null or empty.")...
tar-xf archive.tar# 展开归档文件 archive.tar中的所有文件。 主操作模式:-A, --catenate, --concatenate 追加tar文件至归档-c, --create 创建一个新归档-d, --diff, --compare 找出归档和文件系统的差异 --delete 从归档(非磁带!)中删除 -r, --append追加文件至归档结尾-t, --list 列出归档内容--...
archive -P, --absolute-names don't strip leading `/'s from file names --recursion recurse into directories (default) --suffix=STRING backup before removal, override usual suffix ('~' unless overridden by environment variable SIMPLE_BACKUP_SUFFIX) -T, --files-from=FILE get names to extract...
--no-auto-compress do not use archive suffix to determine thecompression program-z, --gzip, --gunzip, --ungzip 通过 gzip 过滤归档-Z, --compress, --uncompress 通过 compress 过滤归档 -J, --xz filter the archive through xz--lzop 通过 lzop 过滤归档 本地文件选择: --add-file=文件 添加...
[root@linuxtechi~]#tar-xvf myarchive.tar-C/tmp/ 示例6:释放 tar 文件中的指定文件或目录 假设你只要释放 tar 文件中的 anaconda-ks.cfg 到 /tmp 目录。 语法如下: #tar–xvf{tar-file}{file-to-be-extracted}-C{path-where-to-extract}
[root@linuxtechi ~]# tar -xvf myarchive.tar -C /tmp/ 1. 示例6:释放 tar 文件中的指定文件或目录 假设你只要释放 tar 文件中的 anaconda-ks.cfg 到 /tmp 目录。 语法如下: 复制 # tar –xvf {tar-file } {file-to-be-extracted } -C {path-where-to-extract}[root@linuxtechi tmp]# tar...