TAR命令参数详解
每次使用都要查帮助,只怪自己记不住。发上来方便查。 TAR 命令名 tar - tar 档案文件管理程序的 GNU 版本。下面将逐个介绍其含义 总览 tar [ - ] A --catenate --concatenate | c --create | d --diff --compare | r --append | t --list | u --update | x -extract --get [ --atime-preserve ] [ -b, --block-size N ] [ -B, --read-full-blocks ] [ -C, --directory DIR ] [ --checkpoint ] [ -f, --file [HOSTNAME:]F ] [ --force-local ] [ -F, --info-script F --new-volume-script F ] [ -G, --incremental ] [ -g, --listed-incremental F ] [ -h, --dereference ] [ -i, --ignore-zeros ] [ -I, --bzip ] [ --ignore-failed-read ] [ -k, --keep-old-files ] [ -K, --starting-file F ] [ -l, --one-file-system ] [ -L, --tape-length N ] [ -m, --modification-time ] [ -M, --multi-volume ] [ -N, --after-date DATE, --newer DATE ] [ -o, --old-archive, --portability ] [ -O, --to-stdout ] [ -p, --same-permissions, --preserve-permissions ] [ -P, --absolute-paths ] [ --preserve ] [ -R, --record-number ] [ --remove-files ] [ -s, --same-order, --preserve-order ] [ --same-owner ] [ -S, --sparse ] [ -T, --files-from F ] [ --null ] [ --totals ] [ -v, --verbose ] [ -V, --label NAME ] [ --version ] [ -w, --interactive, --confirmation ] [ -W, --verify ] [ --exclude FILE ] [ -X, --exclude-from FILE ] [ -Z, --compress, --uncompress ] [ -z, --gzip, --ungzip ] [ --use-compress-program PROG ] [ --block-compress ] [ -[0-7][lmh] ] filename1 [ filename2, ... filenameN ]
1)展开 abc.tar.gz 使用命令: tar xvzf abc.tar.gz 展开 abc.tar 使用命令: tar xvf abc.tar 2)将当前目录下的 man 目录及其子目录存成存档 man.tar tar cf man.tar ./man -A, --catenate, --concatenate
--atime-preserve -b, --block-size N -B, --read-full-blocks -C, --directory DIR 转到指定的目录 --checkpoint -f, --file [HOSTNAME:]F --force-local -F, --info-script F --new-volume-script F -G, --incremental -g, --listed-incremental F -h, --dereference -i, --ignore-zeros --ignore-failed-read -k, --keep-old-files -K, --starting-file F -l, --one-file-system -L, --tape-length N -m, --modification-time -M, --multi-volume -N, --after-date DATE, --newer DATE -o, --old-archive, --portability -O, --to-stdout -p, --same-permissions, --preserve-permissions -P, --absolute-paths --preserve -R, --record-number --remove-files -s, --same-order, --preserve-order -S, --sparse -T, --files-from F --null --totals -v, --verbose -V, --label NAME --version -w, --interactive, --confirmation -W, --verify --exclude FILE -X, --exclude-from FILE -y, --bzip2, --bunzip2 -Z, --compress, --uncompress -z, --gzip, --ungzip --use-compress-program PROG --block-compress -[0-7][lmh] -------------------------- 打包: tar -cf soft.tar soft 解包: tar -xf soft.tar soft 压缩目录 打包压缩:tar czvf usr.tar.gz /home 解压缩:tar xzvf usr.tar.gz 压缩文件(对于目录失效) 压缩:zip good.zip good1 good2 解压:unzip good.zip 本文出自 51CTO.COM技术博客 |



极光苏键
博客统计信息
热门文章
最新评论
友情链接
