13. -a 或–auto-compress:自动选择压缩方式(gzip或bzip2)。 14. –exclude:排除指定的文件或目录。 15. –remove-files:归档文件后删除源文件。 这些参数可以根据具体的需求进行组合使用,以完成不同的操作。例如,使用”tar -cvf archive.tar files”可以将指定的文件打包成归档文件;使用”tar -xvf archive.tar...
-x exclude files that follow (in xlist) -d extract files into exdir modifiers: -n never overwrite existing files -q quiet mode (-qq => quieter) -o overwrite files WITHOUT prompting -a auto-convert any text files -j junk paths (do not make directories) -aa treat ALL files as text -...
--exclude=PATTERN exclude files, given as a PATTERN -X, --exclude-from=FILE exclude patterns listed in FILE -T, --files-from=FILE get names to extract or create from FILE [root@localhost ~]#cattar-include/root [root@localhost~]#cattar-exclude/root/rootbak.tar/root/tmp.tar.bz2 [root...
-x或--extract或--get 从备份文件中还原文件。 -X<范本文件>或--exclude-from=<范本文件> 指定范本文件,其内含有一个或多个范本样式,让ar排除符合设置条件的文件。 -z或--gzip或--ungzip 通过gzip指令处理备份文件。 -Z或--compress或--uncompress 通过compress指令处理备份文件。
-N :比后面接的日期(yyyy/mm/dd)还要新的才会被打包进新建的文件中! --exclude FILE:在压缩的过程中,不要将 FILE 打包! 范例: 范例一:将整个 /etc 目录下的文件全部打包成为 /tmp/etc.tar [root@linux ~]# tar -cvf /tmp/etc.tar /etc
-v, --verbose verbosely list files processed -p :使用原文件的原来属性(属性不会依据使用者而变) -P :可以使用绝对路径来压缩! -N :比后面接的日期(yyyy/mm/dd)还要新的才会被打包进新建的文件中! --exclude FILE:在压缩的过程中,不要将 FILE 打包!
添加改变了和现有的文件到已经存在的压缩文件; -v,--verbose:显示指令执行过程; -W,--verify:向档案写入文件后尝试验证; -x,--extract,--get:从备份文件中还原文件; -z,--gzip,--ungzip:通过gzip指令压缩或解压缩备份文件; -Z,--compress,--uncompress:通过compress指令处理备份文件; --exclude=[pattern]...
tar cf <archive> <file(s) or location(s)> --remove-files 例如,使用files目录创建一个 tar 存档,并通过一个命令将其从磁盘中删除: tar cf files.tar files --remove-files检查目录内容以确认操作正常。 3. 从档案中提取 从档案或压缩档案中提取使用-xor--extract操作tar。附加选项取决于文件类型以及 tar...
-x, --extract, --get 从存档展开文件 其他参数 --atime-preserve 不改变转储文件的存取时间 -b, --block-size N 指定块大小为 Nx512 字节(缺省时 N=20) -B, --read-full-blocks 读取时重组块(???!!!) -C, --directory DIR 转到指定的目录 ...