Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating textual representation of directory contents

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?

like image 658
jameshfisher Avatar asked Dec 28 '09 17:12

jameshfisher


2 Answers

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.

like image 172
ChristopheD Avatar answered Sep 29 '22 23:09

ChristopheD


Use tree command under Windows and Linux.

http://malektips.com/xp_dos_0040.html

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

like image 28
Hamish Grubijan Avatar answered Sep 29 '22 23:09

Hamish Grubijan