Everywhere All articles Download Buy for $19

Finder fixes and how-tos

Turning a folder into a text list of its files

Updated 2026-10-30 · 4 min read

Finder has no obvious command that exports a folder's contents as a list, but two routes get the names out: copy and paste from Finder, or one Terminal command that writes a text file. Both below, with subfolders and sizes.

Two ways to get the names

In Terminal, one command writes the names of everything in a folder to a text file on your Desktop:

ls -1 "/path/to/folder" > ~/Desktop/list.txt

Type ls -1 , drag the folder from Finder onto the Terminal window to fill in its path, then add > ~/Desktop/list.txt. Open list.txt and you have one name per line, ready to print or paste into a spreadsheet.

In Finder, click one file in the folder, press ⌘A to select all, press ⌘C, and paste into a plain-text document. What a paste produces depends on the app you paste into, so the steps below use TextEdit in plain-text mode. The Terminal route gives the same result every time.

The list goes to the Desktop on purpose. If you wrote list.txt into the folder you are listing, the file would appear in its own list.

From Finder, step by step

  1. Open the folder and press ⌘A (Edit > Select All), then ⌘C.
  2. Open TextEdit, make a new document, and choose Format > Make Plain Text. If the Format menu offers Make Rich Text instead, the document is already plain text.
  3. Press ⌘V. In plain text you get the file names, one per line. A rich-text document tries to paste the files themselves (images and all), which is why plain text matters.
  4. To print the list, choose File > Print in TextEdit (⌘P).

To get the names into a spreadsheet, copy them from that TextEdit document and paste into Numbers or Excel; each line of plain text lands in its own row.

For full paths instead of names, select the files, hold Option and open the Edit menu: Copy turns into Copy “name” as Pathname, or Copy 3 Items as Pathnames for several (⌥⌘C). That is covered in how to copy a file path on a Mac.

From Terminal: the useful variations

All of these print to the window. Add > ~/Desktop/list.txt to any of them to save the output.

You wantCommand
Names, one per linels -1
Names including hidden filesls -1A
Sizes and datesls -lh
Names, with a / after foldersls -1p
The folder and everything inside itfind . -type f
Only this folder, not subfoldersfind . -maxdepth 1 -type f
Straight to the clipboardls -1 | pbcopy

Run them from inside the folder: type cd , drag the folder onto the window and press Return first. A few notes on how they behave, checked on a test folder:

Including subfolders

ls -R1 lists the folder and then each subfolder under its own heading, which reads well on screen. For a flat list with one full path per line, use find:

find "/path/to/folder" -type f > ~/Desktop/all-files.txt

Because you gave find the full path, every line begins with that path, so the list works as a record of exactly where each file was. If you only want the folder structure, the tree command draws it, and counting the files in a folder gives you the number rather than the names.

A list with sizes for a spreadsheet

ls -lh is easy to read but awkward to import, because its columns are separated by spaces and file names can contain spaces too. For a list that opens in Numbers or Excel as two clean columns, write the size in bytes and the name separated by a tab:

find . -maxdepth 1 -type f -not -name '.*' -exec stat -f '%z%t%N' {} + > ~/Desktop/sizes.txt

Run it from inside the folder, as with the table above. Each line holds a size, a tab and a name such as ./a b.jpg. Drop -maxdepth 1 to include every subfolder, and the names then show the subfolder they're in. Names with spaces are fine in the list; if you later feed them to another command, put them in quotes.

Finding one file's location

If you only need the location of one file, you don't need a list. In Everywhere, type part of its name, select the result and press ⌘C to copy its full path. Type folder: to search folders only, or path:Invoices to restrict results to anything with that in its path. It lists matches rather than exporting a folder's contents, so for a complete list of one folder use the methods above.

Common questions

How do I copy a list of file names in a folder on a Mac?

Select the files in Finder with ⌘A, copy with ⌘C, and paste into a plain-text document. For a result that is identical every time, run ls -1 > ~/Desktop/list.txt in Terminal.

How do I print a list of files in a folder on a Mac?

Create the list first, then print it. Paste the names into TextEdit and press ⌘P, or save the Terminal output to a text file and open it.

How do I export a list of files to Excel on a Mac?

Save the names with ls -1 > ~/Desktop/list.txt and open that file in your spreadsheet app, or paste a plain-text list into it. For sizes in their own column, the stat -f '%z%t%N' command in this guide writes a tab-separated list.

How do I list files in subfolders on a Mac?

Use find "/path/to/folder" -type f to list every file at every depth, or ls -R1 for a heading per subfolder. Add > ~/Desktop/list.txt to save it.

Find any file before you finish typing

Everywhere keeps track of every file on your Mac, including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.

Version 2.20.3 · macOS 13+ · 4.7 MB · notarised

Related

© 2026 Caretopia Network Private Limited Everywhere for Mac Buy a licence Articles Privacy Support