Tom Lauck’s Deseloper.org

Print File Structure In Mac OS X

author:

The topic arouse while working a large project: “How can I print the directory structure in OS X? It was easy in OS 9.”

It is possible by using the Terminal application. I intend to write an AppleScript in the near future to do this automatically.

Open up Terminal (Its located in the Utilities folder in Applications)Enter

cd

*Make Sure there is a space after ‘cd

Select or open a finder window that has the directory of interest. Drag the file to the Terminal window and hit Enter.

A new line should appear. Type:

ls -RF > ~/Desktop/file_structure.txt

Look at your Desktop. A file named ‘folder_list.txt’ should be visible. You can now edit and do with it what you wish. is the name of the file you want the output of the recursive ls command to write out to. Feel free to use something more descriptive as you wish.

Feb 14 2007