Monday 29 October 2007

Print a folders contents in Mac OS X

In Mac OS 9 this was very easy. In Mac OS X the way to do it is ... look in your Utilities folder, in your Applications folder, and launch Terminal.

Right after the prompt type ls -lhTR . Next type a space, then drag the closed folder that you want to print, onto the Terminal window, and like magic the path to that folder appears in the Terminal window.

Ok, then type a right facing arrow > , and then a space, and a quotation mark " , and then the name of your file with a .txt file extension, like myFolderContents.txt and finally another quotation mark " . Your Teminal window should look something like this:
[yourname:~] yournam% ls -lhTR /Users/yourname/Documents > "myFolderContents.txt"
Now press return. ... and nothing much happens, besides the Terminal window now reads something like [yourname:~] yournam% followed by the prompt.

Go and look in your Home folder and you'll find it there. If not do a search. If you just want the file names and not all the other info regarding the files, just type ls rather than ls -lhTR.

3 comments:

Unknown said...

Great tip.
For folders that fit on your screen, go command, shift 3 and print the preview document that has appeared on your desktop.

Scribble & Tweak said...

Yes Rob, your tip is much less hassle than fiddling with Terminal, but then these tentative ventures into using it can be ... character building.

Another easy way to print a folder's contents, is to drop the folder onto an empty Firefox page and it lists it like directory. Then print the Firefox window.

Safari won't allow you to drop a folder onto a window for some reason. Possibly insecure?

Scribble & Tweak said...

The big advantage of using Terminal is that the txt file will also display the contents of any folders within the primary folder.

But then again if you only had a few sub folders with little content, you could always open those folders first and then take a screen grab.