/ factorpad.com / tech / linux-essentials / gunzip-command.html
An ad-free and cookie-free website.
Beginner
Learn how to unzip files at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux gunzip Command summary with Examples (3:54)
Our sixty-ninth word, or command to memorize is
gunzip
from our category
Files.
gunzip
allows you to decompress files.
-options | description |
---|---|
-h ,
--help |
Print help screen |
-k ,
--keep |
Keep input files |
-l ,
--list |
List information on compressed file |
Recall from the last video on gzip
we
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)
.
The gunzip
command has
14 options and the argument is the file or list to
decompress.
Like most commands, help is available with double-dash
--help
. The
-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
video69a.txt
.
Then copy it and this will take a second to
gzip
that new file
video69b.txt
.
Then 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 gunzip -k
option, keeping the old file.
And then ls -og
and we should see 3
videos for this video 69, right?
Okay now you know how to use gunzip
.
And you know the syntax for commands, options and arguments.
One last tip about the gunzip
command. So again, you'll have to spend time in the
man
page on
gzip
and
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 gunzip
command.
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
If you believe that learning and financial information should be accessible to more people, then please find a way to support our cause here.
gzip
command, hit Back.bzip2
and see if it improves on the
compression statistics, click Next./ factorpad.com / tech / linux-essentials / gunzip-command.html
A newly-updated free resource. Connect and refer a friend today.