How to Zip & Unzip file, directoies using terminal?

Zaid Jaber by Zaid Jaber
How to Zip & Unzip file, directoies using terminal?

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)

Read More

How to enable dark mode... omg For while now most of companies are going forward with enabling...
How to create a bootabl... omg In this article we will take a look on how to create a bootable...
lHow to install TablePl... omg In this article we will take alook on new Database IDE called T...
How to enable dark mode... omg In this article we will take a look on how to enable dark mode ...
How to Clear Viewing Ac... omg In this article we will take a look on how to clear your viewin...
Now to install Atom tex... omg In this tutorial we will take alook on how to install Atom Text...