Skip to Content
Sindre Sorhus
Back to Supercharge

Updated

How to Copy the Folder Structure as a Tree on Mac

By Sindre Sorhus, who makes the Supercharge app

With Supercharge

  1. Open the settings of Supercharge, click “Tweaks”, and click “Configure…” next to “Context menu items”.
  2. In the “Main Menu” tab, turn on “Copy Folder Tree”.
  3. Right-click a folder in Finder, and choose “Copy Folder Tree”. For the open folder, right-click an empty area of the window.
  4. Paste the tree.

The result is like this:

Project/
├── src/
│   └── main.swift
└── README.md

Folders come first. Hidden files are not included, and an app or another package is one line. A tree with more than 1000 items stops with a line that tells you so.

The right-click items cannot show in synced folders, like iCloud Drive and Dropbox. There, right-click the folder, and choose “Services › Copy Folder Tree”.

Get Supercharge

Elevate your Mac experience

$20, one-time purchase, plus tax where applicable

Requires
macOS 27 or later
Updated
November 2026
Gumroad rating
5.0/5 (288 ratings)

More about Supercharge

Without an app

In Terminal, go to the folder, and copy its paths without hidden files:

Terminal
cd ~/Projects/site
find . -not -path '*/.*' | sort | pbcopy

The result is one path on each line, like ./src/main.swift, not a tree. The tree command prints a tree, but macOS does not have it. You can install it with Homebrew:

Terminal
brew install tree

The find command is fine for a short list. Supercharge gives the tree in one click, without Terminal.