shell_文件列表

来源:互联网 发布:pdm 软件 编辑:程序博客网 时间:2024/06/04 18:57

save as mtree.sh; then run:

#./mtree.sh

function tree(){for file in $1/*doif [ -d "$file" ]; thenecho "$file/"tree $fileelseff=$(echo $file | sed '/*$/'d)#avoid file like this ".hahaha.txt"if [ "$ff" != "" ]; thenecho $filefifidone}if [ -d "$1" ]; thentree $(echo $1 | sed 's/\/$//g')elsetree .fi



嘎嘎----------------------

还不如:

find $1 -print

效果好!!

just for play......................

原创粉丝点击