DEV Community

Cover image for How to convert a file to zip format through Terminal In Ubuntu
Rohith V
Rohith V

Posted on

How to convert a file to zip format through Terminal In Ubuntu

Today I was trying to convert a file to zip format and I was not aware that we can do it easily with the help of zip command in Ubuntu.
All you have to do is :
-> Go to the directory having the file to be converted to zip.
-> Open the terminal from that directory.
-> Type zip newNameOfZipFile nameOfFileToBeConverted.
For eg : if we have a file named Rainfall.txt. Go to the folder containing that file and open the terminal. Lets say we need to have the zip file with the name result. So the command to be typed is :
zip result Rainfall.txt
-> You can confirm whether its converted to zip by typing the command ls *.zip.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more