In this tutorial you will learn how to zip & unzip a file, and you will be able to tar & untar a directory filled with your files.
Open your terminal and let's get started.
Step 1: Zip & Unzip a file
~$ gzip <file name>
Notice: if the file name has spaces add the backslash like this <file\ name>
you will get a .gz file
To unzip it
~$ gunzip <file\ name.gz>
Step 2: Tar & Untar a directory
1. GO to the directory you want to Tar
~$ cd <path/to/directory>
2. write the following command to tar
~$ tar cvf <directory_name.tar> <files names you want to add to the directory_name.tar with spaces between them>
To Untar the direcotry
~$ tar xvf <directory_name.tar>
That's it.
Follow me @zaidjaber
Category: How To
Comments (0)