8

I'm looking for a script to generate the graphical-ish textual representations of directory structures that you see around. Something that I can run like this:

james@computer:/.../basedir$ listdir .
basedir
|-firstsubdir
| |-file
| `-subsubdir
|   |-file1
|   |-file2
|   |-file3
|   `-file4
`-secondsubdir

james@computer:/.../basedir$

Presumably an established script exists? Must I write it?

skaffman
  • 398,947
  • 96
  • 818
  • 769
jameshfisher
  • 34,029
  • 31
  • 121
  • 167

2 Answers2

9

tree (on Windows as well as Linux - might require a apt-get install tree or similar on Linux).

Type tree /? (windows) or man tree for the command line options.

ChristopheD
  • 112,638
  • 29
  • 165
  • 179
2

Use tree command under Windows and Linux.

http://malektips.com/xp_dos_0040.html

http://www.centerkey.com/tree/

Hamish Grubijan
  • 10,562
  • 23
  • 99
  • 147