- 1 year ago
Zip multiple files into individual .gz files (windows)
To zip multiple files into individual .gz
files on Windows, you can use the 7-Zip utility, which is a popular open-source file archiver. Here's an example of how to achieve this using the 7-Zip command-line interface (CLI):
Download and install 7-Zip:
Visit the official 7-Zip website (https://www.7-zip.org/) and download the appropriate version of 7-Zip for your Windows system. Install it using the provided installer.Open Command Prompt:
Open the Command Prompt by typing "cmd" in the Windows search bar and selecting the Command Prompt app.Navigate to the directory containing the files you want to compress:
Use thecd
command to navigate to the directory where the files you want to compress are located. For example:cmdcd C:\Path\To\Files
Zip each file into individual .gz files:
Use the following command to compress each file into an individual.gz
file:cmdfor %F in (*.*) do 7z a -tgzip "%~nF.gz" "%F"
This command uses a
for
loop to iterate over each file in the directory and compresses it using the7z
command with the-tgzip
flag. The resulting.gz
files will have the same name as the original files but with the.gz
extension.Verify the compressed files:
After the command finishes executing, you should see the individual.gz
files in the same directory as the original files.
By following these steps, you should be able to compress multiple files into individual .gz
files using 7-Zip on Windows.