in

LinuxLinux

GunZip Command in Linux: Syntax, Commands & Examples!

Essential GunZip Commands for Linux!

GunZip Command in Linux

G

unZip Command in Linux: The GunZip is a command line interface helps to decompress the files which compressed with GZip compression. Gzip compression have the excellent algorithm to compress the files and creates an output with .gz or .z extension. GunZip command allows you decompress the files in Linux. In this article, we provided the information about using the GunZip command in Ubuntu Linux.

 Jump To:

Decompresses Files with GunZip Command:

To Decompress files, use the following command,

$gunzip example.gz
Replace the Example.gz with your compressed file.

The basic syntax to decompress a single compressed file using Gunzip command is,

GunZip Command Syntax
gunzip [gunzip_options] [file]

The basic syntax to decompress multiple compressed files using Gunzip command is,

GunZip Command Syntax
gunzip [gunzip_options] [file1] [file2] [file3] [file4]

GunZip Command Options:

To view the available GunZip command options, open your terminal and paste the below command,

$gunzip --help

The output of the above command is,

[email protected]:~$ gunzip --help
Usage: /usr/bin/gunzip [OPTION]... [FILE]...
Uncompress FILEs (by default, in-place).

Mandatory arguments to long options are mandatory for short options too.

  -c, --stdout      write on standard output, keep original files unchanged
  -f, --force       force overwrite of the output file and compress links
  -k, --keep        keep (don't delete) input files
  -l, --list        list compressed file contents
  -n, --no-name     do not save or restore the original name and timestamp
  -N, --name        save or restore the original name and timestamp
  -q, --quiet       suppress all warnings
  -r, --recursive   operate recursively on directories
  -S, --suffix=SUF  use suffix SUF on compressed files
      --synchronous synchronous output (safer if the system crashes, but slower)
  -t, --test        test compressed file integrity
  -v, --verbose     verbose mode
      --help        display this help and exit
      --version     display version information and exit

With no FILE, or when FILE is -, read standard input.

Report bugs to <[email protected]>.

Display Compressed files list using GunZip Command:

GunZip command allows you to list complete information about all compressed files in the Terminal. With the help of “list” option along with Gunzip command, Compressed files will displayed in the Terminal.

$gunzip -l example.gz

The output of the above command is,

Output
compressed        uncompressed  ratio    uncompressed_name
       124                 121   8.9%              example

Decompress a Whole Directory:

GunZip command allows you decompress a whole directory. Use the follow command,

$gunzip -r directory_name

Decompresses Files in a New Location:

GunZip command allows you to decompress the files to the new location. Use the below command,

Check this too  How to Install PIP for Python 2, Python 3 on Debian 10?
$gunzip -c file.gz > /root_dir/path_to_dir/file

Verdict:

That’s it. GunZip command allows you decompress the files. In this tutorial, we almost covered the major GunZip command usage. Know more information about GunZip on GNU GunZip page. If you have any queries related to this topic and then comment us below.

Article Review
  • Article Explanation
  • Commands Provided
  • GunZip Syntax Mentioned
  • GunZip Options
4.8

Summary

Need more tutorials, kindly visit our Homepage

Leave a Reply

Your email address will not be published. Required fields are marked *

Written by Julian

Hello Folks! I'm Julian, Promoted to the Content writer for the category of Commands & Web Apps in Tec Robust. Enjoy my content & Learn more Linux Commands!

Contact me:
tecrobust [@] gmail.com
Sub: Message to Julian

Audacity Ubuntu Snap App

Audacity Ubuntu SNAP: How to Install Audacity on Ubuntu 18.04 & 19.04 Using SNAP Package!

TypeCatcher Ubuntu

Download Custom & Google Fonts using TypeCatcher In Ubuntu 18.04 LTS & 19.04