3 Ways To Print File Listings On Your Mac

If you need to print the list of files in a folder, you can do it using TextEdit, the Terminal or by using a special trick involving your printer. Using TextEdit is a simple drag-and-drop, but you must be working with a plain text document. By using the ls command in the Terminal, you can customize which information is included with the listing. You can also simply drag and drop a folder to an alias to your printer, but you must create that alias first.
Video Transcript / Captions
Closed captioning for this video is available on YouTube: 3 Ways To Print File Listings On Your Mac.

Hi, this is Gary with MacMost.com. MacMost is brought to you by the more than 300 people that support it on Patreon. Find out how you can become a part of it at macmost.com/patreon.

Today I'm going to show you how to print out a file listing of the contents of a folder. Say you have a folder like this and it has a variety of different files and folders in it. Unfortunately there's no Print command in the Finder. So I can select this folder here. You think under File, Print it might be a way to actually print or export a list. But there isn't. However you can still do it several ways.

So the first one I'm going to show you is I'm going to select all the items I want. So I use Shift and click there to select everything. I'm going to go into TextEdit. I'm going to create a new document and note that it has to be a plain text document. Not a rich text one. I'm going to simply drag these files to this document. Since it's a text editor it's going to correctly assume that I want a text version of this which is basically going to be the paths for all the files. You can see here's a listing of all the files in TextEdit. So I can print that out. It gives me the full path. So if I wanted to make it simpler I could actually select this, copy to a find and paste it in there and then say replace it with nothing. So I'm going to have nothing here on this next line. To Replace All. So now I've got just the file names since I've replaced all the paths.

Now another thing that I could do is I could get, not just the files in this folder, but the subfolders as well. If I go to List View and I open up some of these subfolders in there and I could do all of them or I can do just some. Whatever I want. So now you'll can see if I click on one and I can grab them all, I'm actually going to use Command A this time to grab all of them. You can see it grabs the files even in the subfolders. So now when I drag and drop into TextEdit I get files even down inside some of those special folders there. So I get a longer listing. So that's how you can do it just using TextEdit just to get the bare minimum. Just the file names.

Now next I'm going to try this in Terminal. So Terminal, being command line interface to your Mac, is a great way to get file listings. So I could easily get into this folder by simply going CD, for change directory, and I'm going to drag from the Finder the folder there and it's going to give me the full path to it. So now all I have to do is hit Return and I'm in this directory. Now I can actually do LS, for listing, and just see what files are there. So you can see now I've got the names of these files. I can select and Copy and Paste them into TextEdit of something else. I could actually even just print the window here if I don't mind the stuff at the top and the bottom.

But I could also do more than that because I can do LS and dash L and L would give me more stuff. It's going to give me a little listing here. It's going to include the size, the date, and the file name, and some other stuff like permissions and such. You can get really specific on what LS will show you. So if you want to play around with this do man, for manual, LS and you get a ton of different options for using LS and then you can have this customized output that you can then copy and paste and printout easily.

Alright, so here's a final way to do it. That's by dragging and dropping the folder to your printer. Now how do you do that? How do you drag and drop something to the printer. Well, if you go into System Preferences and then you go to Printers and Scanners you'll see your printers here. It would be great if you could drag and drop it there. But you can't. However you can drag this out and stick it anywhere you want. I showed you awhile ago how to stick it in your Dock. You can also stick it on the Desktop. Wherever you put it it's a shortcut to that printer.

I can now quit System Preferences and now I have something that I can drop it to. So instead of dropping all these files here, because if I drop an individual file it's actually going to print that file, but if I drop a folder onto it this is what I get. It's going to go and want to print. It's going to go and give me a little preview here of this document. You can see it's going to give me file names. It's going to give me the size and the time. So now I can print it. I can even go and open it and save it as a PDF or directly open it in Preview so I can see here my stuff. I can even copy and paste this text if I wanted to or just send it along or continue by printing it.

Comments: 9 Responses to “3 Ways To Print File Listings On Your Mac”

    Wayne Cherry
    3 weeks ago

    In terminal, why not pipe the results of ls straight to the printer: i.e.:

    ls | lp

    3 weeks ago

    Wayne: That’s a good idea, but you may want to control which printer, which options, or even to send it to a PDF.

    3 weeks ago

    The Path Finder app from cocoatech.com (which makes the Finder app of the macOS look and act like an anemic cousin) has a built-in report to automatically generate Directory Listings in the native text editor that comes with Path Finder. The first app I always install on a new Mac is Path Finder…

    3 weeks ago

    Love all the weekly videos. Very informative and even after 30 years (starting at System 6) I still manage to learn something almost always.

    To give a little back, you can use the command line to dump directly to a text file, i.e. ls {drag in folder being listed} > Folderlist.txt and it will dump a text file out (to your root directory). To get it to the desktop type (or drag) in: ls /Users/Drew/Desktop/FOLDER > /Users/Drew/Desktop/Folderlist.txt. Have a great day!

    Bert Mullemeister
    3 weeks ago

    Hi Gary, even though I set my folder to list by name, it printed my file randomly (9 pages)
    Is there a way to solve that?
    Thanks for all your helpful files

    3 weeks ago

    Bert: Which method were you using?

    Mike Macewich
    2 weeks ago

    Good topic. I noticed that my Finder was set to GROUP BY KIND. When I dragged and dropped the files into TextEdit, the files came out in a random sequence without any regard to grouping.

    Bert Mullemeister
    2 weeks ago

    Hi Gary I used the method as per your video but had no luck getting the files alphabetically
    I used an app called Print Window app which allows sorting by name and t worked like a charm
    Thanks anyway

    2 weeks ago

    Bert: Which of the three methods did you try?

Leave a New Comment Related to "3 Ways To Print File Listings On Your Mac"

0/500 (500 character limit -- please state your comment succinctly and do not try to get around this limit by posting two comments)