Linux Commands Archives - Netzole https://www.netzole.org/category/linux-commands/ Fri, 30 May 2025 22:17:13 +0000 en-US hourly 1 Gzip Command in Linux https://www.netzole.org/gzip-command-in-linux/ Fri, 30 May 2025 22:17:13 +0000 https://www.netzole.org/?p=6781 The gzip command in Linux is used to compress files. It helps reduce the file size and saves space. It also makes transferring files faster....

The post Gzip Command in Linux appeared first on Netzole.

]]>
The gzip command in Linux is used to compress files. It helps reduce the file size and saves space. It also makes transferring files faster.

How to Use gzip

To compress a file, use this command:

To compress a file, use this command:

gzip filename

This command replaces the original file with a compressed file. The new file will have a .gz extension.

Example

gzip notes.txt

This will create a file named notes.txt.gz.

This will create a file named notes.txt.gz.

To Decompress a File

To get back the original file, use:

gunzip filename.gz

This will restore the original file and remove the .gz file.

View Contents Without Decompressing

You can view the content of a compressed file using:

zcat filename.gz

Compress Multiple Files

You can compress several files at once:

gzip file1.txt file2.txt file3.txt

This will create file1.txt.gz, file2.txt.gz, and file3.txt.gz.

Useful Options

-k: Keep the original file.

gzip -k file.txt

-d: Same as gunzip, to decompress.

gzip -d file.txt.gz

-r: Compress all files in a directory.

gzip -r myfolder/

Summary

gzip compresses files.

gunzip decompresses .gz files.

Use options to keep files, decompress, or work with folders.

gzip is a simple and fast way to handle file compression in Linux.

The post Gzip Command in Linux appeared first on Netzole.

]]>
How to Install Zip and Unzip in Linux https://www.netzole.org/how-to-install-zip-and-unzip-in-linux/ https://www.netzole.org/how-to-install-zip-and-unzip-in-linux/#respond Tue, 28 Jan 2025 12:08:13 +0000 https://www.netzole.org/?p=18 Zip utility tool used for compressing files and folder that makes the size smaller and fast transfer. Unzip are the other command-line utilities used for...

The post How to Install Zip and Unzip in Linux appeared first on Netzole.

]]>
Zip utility tool used for compressing files and folder that makes the size smaller and fast transfer. Unzip are the other command-line utilities used for decompressing zip files. In this article, we will learn how we can install the zip and unzip on various Linux distributions.

How to Install Zip and Unzip in Ubuntu/Debian/Mint

You can install zip by running this command on Ubuntu or Debian.

 $ sudo apt install zip

how to install zip linux

You can confirm the zip installation by running this command or above command. If it is installed it says zip already installed

 $ zip -v 

check zip install

After installing zip you can create zip by running this command at the root of target folder.

 $ zip -r filename.zip folder 

For installing Unzip utility, you can run following command.

 $ sudo apt install unzip 

You can confirm the unzip installation by running the same command

 $ unzip -v 

Newer version of Ubuntu/ Debian comes with preinstalled zip and unzip utilities

The post How to Install Zip and Unzip in Linux appeared first on Netzole.

]]>
https://www.netzole.org/how-to-install-zip-and-unzip-in-linux/feed/ 0