Zip to tar gz windows

How can I use the 7-Zip CLI (7za.exe) on Windows to create .tgz archives, as I use tar zcvf archive.tgz source_files on Linux?

Dherik's user avatar

Dherik

6502 gold badges6 silver badges16 bronze badges

asked Sep 26, 2011 at 11:13

f.ardelian's user avatar

0

answered Jan 6, 2020 at 10:04

Serhiy's user avatar

SerhiySerhiy

4441 gold badge5 silver badges16 bronze badges

If you’d like to do it in a one-liner:

7za.exe a -ttar -so -an source_files | 7za.exe a -si archive.tgz

The -an switch tells 7-Zip not to parse the archive_name command line parameter that’s normally required.

answered Sep 26, 2011 at 13:24

afrazier's user avatar

afrazierafrazier

23k3 gold badges60 silver badges88 bronze badges

5

If you’re just compressing 1 file into the tarball then 7za a archive.tgz source_file will work.

If you want to add lots of files to the tar then you need to do it in two steps:
Create the tar 7za a archive.tar source_files
Then compress it 7za a archive.tgz archive.tar

And, optionally, delete the ‘temporary’ tar del archive.tar

answered Sep 26, 2011 at 12:49

Chris Kent's user avatar

Chris KentChris Kent

1,41111 silver badges14 bronze badges

1

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.


Windows 10, Windows 11, Windows 7, Windows 8, Windows Server, Windows Vista, Windows XP

  • 23.10.2021
  • 13 620
  • 1
  • 28.09.2023
  • 32
  • 32
  • 0

Как в Windows сделать архив tar.gz?

  • Содержание статьи
    • Создание архива tar.gz в 7-Zip
    • Комментарии к статье ( 1 шт )
    • Добавить комментарий

Популярный в среде UNIX-подобных операционных систем формат архива tar.gz, появился в далеком 1992 году вместе с утилитой gzip. Тем не менее, не смотря за столь большой промежуток времени, в среде операционных систем Windows данный формат не получил особого распространения, и как итог, его поддержка стандартными средствами Windows отсутствует. К счастью, большинство архиваторов без проблем работают с данным форматом, к примеру бесплатный 7-Zip, о работе с которым мы сейчас и поговорим.

Создание архива tar.gz в 7-Zip

Скачать архиватор 7-Zip можно с его официального сайта.

  1. Открываем 7-Zip, и выбираем файлы, которые планируем заархивировать, после чего нажимаем на кнопку «Добавить«.

    Альтернативный вариант — в Проводнике находите нужные файлы или папки, выделяете их, и вызываете контекстное меню, в котором выбираете пункт «7-Zip — Добавить к архиву…«.
  2. В окне создания архива выбираем формат архива tar. Сейчас уровень сжатия установить не получиться, поскольку формат tar его не поддерживает, но мы сможем сжать архив на следующем этапе.
  3. Теперь, нужно заархивировать ранее полученный архив формата tar. Проделываем те же действия, что и ранее, с только что сделанным архивом, только на этот раз выбираем формат архива gzip. Так же можно установить желаемый уровень сжатия.
  4. После этого, на выходе получится архив формата tar.gz.

How can I use the 7-Zip CLI (7za.exe) on Windows to create .tgz archives, as I use tar zcvf archive.tgz source_files on Linux?

Dherik's user avatar

Dherik

6502 gold badges6 silver badges16 bronze badges

asked Sep 26, 2011 at 11:13

f.ardelian's user avatar

0

answered Jan 6, 2020 at 10:04

Serhiy's user avatar

SerhiySerhiy

4441 gold badge5 silver badges16 bronze badges

If you’d like to do it in a one-liner:

7za.exe a -ttar -so -an source_files | 7za.exe a -si archive.tgz

The -an switch tells 7-Zip not to parse the archive_name command line parameter that’s normally required.

answered Sep 26, 2011 at 13:24

afrazier's user avatar

afrazierafrazier

23k3 gold badges60 silver badges88 bronze badges

5

If you’re just compressing 1 file into the tarball then 7za a archive.tgz source_file will work.

If you want to add lots of files to the tar then you need to do it in two steps:
Create the tar 7za a archive.tar source_files
Then compress it 7za a archive.tgz archive.tar

And, optionally, delete the ‘temporary’ tar del archive.tar

answered Sep 26, 2011 at 12:49

Chris Kent's user avatar

Chris KentChris Kent

1,41111 silver badges14 bronze badges

1

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

How to create tar.gz archive of my files in Windows to upload and extract in cPanel?

Example person's user avatar

asked May 27, 2012 at 12:09

Shamas's user avatar

ShamasShamas

1,0272 gold badges10 silver badges10 bronze badges

4

1 Answer

tar.gz file is just a tar file that’s been gzipped. Both tar and gzip are available for windows.

If you like GUIs (Graphical user interface), 7zip can pack with both tar and gzip.

Santosa Sandy's user avatar

answered May 27, 2012 at 12:20

qwertyboy's user avatar

qwertyboyqwertyboy

1,57615 silver badges25 bronze badges

4

If you need to create gzipped tar archives on Windows, you can use 7-Zip. However, this implies first creating a tararchive and second adding the tar archive to a gzarchive.

Here is how to do this in one step. We’ll create a little batch file and integrate it into the Windows Explorer’s Send To: context menu.

Download the 7-Zip commandline tool and extract the file 7za.exe in your user profile folder (something like C:\Users\USERNAMEon Windows 7).

In your user profile folder, create a new batch file targz.bat using the following code:

@echo off
rem Create a tar.gz archive with 7-zip commandline 7za
rem Author: Joachim Werner <joachim.werner@diggin-data.de>
rem Requirements: 7za.exe in the user dir (C:\Users\USERNAME)

echo Create a tar.gz archive
echo Directory: %1
cd %1\..

rem Path to 7za.exe:
set SEVENZA=C:\Users\jwerner\7za

rem get directory basename
set BASENAME=%~n1

rem path and filename for tar
set TAR=%cd%\%BASENAME%.tar

rem create tar
%SEVENZA% a -ttar %TAR% %1

rem create tar.gz
%SEVENZA% a -tgzip %TAR%.gz %TAR%

rem remove tar
del %TAR%

dir %BASENAME%*

pause

In the Windows Explorer, copy this batch file.

Find your Send To… folder. On Windows 7, this should be

C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\SendTo

In this folder, paste the copied batch file as a link.

Now to create a tar.gz archive of a folder and its content, you can right-click it and select Send To... \ targz.bat Link. A command prompt will open, create the file and list the folder and archive file.

Enjoy!

  • Zanzarah скачать торрент для windows 10
  • Zanzarah the hidden portal скачать торрент на русском windows 10
  • Zala yasna tv скачать для windows
  • Zabbix установка сервера на windows
  • Zabbix установка и настройка на windows сервер