To see which files an archive contains without unpacking them, use Terminal’s listing commands: unzip -l for ZIP files or tar -tf for TAR archives. This guide shows how to check filenames, folder structure, and available details while leaving the archived files unextracted.

List a ZIP file from Finder using Terminal

For a ZIP file, start with unzip -l. The lowercase -l option lists entry names, uncompressed sizes, and modification dates. Running unzip without a listing option normally extracts files into the current directory, so keep the option in place. These behaviors are documented in Apple’s distributed unzip manual.

  1. Open Terminal and leave the Finder window containing your ZIP visible.
  2. Type /usr/bin/unzip -l followed by a space. Do not press Return yet.
  3. Drag the ZIP from Finder into the Terminal window, after that space.
  4. Check that the command begins with /usr/bin/unzip -l, followed by the archive’s path, then press Return.

Dragging a file into Terminal inserts its absolute path, as described in Apple’s Terminal guide. This avoids having to navigate to the archive’s folder before listing it.

For example, if a disposable ZIP named Archive Inspection Demo.zip exists on your Desktop, the complete command is:

/usr/bin/unzip -l "$HOME/Desktop/Archive Inspection Demo.zip"

The quoted path keeps the spaces in this example filename together. The command requires the ZIP to exist at that location; it does not create the example archive. If yours is elsewhere or has a different name, use the drag method instead of copying the sample path.

Apple documents double-clicking a ZIP in Finder as the way to expand it, with the expanded item appearing beside the ZIP. For this inspection task, select and drag the archive instead. See Apple’s ZIP instructions.

Practice with a disposable archive

You can make a small example using only synthetic text. Choose an unused folder name so the exercise stays separate from existing files.

  1. In Finder, navigate to your Desktop and choose File > New Folder. Name the folder Archive Inspection Demo. If that name already exists, choose another unused name and use it throughout the exercise. Apple documents folder creation in Organize files in folders on Mac.
  2. In TextEdit, create a document containing Blue circle sample. Choose Format > Make Plain Text, then File > Save, and save it inside the new folder as shapes.txt.
  3. Create another plain text document containing Green square sample and save it in that folder as colors.txt. These document and conversion steps follow Apple’s TextEdit guide.
  4. Control-click the folder in Finder and choose Compress. Apple documents that compressing one folder produces a ZIP named after it. Before proceeding, check that a ZIP with that name is not already present; use a fresh folder name if necessary. See Zip and unzip files and folders on Mac.
  5. List the resulting ZIP using the Terminal steps above.

Look for entries corresponding to Archive Inspection Demo/shapes.txt and Archive Inspection Demo/colors.txt. Treat these as the expected paths for this constructed example, not a transcript from a tested Mac session. Entry order and additional entries can vary.

The original folder remains because you created it before compression. Its presence does not show that the listing command extracted anything. You can discard this example folder and ZIP in Finder when you finish.

Read the listing and choose the detail you need

An archive listing answers which entries are stored in the archive. It does not open the text or image inside each entry. Use this decision aid to choose the smallest useful check:

Your question Command or check How to interpret it
Which ZIP entries are present, and how large are they? unzip -l followed by the archive path Read the stored paths and uncompressed sizes.
Can I see just the ZIP entry names? unzip -Z1 followed by the archive path Read one entry name per line, without the summary table.
Are similarly named files in different folders? Compare complete entry paths Drafts/shapes.txt and Final/shapes.txt are different paths.
Does a listed file already exist on my Desktop? Check its intended location separately in Finder An archive entry alone does not establish that a separate file exists there.

For a cleaner names-only view of the synthetic example, run:

/usr/bin/unzip -Z1 "$HOME/Desktop/Archive Inspection Demo.zip"

Here, -Z selects ZipInfo mode, and 1 requests filenames only, one per line. Stored directory names remain part of the displayed paths. These options are documented in Apple’s distributed zipinfo manual.

Keep the full path when comparing entries. Two files called shapes.txt can occupy different folders inside an archive. Conversely, a listing does not resolve what would happen if you later extracted entries into a folder containing matching names. This workflow avoids that destination question by displaying the listing without writing the archived files.

A successful listing also has a narrower meaning than a complete archive test. The unzip manual documents a separate -t operation that expands entries in memory and checks their stored checksums. Seeing an entry’s name is not equivalent to testing its contents. See the documented listing and testing options.

Inspect TAR archives and compressed TAR files

For a TAR archive, use /usr/bin/tar -tf followed by its path. In Apple’s distributed manual, -t selects listing mode and -f identifies the archive file. The same implementation automatically recognizes gzip compression when reading, so this pattern also applies to a gzip-compressed TAR archive. See Apple’s distributed tar manual.

For an existing synthetic archive named Sample Bundle.tar.gz on the Desktop, the complete command would be:

/usr/bin/tar -tf "$HOME/Desktop/Sample Bundle.tar.gz"

This is a separate example: the Finder exercise above creates a ZIP, not this TAR file. Only run this command after such a file exists, or type /usr/bin/tar -tf followed by a space and drag an existing disposable TAR archive into Terminal.

To request a more detailed listing, add v:

/usr/bin/tar -tvf "$HOME/Desktop/Sample Bundle.tar.gz"

The manual documents verbose listing output similar to a long directory listing. Keep t in the command: x selects extraction to disk. The same manual explains that repeated names within an archive can overwrite earlier entries during extraction, another reason to distinguish listing from unpacking. See the tar modes and verbose option.

What can Apple Shortcuts do for this workflow?

Shortcuts can receive selected Finder items and appear as a Finder action. That integration supplies a starting point for automation; it does not, by itself, define an archive-listing operation. Apple’s Finder and Quick Actions instructions describe where shortcuts run, while the command manuals above establish the actual listing behavior.

Before adapting an existing shortcut, inspect its actions. In the editor’s action library, move over an action and click its information button. For an action already in the shortcut, Control-click its icon and choose Show Info. Apple says this description includes the accepted input and resulting output. See Navigate the action list in Shortcuts on Mac.

For this task, preserve three distinct things: the selected archive is a file, the listing is text describing entries, and those entry names are not extracted file objects. An action that produces files by unpacking an archive would change the workflow. The cited Apple guides do not establish a native archive-directory browser, so the complete inspection procedure here uses Terminal rather than assuming an action with that capability.

Input settings matter as well. Apple documents that a shortcut can restrict accepted content types and use Stop and Respond when no input arrives. A Finder workflow should accept files, and missing input should produce a clear stop instead of an empty downstream value. These controls are described in Limit the input for a shortcut when run from another app on Mac.

If the archive does not list correctly

Use the result to decide your next step rather than repeatedly changing options:

  • The archive cannot be found: confirm that the file still exists in Finder, then build the command again by dragging that exact item. Recheck the sample name if Finder created a differently named ZIP.
  • The output reports a format or read error: the inspection has not completed successfully. Recheck that you selected the intended archive; changing its filename extension does not establish that its contents use that format.
  • Some names appear before an error: treat the result as incomplete. Do not infer that the visible entries are the complete archive.
  • An entry is another archive: the outer listing identifies that nested archive as an entry. It does not establish the nested archive’s own contents.

For an ordinary ZIP check, the shortest complete workflow is to type /usr/bin/unzip -l, add a space, drag in the archive, and press Return. Read the full entry paths and any final messages. Once you have the filenames or structure you needed, the inspection is finished without unpacking the archived files.

Sources