You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to Open tar.gz file on Mac ?

I'm trying to open tar.gz file on a Mac computer, and I've tried several methods including using the default Archive Utility and downloading third party software, but nothing seems to work. I'm not sure what I'm doing wrong or if there's a specific way to open this type of file on a Mac. I need any guidance or advice.


Posted on Oct 3, 2023 7:50 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 24, 2023 3:11 AM

I feel ya! Sometimes .tar.gz files can be a little tricky on Macs. Let me walk you through a couple of methods, including using Terminal, which is a method that's always worked for me:


  • Using Terminal:

Open Terminal: You can find it in Applications > Utilities > Terminal.

Navigate to the directory where your .tar.gz file is located using the cd command. For example, if it's on your desktop, you'd type:


cd ~/Desktop/


Extract the file using the following command:

tar -xzf yourfilename.tar.gz


Replace yourfilename.tar.gz with the actual name of your file.

You should now see the extracted files in the same directory as the original .tar.gz file.



  • Using a Third-Party App:


If you're not comfortable with Terminal, there are third-party apps specifically designed for this:

  1. TunesBro FossZIP: Another great app that supports various file formats. It's available both as a free version and a paid one on tunesbro.com website.


2. The Unarchiver: This is a free app available on the Mac App Store. Once installed, you can right-click on your .tar.gz file, go to "Open With", and select "The Unarchiver".



I hope one of these methods works for you! If you're still stuck, let me know and we can dive deeper. Good luck!

9 replies
Question marked as Top-ranking reply

Oct 24, 2023 3:11 AM in response to RachelPlatten

I feel ya! Sometimes .tar.gz files can be a little tricky on Macs. Let me walk you through a couple of methods, including using Terminal, which is a method that's always worked for me:


  • Using Terminal:

Open Terminal: You can find it in Applications > Utilities > Terminal.

Navigate to the directory where your .tar.gz file is located using the cd command. For example, if it's on your desktop, you'd type:


cd ~/Desktop/


Extract the file using the following command:

tar -xzf yourfilename.tar.gz


Replace yourfilename.tar.gz with the actual name of your file.

You should now see the extracted files in the same directory as the original .tar.gz file.



  • Using a Third-Party App:


If you're not comfortable with Terminal, there are third-party apps specifically designed for this:

  1. TunesBro FossZIP: Another great app that supports various file formats. It's available both as a free version and a paid one on tunesbro.com website.


2. The Unarchiver: This is a free app available on the Mac App Store. Once installed, you can right-click on your .tar.gz file, go to "Open With", and select "The Unarchiver".



I hope one of these methods works for you! If you're still stuck, let me know and we can dive deeper. Good luck!

Oct 3, 2023 10:06 PM in response to RachelPlatten

Here's an illustration of the basic command syntax. I started with two files, one containing the word "cat", and the other containing the word "dog". I put copies into "animals.tar.gz", and removed the originals.


% ls
cat.txt	dog.txt
% cat cat.txt
cat
% cat dog.txt
dog
% tar -cvf animals.tar *.txt
a cat.txt
a dog.txt
% ls
animals.tar	cat.txt		dog.txt
% gzip animals.tar
% ls
animals.tar.gz	cat.txt		dog.txt
% rm *.txt             
% ls
animals.tar.gz


The gunzip command decompresses a file. I didn't ask it to keep the compressed file, so it deleted that file after it created the decompressed copy.


% gunzip animals.tar.gz
% ls
animals.tar


The tar -tvf command shows the contents of a tar file without unpacking it. (tar stands for "tape archive" … which tells you something about how long ago this command first appeared in Unix.). I "XXXXX"ed out my user name.


% tar -tvf animals.tar
-rw-r--r--  0 XXXXXXX staff       4 Oct  4 00:48 cat.txt
-rw-r--r--  0 XXXXXXX staff       4 Oct  4 00:45 dog.txt


The tar -xvf command extracts the contents of a tar file.


% tar -xvf animals.tar
x cat.txt
x dog.txt


Now I have copies of the original files back. In your case, it's likely that there will be quite a few more files, and that there may be several directory levels' worth of them, so I would suggest doing the extraction in a scratch directory.


% ls
animals.tar	cat.txt		dog.txt
% cat cat.txt
cat
% cat dog.txt
dog

Oct 19, 2023 6:51 PM in response to RachelPlatten

What went wrong? Did you try to unpack a file whose name has embedded spaces, e.g. "Some Archive.tar.gz"? To the shell, an embedded space would make it look like you had supplied two arguments:


  • Some
  • Archive.tar.gz


and errors would follow. In the command line environment, you need to either put a backslash before each space in a filename, or enclose the entire filename in double-quotes.

Oct 3, 2023 9:51 PM in response to RachelPlatten

It sounds like you have a tar archive file that has been compressed by the gzip utility. (Or, in Unix/Linux slang, a "compressed tarball".)


I don't know what files are in the archive, but I'm guessing it originated in the Unix, Linux, or Open Source worlds (since that's where these particular archiving and compression tools are commonplace).


If you run Terminal and then type in the commands


% man gunzip

% man tar


I think you will find that the command-line tools needed to unpack the files are already on your Mac, and that your Mac will be happy to tell you a little bit about the syntax of those commands. (Don't type the "%"; that is simply a stand-in for the command line prompt.)

Nov 2, 2023 11:14 PM in response to Kelsenzine

Kelsenzine wrote:

It seems the above replies are using the Terminal approach. Not sure if OP is familiar with text command. It could be much challenging for average users.

Yes, I knew the Terminal could do it, but I tried my best, my lack of knowledge of the command prompt, and I was afraid that my mistakes would get my Mac into even bigger trouble. I try to find a way that works for me, a simple way that doesn't require extra experience or software.

Nov 3, 2023 5:35 AM in response to RachelPlatten

RachelPlatten wrote:

Kelsenzine wrote:

It seems the above replies are using the Terminal approach. Not sure if OP is familiar with text command. It could be much challenging for average users.

Yes, I knew the Terminal could do it, but I tried my best, my lack of knowledge of the command prompt, and I was afraid that my mistakes would get my Mac into even bigger trouble. I try to find a way that works for me, a simple way that doesn't require extra experience or software.


What, exactly, are you expecting to find inside of this .tar.gz file?


If it is something like a source code distribution, figuring out how to build that would involve familiarity with the command line environment that would make unpacking the .tar.gz file look like child's play.

Nov 3, 2023 7:56 AM in response to RachelPlatten

RachelPlatten wrote:


Kelsenzine wrote:

It seems the above replies are using the Terminal approach. Not sure if OP is familiar with text command. It could be much challenging for average users.
Yes, I knew the Terminal could do it, but I tried my best, my lack of knowledge of the command prompt, and I was afraid that my mistakes would get my Mac into even bigger trouble. I try to find a way that works for me, a simple way that doesn't require extra experience or software.


One way to reduce exposure…


Create a new non-admin logon, place this tar.gz file in your Shared area, log into that new login, copy in the file from your main login shared area (using Finder), open Terminal app, issue the gunzip command and the untar command, then. That prevents errors from effecting other dats.


You should also have current backups using Time Machine or otherwise anyway, too.


But as requested above, where are you going with this gzip’d tar archive? What do you think is in it?

How to Open tar.gz file on Mac ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.