- [Instructor] In the previous video,
we looked at compressing data with gzip.
In this video, we'll see how to use Zip
to perform compression and extraction.
Zip is a popular compression format used on many platforms.
It isn't as commonly used as gzip or bzip2
on Linux platforms, but files from the internet
are often saved in this format.
In this video, we'll see how to use Zip
to perform compression and extraction.
Let's see how to use various options with Zip.
In order to archive with Zip, this syntax is used.
For example, we got this error because we have not created
any file by this name.
So if you go ahead and create a file with this name,
the file.zip will be produced.
Now, archive directories and files
recursively as we did it here.
In this command, -r is used for specifying recursive.
So, all these errors are generated merely because
we don't have a file in our directory by that name.
Now, in order to extract files
and folders in a Zip file, we used the unzip command.
It would extract the files without removing file name.zip.
This is unlike LZMA or GUnzip.
Next, if you want to update files in the archive
with newer files in the file system, use the -u flag.
Also, you can delete a file from a zipped archive
by using the -d, as we do here.
Now, in order to list the files
in a archive, use this command line.
Let's move ahead and understand how it works.
While being similar to most of the archiving and compression
tools we've already discussed, Zip, unlike LZMA, gzip,
or bzip2, won't remove the source file after archiving.
Most importantly, while Zip is similar to Tar, it performs
both archiving and compression,
while Tar by itself does not perform compression.
Great.
In this video, we saw how to use Zip
to perform compression and extraction.
In the next video, we'll see how
to compress and extract files with pbzip2 command,
manually specifying the number of CPUs.