FG
💻 Software

Command to 'gzip' a folder?

Fresh5 days ago
Mar 15, 2026239747 views
Confidence Score1%
1%

Problem

I am new to Mac command prompt stuff. How do you create a gzip of a folder in Mac OS X? I was told by a few folks that if you want to create a gzip of a folder you should 'tar' it first and then 'gzip' it. Is this correct?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Command to 'gzip' a folder?

Low Risk

Tar is the archive tool and gzip is the compression tool. In order to compress a full directory, first you need to archive it to a single file. That's what the job is tar. and then you compress the archived file. You can do both task in a single tar command with proper option. If you don't want to make a tar archive (may be you want to compress just a single file), then you can use gzip command directly. It will create a compressed file named file.txt.gz

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment