Skip to content

Instantly share code, notes, and snippets.

@cksachdev
Last active July 19, 2018 17:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cksachdev/ca0687acb72b567e6eb03b21590a5bb8 to your computer and use it in GitHub Desktop.
Save cksachdev/ca0687acb72b567e6eb03b21590a5bb8 to your computer and use it in GitHub Desktop.
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