Skip to main content

 

How to Zip and Unzip file & folders in Termux 🤐📁

Hey Guys, It's me Ashutosh Raghav 🙋🏻‍♂️, Termux is a terminal emulator that has the ability to do a lot of advance level things but, these things can only be done when you know basic things like, installing packages and downloading files inside the termux using command line and knowing how to zip and unzip the files. since compression is one of the most common things that we see on the internet while working on any kind of project I think we all should know how to zip or unzip any files. This is just a termux-basics post but it is as important as using advance level termux tools so make sure you learn it well and become a successful ethical hacker or at least a good Termux user. 🖥💻


What is the need for Zip and Unzip in Termux?

While working with files inside termux or on any other computer, we use zip to keep multiple files in a digital bag. Let's say you have created a website in your termux and it has 10 files and a folder, and you wanna share it to the world by internet, how are you going to do it? we can't share files one by one so we use zip as a zipped bag to carry everything inside just one zip file and if anyone downloads it, they can again unzip it and they will get all the files safely without any file corruption. So one of the main reasons to use zip files is to keep the data in an organized manner.

How to Zip and Unzip file & folders in Termux

The other main reason to use zip files is that, it allows us to do compression and encryption, so let's say you want to send a 1GB file to your friend, One way is to just send him the file and it will take a lot of time to upload and download or you can just use compression on your file by making it a compressed zip file and the size will be reduced around 50% so when the file will be in compressed form the size will be around 500MB. If you want to lock multiple files so that only specific people can access them then you can lock the zip file and tell them the password, these password-protected zip files can only be accessed by users with actual passwords. I think these are enough reasons to learn these simple commands so let's begin. 


How to Zip and Unzip files & folders in Termux?

Install zip package in Termux:

First of all, you need to install one simple package inside your termux name zip, just copy and paste the below command and it will be installed in a few seconds.
pkg install zip

How to Zip and Unzip file & folders in Termux

Use Zip in Termux:

There are multiple different arguments while zipping the files so you should read the below commands carefully and learn the use of all those arguments. 

1) Zip any file or folder in termux:

To zip files or folders the most simple way is to just use the zip command followed by the name of the file that you want to be after it is compressed like games.zip then type the name of the file.
zip games.zip file1.txt

How to Zip and Unzip file & folders in Termux


2) Unzip any zipfile in termux:

To Unzip files in termux you just have to be in the same folder as the zip file and type unzip followed by the zipfile name.zip.
unzip games.zip
How to Zip and Unzip file & folders in Termux


3) Zip multiple files and folders inside one zip file :

To zip files and folders together you cannot use the first simple command, you have to add -r argument. after adding -r you can add any file and folders and it will be zipped together. keep in mind that you can add as many files and folders as you want here I am adding only 2.
zip -r mydata.zip file1.txt folder1/
How to Zip and Unzip file & folders in Termux

To unzip this type of zip file you have to use simple unzip command.


4) Make a password-protected Zip file in termux :

To make a zip file that has password protection you have to use -e argument while using the zip command. This requires one more step and that is entering the password, just use the below example as a reference to learn it. As you can see the command is simple, just enter the command and press enter and you will see the prompt where you have to enter the password, type the password that you wanna keep, and keep in mind that you won't be able to see anything getting typed on the screen but type the password and press enter and you have to type that password again and the zip file will be created in few seconds. 
zip -e mydata.zip file1.txt
How to Zip and Unzip file & folders in Termux


5) Unzip password-protected Zip files in termux :

To unzip a password-protected zip file you just have to use the simple unzip command but when you press enter, you have to enter the password that you used while creating the zip file.  again, you won't be able to see what you are typing because of security reasons but type your password and press enter and the file will be unzipped.
unzip mydata.zip
How to Zip and Unzip file & folders in Termux


6) Make a Compressed zip file in termux :

This is going to be your favorite argument because this is going to be the most useful one if you have any file that you want to compress as a zip file just use the -9 argument, this will take some time to compress the files but its gonna reduce the file size a lot. 
zip -9 game.zip GTA5.apk
How to Zip and Unzip file & folders in Termux

To unzip this file you just have to use a simple unzip command.


7) Extra Tips:

You can always combine multiple arguments to get the desired output like using -9e argument to create a password-protected compressed zip file. also, you can always type zip -h to see more arguments like -m which will delete all the files that you are adding in the zip file from the main source (-m is for move).


Conclusion :

Since zipping is so common thing while using Linux I thought I need to write a detailed post on it so that people can know multiple options and use it. If you know the termux basic command then you can move inside your phone's storage and compress any file that you want to send to someone to save time and mobile data. I have told you guys about the most useful arguments and if you can remember them then that's gonna be more than enough for your everyday use. if you like this termux basics tool guide then you should check out more to get better at termux. If you didn't understand any part or anything was confusing then please comment down below. Thanks for reading guys and as always, Stay Ethical 👾.

Comments

Popular posts from this blog

ChatGPT: The Most Advanced AI Chatbot in 2023

  ChatGPT: The Most Advanced AI Chatbot in 2022​ OpenAI release a Optimizing Language Model for Dialogue name ChatGPT on November 30, 2022.  Once it was released,  ChatGPT gained great attention and traffic, causing much discussion on online platforms. What is the magic of ChatGPT that makes people so crazy about it? In this article, we will introduce ChatGPT in detail. How to Sign Up ChatGPT? Play Unmute Loaded :  56.39% Remaining Time  - 1:19 Fullscreen Advertisement: 0:07 How to Sign Up ChatGPT? What is ChatGPT? ChatGPT is a large language model developed by  OpenAI  that can be used for natural language processing tasks such as text generation and language translation. It is based on the GPT-3.5 (Generative Pretrained Transformer 3.5) model, which is one of the largest and most advanced language models currently available. One of the key features of ChatGPT is its ability to generate human-like text responses to prompts. This makes it useful for a wide range of applications, such a

Introduction chatgpt

  Introduction Overview The OpenAI API can be applied to virtually any task that involves understanding or generating natural language or code. We offer a spectrum of  models  with different levels of power suitable for different tasks, as well as the ability to  fine-tune  your own custom models. These models can be used for everything from content generation to semantic search and classification. Key concepts We recommend completing our quickstart tutorial to get acquainted with key concepts through a hands-on, interactive example. Quickstart tutorial Learn by building a quick sample application Prompts and completions The  completions  endpoint is at the center of our API. It provides a simple interface to our models that is extremely flexible and powerful. You input some text as a  prompt , and the model will generate a text  completion  that attempts to match whatever context or pattern you gave it. For example, if you give the API the prompt, “Write a tagline for an ice cream sho

Introduction to Command Prompt: An overview of what CMD is and how it can be used.

Command Prompt, also known as CMD, is a command-line interface used in Microsoft Windows operating systems. It allows users to interact with the system by typing in commands instead of using a graphical user interface (GUI). The commands entered into CMD are executed as text-based instructions that tell the system what to do. CMD can be used to perform a wide range of tasks, such as navigating through files and folders, running programs, configuring network settings, and performing system maintenance tasks. It is often used by advanced users, system administrators, and developers who need to perform tasks that are not easily accomplished through the graphical user interface. CMD uses a specific syntax to enter commands and parameters, which can take some time to learn for those who are new to the interface. However, once mastered, CMD can be a powerful tool that can save time and increase efficiency by automating repetitive tasks and performing complex operations that are difficult to