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 In this article we will be taking a look on how to enable dar...
How to enable Audio des... omg In this article we will take alook on how to eale audio descri...
How to disable GPS loca... omg In this article we will take alook on how to disable the GPS lo...
How to install Signal P... omg In this article we will take alook on how to install signal pri...
How to delete Imo Accou... omg In this article we will take alook on how to delete yout Imo Ac...
How to share your locat... omg In this tutorial we will take a look on how to share your locat...