Draw Structure of Directory Hierarchy
Linux oneliner that draw's the structure of a directory Hierarchy using the magic of sed
and dash of grep
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
And then you get this:
/home/dem/apps/firefox
|-chrome
|---icons
|-----default
|-components
|-defaults
|---autoconfig
|---pref
|---profile
|-----chrome
|-extensions
|---{972ce4c6-7e08-474-a285-320298ce6fd}
|---inspector~mozilla.org
|-----chrome
|-----components
|-----defaults
|-------preferences
|---talkback~mozilla.org
|-----components
|-------talkback
|-greprefs
|-icons
|-plugins
|-res
|---dtd
|---entityTables
|---fonts
|---html
|-searchplugins
|-updates
|---0
source: http://www.centerkey.com/tree/
Written by James Barnett
Related protips
2 Responses
Isn't there a built-in analog of DOS-like tree
? I always thought that's weird, sounds like a common task...
over 1 year ago
·
There is a command tree
however it's not part of a standard package, so you probably have to install it on most systems.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Linux
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#