save as mtree.sh; then run:
#./mtree.sh
function tree()
{
for file in $1/*
do
if [ -d "$file" ]; then
echo "$file/"
tree $file
else
ff=$(echo $file | sed '/*$/'d) #avoid file like this ".hahaha.txt"
if [ "$ff" != "" ]; then
echo $file
fi
fi
done
}
if [ -d "$1" ]; then
tree $(echo $1 | sed 's/\/$//g')
else
tree .
fi
嘎嘎----------------------
还不如:
find $1 -print
效果好!!
just for play......................