shell 删除文件夹下的子文件中文件的数目小于一定数目的子文件夹

来源:互联网 发布:protel99se软件下载 编辑:程序博客网 时间:2024/06/14 20:30
#!/bin/bashfor i in `find /home/zhoucy/paper/shell/test/ -type d`do echo $inum=`find $i -type f|wc -l`if [ "$num" -le 5 ] thenrm -r $iecho "file in "$i" is : "$num " and rm this dir"elseecho "file in "$i" is : "$num "and does not rm this dir"fidone

原创粉丝点击