You can unzip zipped files using unzip, which is logical because you certainly wouldn't unzip zipped files with unVelcro or unsnap (Code Listing 13.13).
[ejr@hobbes compression]$ ls -l *.zip -rw-rw-r-- 1 ejr users 268156 Jul 23 06:53 folderzip.zip -rw-rw-r-- 1 ejr users 55124 Jul 23 06:38 fortunes1.zip -rw-rw-r-- 1 ejr users 53792 Jul 23 06:52 newzip.zip -rw-r--r-- 1 ejr users 239943 Jul 27 10:41 zipped.zip [ejr@hobbes compression]$ unzip zipped.zip Archive: zipped.zip replace zipadeedoodah.tar? [y]es, [n]o, [A]ll, [N]one, [r]ename: y inflating: zipadeedoodah.tar [ejr@hobbes compression]$ |
To unzip a zip file using unzip:
1. | ls *.zip At the shell prompt, verify the name of the zip file with ls *.zip. |
2. | unzip zipped Enter unzip and the name of the file to unzip (without the .zip extension). unzip will uncompress the file(s) and return you to the shell prompt. |
Tip
If you attempt to unzip a file and the file or files to be unzipped already exist, unzip will prompt for you each one to determine if you want to overwrite (destroy) the existing file, cancel the unzipping process, or rename the file you're unzipping to a safe name.
Tip
gunzip also understands how to uncompress .zip files, so you can use gunzip instead of unzip, if you'd like. On the UNIX side of things, use whatever seems easiest to you, or gunzip if you really don't care. If you're providing files to Windows users, zip is somewhat more reliable because the format it creates is more standard.
3.144.9.169