hey everyone this is going to be a
really quick video where I'm going to
talk about the most one of the most
useful and popular commands there is
it's simply zip you're going to need
this all the time especially early in
your career when you are compressing and
archiving things are dealing with
compressed and archived things
especially when you're still doing sort
of desktop support you have to deal with
windows or files going to windows or
coming from windows zip the zip format
is going to be something you're going to
be dealing with all the time so I'm
going to very simply just give you the
command you need to learn it's going to
be what you need 90% of the time as
always there's man zip so if you need
extra options check there but we don't
care I'm just going to give you the give
you the answer we're going to skip all
that all that reading in the main page
because 99% of the time what you really
want is a compressed archive many files
being compressed and added to a single
archive file which you can then upload
as one single file or email or do
whatever with and then unzip on the
other side this is very easy stuff so
not going to spend a lot of time on
theory here we are sitting in my home
directory we have a documents directory
with a couple different files inside you
know some PDFs some documents a password
file a very secret knotty sites file etc
actually that bomb thing nobody called
the cops
it's I was showing what a what a tar
bomb looks like when someone incorrectly
or in very bad taste compresses an
entire directory without an enclosing
directory so that when you unzip it it
sort of explodes all over your computer
and litters whatever directory you're in
with a ton of files you don't want to do
that more on that in the tar video so
here's the deal we're going to be
talking about zip in this tutorial but
if if you're compressing things and
archiving them for other unix and linux
people you'll probably be using tar or b
zip to I have separate videos for those
where we're going to cover essentially
the same thing
but we're talking right now about
compression the idea of taking a file
making it smaller by finding and
simplifying patterns and archiving which
is the idea it's not the same as
compression it's taking many files or
directories and creating one archive
file so that it's easier to work with
especially with older protocols like FTP
SCP etcetera often transferring a single
file is much faster than transferring
many different files and directories
even if those two things add up to the
same amount of space because there's
like protocol overhead and other
problems with you know the four for each
file okay long intro and here is the
command so we've got that documents
thing we want to zip in so we say zip
that's the command we have a target name
so we'll call it zipped Doc's dot zip
because we love to be redundant and then
we say the directory name and of course
I was forget we want to go into this
recursively zip everything inside so
that the AR says go into that directory
and add all of the files that it
contains and all the sub directories it
contains into this zip archive that
we're creating called zipped doc zip so
as I am and you can see it's verbose the
output is disgusting it's everywhere you
could redirect it if you know how to do
that and now you can see we've got a
zipped Doc's zip directory now it's
probably not too much smaller than a
doubt we got much compression here let's
see let's what's the file size of
documents we have 2.4 Meg's in archive
and 2.5 in the the uncompressed
directory so we haven't really saved
much space but whatever definitely as
soon as you get to like a ton of files
especially file formats that lend
themselves to compression you're going
to be saving a whole lot of room okay
that said let's move this zipped Docs to
our handy decompression chamber and then
enter
that directory you can see we've got the
zipped directory here and now we'll see
how to unzip it so we just say come zip
let us be the inverse command of what we
just did
zip to Doc's zip and you can see we now
have the same documents directory here
that we had before so that's zipping and
unzipping
again this is the zipping command and
this is the unzipping command this
pretty much will take care of you
yeah this is really all you need to know
for zip there's some more interesting
tools that maybe get you better
compression obviously at the expense of
using more CPU or they're much more
widespread in Linux and UNIX and that
would be tar and be zipped to more on
those in another video
I hope you enjoyed this should get
rolling with zip files on Linux enjoy