Generate File System Trees in CSV Format with "tree" and "sed"


I don't know whether this will be useful to anyone else, but I wanted to use the Linux tree command to generate file system trees in CSV format on OS X. This should work pretty much as is on Linux, although you may need or want to change the paths and optimize the usage of sed.


This uses the Linux "tree" command, which is not standard on OS X.

View load.js
window.addEventListener("load", function(event) {
console.log("Hello! Non-destructive load-event handlers are the best kind! Don't you agree?");
console.log("load event: %o", event);
View angularjs-directive-module.js
(function() {
An AngularJS Directive via Isolated Module JavaScript
This is just a simple example of an AngularJS module that defines a
directive within an immediately invoked function expression, which can
be stored in and loaded from a separate file for clear, lean code
organization and easy distribution.
View template.sublime-project
"path": "/path/to/project/root",
"file_exclude_patterns": [".gitignore", "*.sublime-*"],
"folder_exclude_patterns": [".idea"]
View .gitignore
# OS X
# Adobe Dreamweaver
# Sublime Text
# JetBrains IDEs
# CodeKit
View Translucent Magenta Outline CSS
outline: 1px dotted rgba(255, 0, 255, 0.5);
outline-offset: -1px;
View Bookmarklet Template
javascript:(function(){/* Do stuff here. */}());void(0);
View Main.sublime-menu
"caption": "View",
"mnemonic": "V",
"id": "view",
"caption": "Layout",
"mnemonic": "L",
View Default (OSX).sublime-keymap
"keys": ["shift+alt+super+left"],
"command": "set_layout",
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
View Move and Resize Current Application.scpt
-- Adapted from
tell current application
set the bounds of the first window to {0, 0, 1024, 768}
end tell