Tree command for Mac/Linux

Technology

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

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Tagged
Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 16th iteration!

Prices Increase in....

Days
Hours
Minutes
Seconds
FEEDBACK