FabrizioCaldarelli
12/17/2016 - 10:12 AM

/usr/local/bin/tree console command for mac

/usr/local/bin/tree console command for mac

#!/bin/bash

SEDMAGIC='s;[^/]*/;|____;g;s;____|; |;g'

if [ "$#" -gt 0 ] ; then
   dirlist="$@"
else
   dirlist="."
fi

for x in $dirlist; do
     find "$x" -print | sed -e "$SEDMAGIC"
done