I am a newbie in Linux.Whats is the complete process to zip and unzip a directory and its files.Please mention if any installation has to be done.

marked as duplicate by Rinzwind, muru, Ron, heemayl, Eric Carvalho Aug 13 '15 at 11:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You say you are a newbie. Maybe you got Windows-experiences. If you do not have the packages installed yet, you need to

sudo apt-get install zip gzip tar

first (or by a graphical pkg-manager).

Then, for an entry it would be the easiest way to use zip/unzip:

zip -r my_arch.zip my_folder

where -r means "recursive".

To unzip you simply use

unzip my_arch.zip

Zip stores relative path names by default. There are several parameter-options available for zip. For that read: the manual (man zip). For a starting this will do.

Most often you will see .tar.gz endings in linux-world. That's the product of two tools: TAR (the tape archiver) and GZIP (the GNU-Zip). Tar has got the call option to automatically gzip/gunzip files after "taring".

tar -cvzf may_arch.tar.gz my_folder


  • -c means "create"
  • -v means "verbose" (sometimes bothersome and slowing down...)
  • -z means "use (GNU)zip"
  • -f XYZ declares the name of the output file. (You should chose a helping name like XYZ.tar.gz)

There may also be .tar.bz2 endings. This is the product of the -j parameter instead of the -z parameter: you will choose compression with BZIP2 (-> man bzip2).

To extract you simply use -x (eXtract) instead of -c (Create):

tar -xvzf may_arch.tar.gz

Happy "zipping"!

You can use the zip and unzip command line utilities. These can be installed by running

sudo apt-get install zip unzip

in the terminal.

I know several ways, but since you're new on linux. So I'll tell you how to zip a file using GUI method (the easiest way).

  1. Create a new folder and fill it with anything you want, for example many of file (In my case, I'll fill it with theme folder) : enter image description here

enter image description here

  1. Right click the folder you want to zip and select "Compress..." option : enter image description here

  2. You can choose which file format you want by clicking combobox next to "Filename" textbox. Also you can set the folder you want to zip location. enter image description here

Clicking "Other options" will lead you to password section, in other word you can set password for your preferred file so someone (include you) have to enter password before unzip the file. enter image description here

  1. Click create if done
  • 1
    and how would you see the progress while zip is running in background, because this GUI zip technique doesn't display progress bar. are there any commands to run in another terminal to show progress in %, – Ali Jul 18 '17 at 19:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.