tree_20081124.jpg

Murphy Mac sent us a link to a handy find/sed command that simulates the DOS tree command that you might be missing on your Mac or Linux box.

find . -print | sed -e ‘s;[^/]*/;|____;g;s;____|; |;g’

You can see the result in the image above. Like most things I’ve seen sed do, it does quite a bit in a single line of code and is completely impossible to read. Sure it’s just a couple of substitutions, but like a jack in the box, it remains a surprise every time I run it.

Tree Command for Mac