带提示删除目录下的每个子目录

ls -l |awk '/^d/ {print "start rm "$NF;system("rm -rf "$NF);print "done!"}'

 

 遍历2层目录并删除

for i in `ls -d *`; do for j in `ls -d $i/*`; do echo "rm -rf $j...";rm -rf $j;echo "done"; done; echo "rm -rf $i";rm -rf $i;done

 

posted on 2022-10-21 14:23  震撼起飞  阅读(9)  评论(0编辑  收藏  举报

导航