I want to simulate a tree
command using Shell Script that displays all the directories recursively in this format:
.
|-- Lorem
|-- Lorem
|-- Lor
Try doing this (not exactly the same output, but very close) :
find ./ -type d -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
From http://mlsamuelson.com/content/tree-approximation-using-find-and-sed
find . -type d -print 2>/dev/null|awk '!/\.$/ {for (i=1;i
See http://www.unix.com/shell-programming-scripting/50806-directory-tree.html