Skip to content

Instantly share code, notes, and snippets.

@Akki9326
Last active October 24, 2019 06:55
Show Gist options
  • Save Akki9326/cebe7ba758906e7b3dec4ff4db920e6b to your computer and use it in GitHub Desktop.
Save Akki9326/cebe7ba758906e7b3dec4ff4db920e6b to your computer and use it in GitHub Desktop.

find . -type d | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"

This command will search recursively for directories inside the parent directory and then draw the tree of the founded directories.

You may also try the following to include all of the files as well.

find | sed 's|[^/]*/|- |g'

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