tar command extract and compress

来源:互联网 发布:传奇技能数据库计算 编辑:程序博客网 时间:2024/06/05 07:25

eg:

tar czvf ../rootfs.tar.gz   -----compress

tar zxvf KK.tar.gz        -----extract .gz

tar jxvf KK.tar.bz2        -----extract .bz2


EXAMPLES
     Create archive.tar from files foo and bar.
           tar -cf archive.tar foo bar
     List all files in archive.tar verbosely.
           tar -tvf archive.tar
     Extract all files from archive.tar.
           tar -xf archive.tar



TAR(1)                    BSD General Commands Manual                   TAR(1)

NAME
     tar — The GNU version of the tar archiving utility

SYNOPSIS
     tar [-] A --catenate --concatenate | c --create | d --diff --compare |
         --delete | r --append | t --list | --test-label | u --update | x
         --extract --get [options] [pathname ...]

DESCRIPTION
     Tar stores and extracts files from a tape or disk archive.

     The first argument to tar should be a function; either one of the letters
     Acdrtux, or one of the long function names.  A function letter need not
     be prefixed with ``-'', and may be combined with other single-letter
     options.  A long function name must be prefixed with --.  Some options
     take a parameter; with the single-letter form these must be given as sep‐
     arate arguments.  With the long form, they may be given by appending
     =value to the option.



FUNCTION LETTERS
     Main operation mode:

     -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, --list

list the contents of an archive

     --test-label
           test the archive volume label and exit

     -u, --update
           only append files newer than copy in archive

     -x, --extract, --get
           extract files from an archive


原创粉丝点击