Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generate a tree structure from the Terminal to use in Markdown document
tree --dirsfirst --noreport -I README.md |
sed '1s/^/```'"$(printf '\n')"'/;$s/$/'"$(printf '\n')"'```/' > README.md

If tree is not available, install it via

brew install tree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment