to decompress a file using gunzip
gunzip colors.gz
force a file to decompress
gunzip -f colors.gz
to keep both the compressed and decompressed file
gunzip -k colors.gz
to read the compressed file
gunzip -l colors.gz
decompressing the files recrusively
gunzip -r/tmp
it keeps the both compressed and decompressed fies
gunzip -K colors.txt.gz
display compressed within it without decompressing first
$ gunzip -c colors.txt.gz
test the file before decompressing it to know it is valid or not
$ gunzip -t colors.txt.gz
it shows the verbose when we decompress the file
$gunnzip -v colors.txt.gz
to decompress the the given file
gunzip -d colors.txt.gz
Explanation:
Decompresses file.txt.gz and restores file.txt.
gunzip file.txt.gz
Explanation:
file.txtfile.txt.gz intactgunzip -k file.txt.gz
Explanation:
Extracts file1, file2, and file3 while deleting their .gz versions.
gunzip file1.gz file2.gz file3.gz
Explanation:
Extracts all .gz files in the current directory.
gunzip *.gz
Explanation:
Displays the uncompressed content without creating a new file.
gunzip -c file.txt.gz
or
zcat file.txt.gz
Explanation:
Extracts file.txt and saves it to /path/to/destination/.
gunzip -c file.txt.gz > /path/to/destination/file.txt
Explanation:
file.txt if it already exists.gunzip -f file.txt.gz
Output Example:
compressed uncompressed ratio uncompressed_name
12345 67890 81% file.txt
Explanation:
Displays compression details without extracting.
gzip -l file.txt.gz
Explanation:
Finds all .gz files in a directory and decompresses them.
find /path/to/directory -type f -name "*.gz" -exec gunzip {} \;
Explanation:
tar extracts .tar.gz files in one step (instead of using gunzip first).-xvzf: Extract, Verbose, Gzip, Filetar -xvzf archive.tar.gz
Decompresses files compressed with gzip.
gunzip file.txt.gz