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.zip
into your default~/Downloads
directory. Also suppose you already have your terminal opened and your current directory is at~/mcs178/nbody-project
where you’re keeping your Kotlin programs. If you now type$ unzip -t ~/Downloads/nbody.zip
the
unzip
program will test the archive filenbody.zip
for any error. It will also list all the files in the zip archive. You will notice that all the compressed files are in thenbody
folder.You can now unzip all the files from
nbody.zip
by typing$ unzip ~/Downloads/nbody.zip
Now suppose you have finished working with your files in the folder
~/mcs178/nbody-project
and are ready to submit them. You can type$ zip myproject file1.kt file2.kt readme.txt
This will create a file
myproject.zip
containing compressed versions offile1.kt
,file2.kt
, andreadme.txt
. You can now submit yourmyproject.zip
via moodle.
Digging deeper
To learn more about zip and unzip, read the manual by typing:
$ man zip
and
$ man unzip