Just type in the terminal for the man tar command manual.tar
The meaning of -xvzf is
-x --extract = extract files from an archive
-v, --verbose = verbosely list files processed
-z, --gzip = gzipped files eg. for tar.gz packages
-f, --file ARCHIVE = use archive file or device ARCHIVE
If you have two zip files and a.zip in your current directory, thenb.zip
$ cp *.zip destination/
expands to
$ cp a.zip b.zip destination/
The semantics for is to copy both cp and a.zip to destination.b.zip
If you type
$ cp \*.zip destination/
it simply "expands" to
$ cp '*.zip' destination/
i.e. it will try to copy a single file named "*.zip" to destination, which is not what you want.
On the other hand if you type
$ unzip *.zip -d destination/
it will again expand to
$ unzip a.zip b.zip -d destination/
The semantics for is to find a file named "b.zip" inside the archive "a.zip", which is again not what you want.unzip
If you type
$ unzip \*.zip -d destination/
the command does not simply try to unzip the file called unzip but it will unzip all files ending with *.zip..zip
The difference is that both commands interpret their arguments differently.
Type for more information, but this command should do the trick:man tar
tar -xvzf community_images.tar.gz
To explain a little further, collected all the files into one package, tar. The gzip program applied compression, hence the community_images.tar extension. So the command does a couple things:gz
f: this must be the last flag of the command, and the tar file must be immediately after. It tells tar the name and path of the compressed file.z: tells tar to decompress the archive using gzipx: tar can collect files or extract them. x does the latter.v: makes tar talk a lot. Verbose output shows you all the files being extracted.To extract into a custom folder, add the option with a folder name of your choice:-C
tar -xvzf community_images.tar.gz -C some_custom_folder_name
According to http://www.manpagez.com/man/1/unzip/ you can use the option to overwrite files:-o
unzip -o /path/to/archive.zip
Note that , like most of -o's options, has to go before the archive name.unzip
If the command isn't already installed on your system, then run:unzip
sudo apt-get install unzip
After installing the unzip utility, if you want to extract to a particular destination folder, you can use:
unzip file.zip -d destination_folder
If the source and destination directories are the same, you can simply do:
unzip file.zip