3 Ways To Easily Print Out The Contents Of A Directory Or Folder [Mac]
Pinterest Stumbleupon Whatsapp

print list of files in directorySay you want to get a list of all the files contained in a certain folder. How do you go about it? The most straightforward way might be to jot down those names in TextEdit, and if we’re talking about 4 or 5 files it might even be the fastest way. Not so when you’re looking at hundreds or thousands of files, or if this task is a recurring one. In that case, we use our computer to solve this for us.

You’ve likely heard about one of these techniques before, but there are in fact a number of different ways to go about printing the contents of a directory. Below, we will take a look at three of these. Choose the one that fits your particular style or needs.

1. Drag & Drop To Your Printer

We’ll start off with the simplest tool of the bunch – your printer. Yes, you heard that right, and no, printer is not a metaphor for anything besides a printer.

When you connect a printer to your Mac computer, a printer-specific shortcut will be created. This may already be on your desktop, but you can usually find these in ~/Library/Printers, where ~ is your user folder. Use Finder’s Go -> Go to Folder… to bypass the hidden folders and go there easily.

print list of files in directory

So what complicated technical wizardry begets a list of your folder’s contents? Simple; you drag and drop the folder onto one of these printer icons, which gets you a list with filenames, file sizes and creation dates. A print window will pop up, which you can use to actually print the file list, or save it to your computer using the PDF button in the bottom left corner.

You may not always have your printer icon at hand, but if you do, this is one of the most effortless ways to generate a list of your folder’s contents.

2. Use The Terminal’s ‘ls’ Function

The most popular way to print file lists is undoubtedly with the Terminal, which you can find in Applications -> Utilities. As you can see in the screenshot below, typing ‘ls’ followed by a folder path generates a list of that folder’s contest. By using ls FOLDER_PATH > OUTPUT_PATH, you can print this list to a text file on your computer.

print directory tree

You can use flags to customize this output; expand upon it. For example, using ‘ls l‘ instead of just ‘ls‘ will print a detailed list, rather than just the filenames. Similarly, -h will force readable file sizes like KB and MB, rather than just byte sizes, and -R will recursively print the files embedded in folders, rather than just the folder names. Look here for a full list of available flags.

Tip: You can drag and drop a folder onto the Terminal window to avoid having to type the path name. This will insert the full path name on the location of your cursor.

3. Use a Third-Party Application Like PrintWindow

Above, we saw two simple ways to print a folder’s contents to a file. But what if you need more control over your output? That’s the point to start looking towards third-party applications. One of the most popular of those applications (with reason) is printWindow.

print list of files in directory

printWindow gives you the easy graphical user interface and customization that the above two options are missing. The applications comes in a free and premium version. Luckily, the most important features are available in both flavors of printWindow.

What tricks do you use on your Mac to print out lists of folder contents? Let’s hear about them in the comments!

Image Credit: sheelamohan / Free Digital Photos

Enjoyed this article? Stay informed by joining our newsletter!

Enter your Email

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Andrew Taylor
    January 22, 2018 at 4:17 pm

    Thank you! I always loved Karen's Directory printer for Windows - the "ls >output.txt" system worked just as well for Mac.

  2. Karen West
    October 27, 2016 at 4:01 pm

    I use screenshot. Shift Command 4 on Mac. A handle displays, drag it to select. Release mouse button and it saves to Desktop. Then click to open and click File, Print.

  3. Name
    February 17, 2016 at 5:00 pm

    Thanks, the ls flags were just what I was looking for!

  4. Candace Ziegler
    November 12, 2012 at 8:01 pm

    I have about 480 folders that I want to print but with them expanded to 1 level so I can see the contents of each folder. Print Window 4.1 crashes every time I try to do it there. Opening it in a new browser tab is an awesome tip but I can't expand the folders 1 level. Any ideas?

  5. beachcomber
    June 17, 2012 at 3:38 am

    Open TextEdit, create new document, make sure it is set to Plain Text (Format Menu).

    Open the folder, select all files (Command + A), copy (Command + C), paste into TextEdit file (Command + V), print (Command + P).

  6. Nishanth Kl
    June 1, 2012 at 11:30 am

    Thanks! very helpful

  7. Fernando
    May 29, 2012 at 9:08 am

    Drag & Drop that folder (or drive) into a new tab in your web browser. Print or Copy & Paste in a text editor. Done. This works with Firefox (both Mac and Windows) and other web browsers, but not for Safari.

    • Simon Slangen
      May 30, 2012 at 12:19 pm

      Thanks for the tip, Fernando. A really good way to print out the contents of a single directory level.

      On Chrome you can also browse to "file:///YOUR-FILEPATH" (three slashes) to achieve a similar effect. e.g. "file:///Volumes/Mac%20HD/Users/YOUR-USERNAME/"

    • Stef
      March 19, 2016 at 10:45 pm

      OMG this is WONDERFUL!!!!! Thanks so much.

    • franctastic
      May 7, 2016 at 12:14 am




  8. Fernando
    May 29, 2012 at 9:00 am

    Drag & Drop that folder into a new tab in your web browser. Print. Voila! (not all of the browsers work for this shortcut; Firefox does)

    May 28, 2012 at 10:26 pm

    do u use mac?

    • Simon Slangen
      May 30, 2012 at 12:13 pm

      I am, but a lot of these tips also have a Windows or Linux equivalent. :-)