How to handle archive.tar.gz

maybe you need know some options about tar:

-?, --help                       give this help list
-c, --create                     create a new archive
-x, --extract, --get             extract files from an archive
-t, --list                       list the contents of an archive
-f, --file=ARCHIVE               use archive file or device ARCHIVE
-z, --gzip, --gunzip, --ungzip   filter the archive through gzip
-v, --verbose                    verbosely list files processed

Simple to use:

  1. create a archive.tar.gz:
tar -czvf archive.tar.gz sourceFile
tar -czvf archive.tar.gz sourceFile1 sourceFile2 ... sourceFileN
example:
tar -czvf archive.tar foo bar  # Create archive.tar from files foo and bar.
  1. verbose a archive.tar.gz:
tar -tzvf archive.tar.gz
  1. extract a archive.tar.gz
tar -xzvf archive.tar.gz

你可能感兴趣的:(How to handle archive.tar.gz)