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

Comments are closed.

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

ADVERTISEMENT

Maker Faire Bay Area 2023 - Mare Island, CA

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

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).

FEEDBACK