How to Create Zip File in Ubuntu using Command

Websolutionstuff | Jan-24-2024 | Categories : Other

Hey folks! If you're anything like me, sometimes you just want a quick and straightforward way to bundle up a bunch of files or folders into a neat little package. Well, good news – creating a zip file in Ubuntu using the command line is easier than you might think!

In this guide, I'll walk you through the steps, and trust me, it's as simple as typing a few commands into your terminal.

So, let's see how to create a zip file in Ubuntu using a command line, how to make a zip file in Ubuntu command line, ubuntu unzip command, zip command in Linux, and Linux zip command.

Create a step-by-step guide on creating a zip file in Ubuntu using the command line.

Method 1: Zip Folder Ubuntu Linux

Create a file using the following command.

zip -r zip_name.zip folder

Example:

zip -r laravel.zip Laravel

 

Method 2: Create Zip Multiple Folders at Once Linux Ubuntu

Create multiple zip files using a single Ubuntu command.

zip -r test.zip folder1 folder2 folder3

Example:

zip -r test.zip testFolder1 testFolder2 testFolder3

 

Method 3: Password Protected Folder Linux Ubuntu

Create password protected zip file using command line.

zip -e  test.zip folder

The command will be prompted to enter and verify the archive password:

Enter password:
Verify password:

Example:

zip -r -e test.zip TestFolder

 

Method 4: Create a zip all files and folders

if you want to zip all files and folders in the current directory, you can use.

zip -r myarchive.zip *

 

Verify the Zip File

To verify that the zip file was created successfully, you can use the unzip command to extract its contents:

unzip myarchive.zip

That's it! You've successfully created a zip file in Ubuntu using the command line. You can now share or move your zip file as needed.

 

Conclusion

Creating a zip file via the terminal is a quick and efficient way to compress your files and folders.

 


You might also like:

Recommended Post
Featured Post
Laravel 8 Ajax CRUD With Yajra Datatable
Laravel 8 Ajax CRUD With Yajra...

In this tutorial, we will see laravel 8 ajax crud with yajra datatable. I will show you how to create ajax crud ope...

Read More

Jan-05-2022

How to Install PHP PDO MySQL Extension in Ubuntu 22.04
How to Install PHP PDO MySQL E...

Hey there! If you're diving into PHP development on Ubuntu 22.04 and need to connect your applications to MySQL data...

Read More

Feb-28-2024

Laravel tips DB Models and Eloquent - Part 5
Laravel tips DB Models and Elo...

Welcome to the fifth installment of our ongoing series, "Laravel Tips: DB Models and Eloquent." In this latest...

Read More

Oct-20-2023

How to Convert Excel File into JSON in Javascript
How to Convert Excel File into...

Today in this small post i will show you how to convert excel file into json in javascript. Many time we have requi...

Read More

Jul-07-2021