(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version





File listings from the command line

Updated September 2009



The OS X Finder suffers from a rather amazing limitation: you can't print the list of files you see in a Finder window. You can grab them and paste the list into something that can print, or you can do a screenshot and print that, but that's almost all.

Directory Content Printer is the one of only a few third party products I found - apparently this isn't seen as needed by many people!.

Another is Print Window. There is also PrintFinder.

Of course you can get quick printing from the command line. For some reasion, that suggestion is seen as unpleasant by most users. Even my wife, sitting not three feet from me, acts like I asked her to dig through the garbage when I suggest she open Terminal to do something.

It's not so horrible, really. Open Terminal (hit Command-Space for Spotlight and type "Terminal" if you have no idea what I mean), and try:


 ls | lp
 ls /Applications | lp
 ls ~/Documents | lp
 ls -l | lp
 ls -lR | lp
 ls -l | sort -r +4 | lp
 
 

That "|" thingy is called a "pipe symbol". It's the broken vertical bar produced by SHIFT-\. That's right, hold Shift and hit "\".

The "ls ~/Documents" says to list the "Doocuments" directory under your Home ("~") directory. An "ls ~Pictures" would list your Pictures.

Was that painful? There's a lot more you can do at the command line and none of it is really hard. Read some of the "Shell" articles here and particularly see Take Control of the Mac Command Line with Terminalfor more.

Don't neglect reading the "ls" man page if you aren't familiar with it; there are a lot of options for showing the files in different ways. You'd type "man ls" while still in Terminal to do that.

Why don't you print it? Type

man -t | lp
 

Or send it to Preview:

man -t ls | open -f -a /Applications/Preview.app/ 
 

I'm really surprised that there is still no way to do this from Finder. Maybe OS X will eventually address this, but printing from the command line will probably always have more power and flexibility.

`
;


Click here to add your comments





Thu Sep 17 16:16:16 2009: Subject:   BruceGarlock
http://bgarlock.com
gravatar
Although Cocoatech's PathFinder http://www.cocoatech.com is a bit bloated (runs a little slower than I would like) it generally fills in all the gaps that Apple's Finder has in it. I have been using it for a while now, and would recommend that people give it a try. Like I said, it feels a little bit bloated, but has just about every feature that you would want - including printing directory contents - and has a very in-depth way of customizing it for how you want things to work.

One of my favorite features, is the "Stacks". You drag files you want to copy to the "Stack", and you can then navigate to where you want the files to go, without jockeying windows around, and making a mess of your desktop.

I have recently added PathFinder to one of my "Top Ten Must have Mac Apps". I plan on writing a full blown article of my top ten for aplawrence.com - but I have two apps which I have been wavering with, and need to spend some more time with them to make sure they are worthy :-)



Thu Sep 17 16:20:29 2009: Subject:   TonyLawrence

gravatar
What if you can't find ten? :-)

We're all looking forward to that - your app suggestions have been very useful.

Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!



 I sell and support
 Kerio Mail server