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.
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
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
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).
- 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) :
- Click create if done