gunzip Command in Linux

Learn via video courses
Topics Covered

Build an AI-First Career, Master the Complete Skillset

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program
NSDC Certified

AI Forward Deployed Engineer Program

Full-stack engineering, production AI and client-facing consulting

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program

Overview

The gunzip command in Linux is a widely-used utility for decompressing files compressed using the gzip algorithm. This command is particularly helpful when dealing with large files or transferring files over a network with limited bandwidth. In this article, we will explore the syntax, options, and use cases of the gunzip command.

Linux gunzip Command Syntax

The syntax for the gunzip command is as follows:

Where:

  • options: These are the flags that modify the behavior of the gunzip command.
  • file: This is the compressed file that needs to be decompressed.

gunzip Command Options:

  • -c: Write the decompressed data to standard output, leaving the original file unchanged.
  • -f: Force overwriting of output files if they already exist.
  • -k: Keep the input files, not deleting them after decompression.
  • -l: List information about the compressed file, without actually decompressing it.
Sharpen Your Fundamentals with Free Learning

Example Usages

  • Basic usage of gunzip command:

    Output:

    Explanation: This command decompresses the 'file.gz' and creates a new file named 'file' in the same directory.

  • Using the -c option:

    Output:

    Explanation: This command writes the decompressed data to standard output and then redirects it to a new file, leaving the original compressed file unchanged.

How Scaler Transformed Careers in Different Fields

₹23L
AVG CTC
SCALER PLACEMENT PROOF

Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.

11,000+placements
650+companies
Verified data
Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more

Tips

  • Use the gzip command to compress files before using gunzip to decompress them.

Advanced Use Cases of gunzip Command in Linux

  • Decompress multiple files:

    Output:

    Explanation: This command decompresses multiple compressed files in a single command.

  • Using the -l option:

    Output:

    Explanation: This command lists information about the compressed file without decompressing it, such as the compression ratio and uncompressed file size.

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

Conclusion

  • The gunzip command is an essential tool for decompressing gzip compressed files in Linux.

  • Various options like -c, -f, -k, and -l modify the behavior of the command.

  • Gunzip can be used with multiple files and in combination with other commands.