tar -xvf file.tar.gz
# compress
tar -czvf projects.tar.gz projects/
# extract
tar -xzvf projects.tar.gz
-c, --create
create a new archive
-x, --extract, --get
extract files from an archive
-z, --gzip, --gunzip --ungzip
-v, --verbose
verbosely list files processed
-f, --file ARCHIVE
use archive file or device ARCHIVE
tar [-] A --catenate --concatenate | c --create | d --diff --compare | --delete | r --append | t --list |
--test-label | u --update | x --extract --get [options] [pathname ...]
tar -xzf file.tar.gz
tar -xzvf archive.tar.gz
tar -czvf projects.tar.gz projects/
# compress
tar czvf < archive_name >.tar.gz < path >
# extract
tar xzvf < archive_name >.tar.gz
tar xzvf < archive_name >.tar.gz -C /home/usera/tmp
They are identical.
I think in the old package repo days,
.tgz was used because files on DOS floppies could only have three letter
extensions. When this limitation was removed,
.tar.gz was used to be more verbose by showing both the archive type (tar)
and zipper (gzip).
tar -xf archive.tar.gz
tar -xvzf community_images.tar.gz
Also, to extract in a specific directory
for eg. to extract the archive into a custom my_images directory .
tar -xvzf community_images.tar.gz -C my_images
tar –xvzf documents.tar.gz
tar -xvf archive.tar.gz
or
tar -xf archive.tar.gz -C /home/linuxize/files
tar -xf archive.tar.gz
tar -xf archive.tar.gz -C /home/linuxize/files
tar -zxvf {file.tar.gz}
tar cfz <Required tarball name> <File names>
tar -xvzf community_images.tar.gz
tar -czvf projects.tar.gz $HOME/projects/
tar –xvf documents.tar
gunzip.exe example.tar.gz
tar.exe xf example.tar
tar -xzf archive-name.tar.gz
cd archive-name
./configure
make
sudo make install