Learn how to unzip files at the Linux command line.
Linux gunzip command summary with examples (3:54)
Videos can also be accessed from the YouTube Playlist.
Our sixty-ninth word, or command to memorize is
gunzip from our category
gunzip allows you to decompress files.
Recall from the last video on
compressed a file, and now we'll focus on a tool that not only
decompresses .gz files but other formats as well.
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s).
gunzip command has
14 options and the argument is the file or list to
Like most commands, help is available with double-dash
-k option keeps the input file and
-l shows file details.
So why is
gunzip an important command?
Well, at times you're given compressed files in a variety of formats
and you need to decompress 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. As in the last video, do a
man command on
gunzip and write it to a file
Then copy it and this will take a second to
gzip that new file
ls -og on
video69* to see what we have.
And there's a compressed file. Next, use
gunzip -l on
video69b.txt.gz, to see the stats
and contents as well.
Now, you may ask, if
gzip -d from the
last video decompresses files, then why do we need to learn
gunzip? Well that's a good question, because
gunzip can also unzip additional file
formats, which we will see in coming videos.
And last, let's use the
option, keeping the old file.
ls -og and we should see 3
videos for this video 69, right?
Okay now you know how to use
And you know the syntax for commands, options and arguments.
One last tip about the
command. So again, you'll have to spend time in the
man page on
gunzip, which are actually the same
page. And then also tune in for the next video or two, where we'll see
other compression tools.
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:
Have questions? Reach out to us on our YouTube Channel. Here's one of those subscription buttons.
gzipcommand, hit Back.
bzip2and see if it improves on the compression statistics, click Next.