Skip to content

Instantly share code, notes, and snippets.

@vamsiuppala
Last active March 19, 2024 20:05
Show Gist options
  • Save vamsiuppala/18edf67cbe7d18abab5321bb52fc26f8 to your computer and use it in GitHub Desktop.
Save vamsiuppala/18edf67cbe7d18abab5321bb52fc26f8 to your computer and use it in GitHub Desktop.

If you would like to get the structure of a folder as a .txt file, you could use the 'tree' library (install using pip).

For example, to get the structure of this folder:

image

Use this command while in the home of that particular folder in the terminal:

$ tree -a > folder-structure.txt

It creates a folder-structure.txt file with the contents in it. Using the '-a' parameter in the command ensures even hidden files are part of the structure output.

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