How to create a .tar.gz (gzip) archive on macos without installed application

You probably know that on Mac OS X / Macos o the .zip archive can be created very simply, by selecting the folders and files to be archived, click-right, and from “context menu” We select the option: “Compress No. Files“.

In the current folder the archive file with the name will be created: “Archive.zip“.

A much more advanced form of archiving, used especially when we have archives that contain many files and folders, is .tar.gz.
.TAR.GZ (GZIP) comes with one Archive algorithm developed for Unix / Linux systems.The deflated algorithm, used by gzip archiving allows a Better compression of files with minimal losses or non -existent. In the .zip archives it happens very often that the archived files appear to be “corrupted” and unusable.

Users of MacOS can archive very simple files from one or more folders, using the command line in the terminal.

The command line for archiving .tar.gz from the terminal, is identical to that on Linux:

tar -cvzf nume_arhiva.tar.gz folderdearhivat

In the scenario shown in the above screenshot, the archive will be created “wp-content.tar.gz” of the folder “wp-content” din WordPress.

If you want to archive all the pictures in a folder, you can use the command line:

tar -cvzf nume_arhiva.tar.gz /calea/folder/poze/*.jpg

USING “*” before the extension “.jpg”, you will archive only the files that use this extension.

Dismantling a .tar.gz archive is done by order lina:

tar -xvf nume_arhiva.tar.gz

The archiving command can be combined with advanced parameters. Use “-R” To archive, for example, all pictures from several folders, ignoring other files that can be found there.

Passionate about technology, I write with pleasure on stealthsetts.com starting with 2006. I have a rich experience in operating systems: Macos, Windows and Linux, but also in programming languages ​​and blogging platforms (WordPress) and for online stores (WooCommerce, Magento, Presashop).

Home Your source of IT tutorials, useful tips and news. How to create a .tar.gz (gzip) archive on macos without installed application
Leave a Comment