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)