What is the gz decompression command in linux?

coldplay.xixi
Release: 2023-02-06 17:34:09
Original
85527 people have browsed it

The gz decompression command of Linux is gzip. The gzip command can compress files as well as decompress files. If you want to compress a file, execute "gzip source file"; for example, to compress a "b.txt" file, execute the command "gzip b.txt". If you want to decompress the file, just execute "gzip -d compressed file" or "gunzip compressed file".

What is the gz decompression command in linux?

The operating environment of this tutorial: linux7.3 system, DELL G3 computer.

Linux gz decompression command:

1. Compression

Compressed file

Syntax

gzip  源文件
Copy after login

If you want to compress b.txt, use the command gzip b.txt

Note: The source file will disappear when compressed into a .gz file

If you want To retain the source file, use the command

gzip -c 源文件 > 压缩文件
Copy after login

such as compress b.txt and retain b.txt. Use the command

gzip -c b.txt > b.txt.gz
Copy after login

to compress the directory

Syntax

gzip -r 目录
Copy after login

Note: gzip Compressing a directory will only compress all the files in the directory but not the directory

As shown below

Write the picture description here:

What is the gz decompression command in linux?

2. Decompression

Syntax

gzip -d  压缩文件
gunzip  压缩文件
Copy after login

For example, to decompress a11.txt.gz and a1.txt.gz in the above figure, use the command gzip -d a11.txt respectively. .gz and gunzip a1.txt.gz

The effect is as follows:

What is the gz decompression command in linux?

Related learning recommendations: linux video tutorial

The above is the detailed content of What is the gz decompression command in linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template