YouTip LogoYouTip

Linux Comm Gunzip

# Linux gunzip Command [![Image 3: Linux Command Reference](#) Linux Command Reference](#) The Linux gunzip command is used to decompress files. gunzip is a widely used decompression program. It is used to decompress files that have been compressed with gzip. These compressed files have the default extension .gz. In fact, gunzip is a hard link to gzip, so both compression and decompression can be accomplished using the gzip command alone. ### Syntax **Parameters**: gunzip compressed-file * `-c`: Write decompressed output to standard output (instead of writing to a file). * `-d`: Decompress the file. This is the default behavior and can be omitted. * `-f`: Force decompression, even if a decompressed file with the same name already exists. * `-h`: Display help information. * `-k`: Keep the original compressed file. The decompressed file will be kept in the same directory, and the original file will not be deleted. * `-l`: Display detailed information about the compressed file, including file sizes before and after compression, compression ratio, etc. * `-n`: Do not overwrite existing decompressed files. If a file with the same name already exists, decompression will not be performed. * `-q`: Quiet mode, do not display decompression progress or error messages. * `-r`: Recursively decompress all files in the specified directory. * `-t`: Test the integrity of the compressed file without performing actual decompression. * `-v`: Display detailed decompression information, including decompressed file names, compression ratios, etc. * `--help`: Display help information. * `--version`: Display version information of the `gunzip` command. ### Examples 1. Decompress a file: gunzip example.txt.gz This will decompress the file named example.txt.gz and produce a decompressed file named example.txt. 2. Decompress a file and keep the original: gunzip -k example.txt.gz This will decompress example.txt.gz, produce a decompressed file named example.txt, and keep the original example.txt.gz file. Decompress a file and write the content to standard output: gunzip -c example.txt.gz This will decompress example.txt.gz and write the decompressed content to standard output, instead of creating a decompressed file. Recursively decompress all files in a directory: gunzip -r directory This will recursively decompress all gzip-compressed files in the specified directory. Note that the gunzip command can only decompress gzip-format files and cannot be used to decompress other compression formats such as ZIP, RAR, etc. To decompress other formats, you can use the appropriate tools, such as the unzip command for decompressing ZIP files. [![Image 4: Linux Command Reference](#) Linux Command Reference](#)
← Os LchmodOs Isatty β†’