linux之shell遍历目录下所有文件

有时候需要写脚本批量处理数据对某目录进行遍历通知执行相关操作

for file in 03/*
do
    if test -f $file
    then
        echo $file
    fi
    if test -d $file
    then
        echo $file
    fi
done

猜你喜欢

转载自snv.iteye.com/blog/2423105