Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to write the command for Linux to extract the gz file

Shulou Source: shulou.com Published: 2022-06-02 00:27:22 09月15日 Update

Editor to share with you how to write the command for Linux to extract gz files, I believe most people do not know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. Let's learn about it together.

Gz files are compressed files with a .gz or .tar.gz (.tgz) extension, which are common under Linux, UNIX, and OSX. Both Linux and OSX can extract and use this compressed file directly. Under Windows, the compression software WinRAR is commonly used to open gz files, which is equivalent to the common RAR and ZIP formats.

Decompress .gz file

If it is a gz file that ends with a .gz extension, you can use the gunzip command and the gzip command to extract it.

Gunzip command

The function is to extract the file, and the permission is for all users. Example:

Gunzip FileName.gz

Gzip command

Gzip command is a command that is often used in Linux system to compress and decompress files, which is convenient and easy to use. Gzip can not only be used to compress large, less used files to save disk space, but also can be used with tar commands to form a more popular compressed file format in Linux operating systems.

The basic sentence pattern of decompression:

Gzip-d FileName.gz

Supplement: you can use the gzip command to create .gz files, basic sentence patterns:

Gzip FileName

.tar.gz (.tgz) file decompression

If it is a gz file that ends with a .tar.gz (.tgz) extension, you can use the tar command to extract it by executing the following command:

Tar zxvf FileName.tar.gz

You can extract the .tar.gz file.

The above is all the contents of the command for Linux to extract the gz file. Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: File command extension content sentence pattern common format article system operating system not much function most commonly used is in more permissions user knowledge disk Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology OPPO Reno MariaDB NVidia MySQL