Generate ASCII tree view

September 27th, 2006 mysurface Posted in Common, Misc, tree | Hits: 30949 | 2 Comments »

You can use tree to list the directories and files in a tree structure. I am here to show you the example with some options specified.

Usually tree will shows files as well as directories, but this time I want to see directories only.

tree -d /usr

Wow, thats a lots and messy. Okay I want it to show only directories within 2 level

tree -d -L 2 /usr

Okay, again I can beautified it by using color (C) and better symbol (A)

tree -dCA -L 2 /usr

If I want to store the tree generated into a file?
(Make sure you turn off color and special symbol. )

tree -d -L 1 / > tree-view.txt

The command line above shows 1 level tree from / and store into tree-view.txt.

2 Responses to “Generate ASCII tree view”

  1. free alamo car rental discount codes

  2. Hello, you used to write great, but the last several posts have been kinda boring?
    I miss your great writings. Past several posts are just a little bit out of track!
    come on!

Leave a Reply