Zip Howto
The zip program compresses files and package them in an archive file. The unzip program extracts compressed files from the archive and uncompresses them. An archive file ends in .zip.
Example uses
Suppose you clicked on a link on the course web page and your browser have downloaded a file named, say,
nbody.zipinto your default~/Downloadsdirectory. Also suppose you already have your terminal opened and your current directory is at~/mcs178/nbody-projectwhere you’re keeping your Kotlin programs. If you now type$ unzip -t ~/Downloads/nbody.zipthe
unzipprogram will test the archive filenbody.zipfor any error. It will also list all the files in the zip archive. You will notice that all the compressed files are in thenbodyfolder.You can now unzip all the files from
nbody.zipby typing$ unzip ~/Downloads/nbody.zipNow suppose you have finished working with your files in the folder
~/mcs178/nbody-projectand are ready to submit them. You can type$ zip myproject file1.kt file2.kt readme.txtThis will create a file
myproject.zipcontaining compressed versions offile1.kt,file2.kt, andreadme.txt. You can now submit yourmyproject.zipvia moodle.
Digging deeper
To learn more about zip and unzip, read the manual by typing:
$ man zip
and
$ man unzip