Skip to content

Instantly share code, notes, and snippets.

@Arahnoid
Created December 10, 2014 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arahnoid/63b824c4842a70d37d53 to your computer and use it in GitHub Desktop.
Save Arahnoid/63b824c4842a70d37d53 to your computer and use it in GitHub Desktop.
# Generate Txt File With Directory Tree
http://superuser.com/questions/258287/how-can-i-export-a-directory-structure
Assuming your directory tree is of reasonable size, you could also use the built in tree command, which produces a rather pretty looking directory tree. Unfortunately this prettiness is difficult to get working outside of a cmd instance, so you'll probably want to tell it to just use ascii characters with the /A switch.
### Example:
From a small multi-level structure
```
+---A
| +---A
| \---B
+---B
| \---A
| \---A
\---C
```
You can then redirect this to a file using a command like:
```
tree /A ["directory path"] > tree.txt
```
Where the directory path is optional, but useful if you want to tree something which isn't the current working directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment