Show all options


tar --help

Create Archive Of Specific Files

tar -vfcz outputfilename.gz inputfile1 inputfile2

Zipping Files And Directories

Use this to move to the directory containing the files and / or directories you want to zip


cd projects/myfolder
Zip 1 File

tar -vczf zip_output_filename.gz file_to_zip.a
Zip 2 Files

tar -vczf zip_output_filename.gz file_to_zip1.a file_to_zip2.a
Zip A File & 2 Directories

tar -vczf zip_output_filename.gz file_to_zip1.a directory_to_zip1 directory_to_zip2

"-vczf" are the options being used for the compress.

​Unziping


tar zxvf zip_filename.gz

"zxvf" are the options being used and will cause an overwrite if any files already exist

Note that if a file was set as executable when zipped this permission will remain when it is unzipped whether overwriting an existing file or not.

Unzipping From Dropbox

See here.

USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.