---
tags:
  - macOS
  - Tahoe
  - tar
  - archiving
  - terminal
  - backup
title: Archiving and Compressing Files with Tar on macOS Tahoe
---

# Archiving and Compressing Files with Tar on macOS Tahoe

`tar` (Tape Archive) is the standard command-line utility for bundling multiple files into a single archive file. On macOS Tahoe, it is commonly used for backups, transferring groups of files, and compressing data.

## Creating an Archive

To bundle a folder into a single `.tar` file (without compression):

```zsh
tar -cvf archive_name.tar /path/to/folder
```

*   `-c`: Create a new archive.
*   `-v`: Verbose (show the progress).
*   `-f`: Filename of the archive.

## Creating a Compressed Archive

To bundle and compress files using Gzip (resulting in a `.tar.gz` or `.tgz` file), add the `-z` flag. This is the most common usage.

```zsh
tar -czvf archive_name.tar.gz /path/to/folder
```

## Extracting an Archive

To unpack an archive:

```zsh
tar -xvf archive_name.tar.gz
```

*   `-x`: Extract.

By default, this extracts files into the current directory. To extract to a specific folder, use `-C`:

```zsh
tar -xvf archive_name.tar.gz -C /path/to/destination
```

## Listing Archive Contents

To see what is inside an archive without extracting it:

```zsh
tar -tvf archive_name.tar.gz
```

*   `-t`: List contents.

## Common Flags Summary

| Flag | Meaning |
| :--- | :--- |
| `-c` | **C**reate a new archive. |
| `-x` | **E**xtract an archive. |
| `-f` | **F**ile (allows you to specify the filename). |
| `-v` | **V**erbose (prints filenames as they are processed). |
| `-z` | Compress with **Gzip** (`.tar.gz`). |
| `-t` | Lis**t** contents. |

For more on general terminal usage, refer to Getting Started with macOS Tahoe.