difference between zip and tar tar just archives a multiple files or directories without compression. zip uses compression to archive the files However there are command line arguments that will combine tar with zip compression.
==Zip== Create a zip file and add files to it
zip zipfilename file1 file2 file3
zip a directory recursively
zip -r zipfile name directory/ this must be done from 1
level up from the directory or explicitly include the entire path
update a zip file `zip -u zipfilename filename1 filename2 ``
==Tar==
creating a compressed tar file (tar.gz)
tar -czvf archive.tat.gz /path to folder
extracting from a compressed archive
tar -xzvf archive.tar.gz extract to a specific folder
tar -xzvf archive.tar.gz -C /path/to/destination
-c is create -x is expand -v is verbose to show what it is doing -f is to specify the file to create or extract
view contents without extracting ``tar -tvf archive.tar.gz
for maximum compression you can substitute a j for the z this will use bzip compression instead of gzip. these files will have a .bz file suffix by convention. be aware while bzipped files have more compression they are also much slower to create and extract. .gz is commonly used as it’s compression is good enough and it is much faster.