An ad-free and cookie-free website.
Learn to compress and archive files at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux zip Command Summary with Examples (3:50)
Our seventy-second word, or command to memorize is
zip from our category
zip allows you to compress and
||Print help screen|
||Include directories and files recursively|
Recall from the last four videos, we've been evaluating ways to compress files and now we'll shift to archiving, or packaging both files and directories, while compressing at the same time.
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s).
zip command has
over 30 options and the arguments include the output
file, in .zip format and the input files and
Like most commands, help is available with double-dash
-r is the recursive option required
to include directories and files.
So why is
zip an important command?
Well, in order to share .zip files, a standard for
many Microsoft Windows and Mac users, you need to know how to pack
and unpack them.
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.
Here we go. First, let's use
mkdir to create a directory called
video72 and redirect to it, the long
man pages of the command
And then let's to an
ls of that
directory to make sure the files are in there.
Next, let's zip the directory using
zip -r, the destination
video72.zip and the directory
And see, the three actions, followed by
ls -og video72*.
And it shows the zip and contents.
And last, let's decompress using
And then it asks for multiple options here so hit capital
A for All.
video72 directory to see the two
Okay now you know how to use
And you know the syntax for commands, options and arguments.
One last tip about the
command. So now that you have two helpful
man pages, please review them because
they include many helpful examples for this very versatile program.
Okay, thanks for visiting today. I hope this was a helpful
introduction to the
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
Please, if you found value here, return the favor, tell a friend, subscribe, follow, or give. It all helps to keep the free content flowing.
xzcommand, hit Back.
tarcommand, click Next.
A newly-updated free resource. Connect and refer a friend today.