display structure of directory hierarchy
July 12, 2008
I came across this script while using stumbleupon, if we use this command in terminal it will show the list of directories and its subdirectories. It was really useful.
Hope you like it though.
ls -R | grep “:$” | sed -e ’s/:$//’ -e ’s/[^-][^\/]*\//–/g’ -e ’s/^/ /’ -e ’s/-/|/’
jacobian@jacobian-laptop:~$ ls -R | grep “:$” | sed -e ’s/:$//’ -e ’s/[^-][^\/]*\//–/g’ -e ’s/^/ /’ -e ’s/-/|/’
.
|-coding
|-Desktop
|-Documents
|-dwhelper
|-Music
|—MP3
|-NetBeansProjects
|—JavaApplication1
|—–nbproject
|——-private
|—–src
|——-javaapplication1
|—–test
|-Pictures
|-Public
|-Templates
|-Videos
|-workspace
|—jack
|—mine




