1

I have multiple 2 GiB gzipped-tar files (.tgz) I downloaded from an online service with Safari. It's a Google Takeout of my entire photos library.

As each file downloaded, Safari automatically decompressed them so in the end I had 21 tar files in my Downloads folder.

How can I extract the contents of these multiple tar files?

7
  • You might want to try The UnArchiver app from MacPaw. It is free, and works great. If you don't like the deep dive it takes sometimes to open multiple archives, this is the app for you. Note: No financial or any other stake in MacPaw Way Ltd. They just make excellent apps. Gemini 2 is also one of my favorites.
    – IconDaemon
    Commented Apr 11, 2023 at 0:25
  • In the terminal, do open *.tar.
    – lhf
    Commented May 11, 2023 at 15:38
  • Is this what you're looking for? support.apple.com/en-gb/guide/terminal/…
    – Thinkr
    Commented May 11, 2023 at 17:06
  • @lhf did you test that? I think you’ll find that doesn’t work
    – deed02392
    Commented May 12, 2023 at 19:04
  • 1
    @Thinkr the guide only specifies extracting a single tar archive. This question is about extracting a multipart tar archive
    – deed02392
    Commented May 12, 2023 at 19:05

2 Answers 2

4

The tar command-line program on macOS only supports a single filename as an argument. However a valid workaround is to concatenate multi-part tar archives and pipe this to tar's standard input. This can be achieved with the following example.

Given a directory of multiple tar files, the following command would extract their contents to the current directory, listing each file as it's extracted:

$ cat *.tar | tar --options read_concatenated_archives -xvf -

This assumes the files are named in the directory with the correct order for shell globbing.

0

In the Terminal, do

cd ~/Downloads ; open *.tar

(as a side effect, it opens the Downloads folder in the Finder)

It also works for *.tar.gz and *.tgz.

1
  • This is a reasonable strategy, but it invokes LaunchServices to figure out the right binary to handle tar files, which is a lot of unnecessary overhead and more fragile than a direct command-line approach referring to the tar binary on $PATH. It also has the side-effect you mentioned of opening Finder (possibly because it uses Archive Utility to do the extraction).
    – deed02392
    Commented Feb 29 at 13:04

You must log in to answer this question.

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