You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

How do I list all folders and subfolders alphabetically on my MacBook Air?

I would like to see a list of all my folders and subfolders, alphabetically

The folders are in the Documents folder


[Re-Titled by Moderator]

MacBook Air (M3, 2024)

Posted on Oct 26, 2024 5:04 AM

Reply
11 replies

Oct 26, 2024 1:58 PM in response to Bomiboll

To get a sorted list In Print Window 5, under the File Information tab, select:

  • Sort by -> Name
  • Sort Order > Ascending



And if you want only folder names (nothing else), you should probably also:

  • Select Layout > Expand all Folders
  • Select File Information > Name (uncheck Kind, Size, etc.)
  • Deselect Icons & Headers > Include Heading
  • Deselect Icons & Headers > Include Icons


There are quite a few options in the various tabs & pull downs in PW5. Take a look through them.


Alternatively, you can export to CSV or Excel and then sort the file names in Excel, Numbers or other apps.

Oct 26, 2024 6:07 AM in response to Bomiboll

Launch the Terminal application. At the command prompt, enter the following commands that will write a text file to your Desktop that contains the alphabetical folder hierarchy of your Documents folder to the Desktop. The (/:on) syntax says only folders and sorted ascending by name. The '**' means recursively descend into the folder hierarchy.


cd
for f in ~/Documents/**/*(/:on); do print -Dl "${f}"; done > ~/Desktop/documents_folder.txt


That will take about a second or two and the text file on your Desktop can be viewed with Quick Look or opened in a Text editor.

How do I list all folders and subfolders alphabetically on my MacBook Air?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.