DEV Community

loading...
Cover image for How to convert a file to zip format through Terminal In Ubuntu

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

rohithv07 profile image V Rohith ・1 min read

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.

Discussion (0)

pic
Editor guide