
shell
shell
yang_ldgd
这个作者很懒,什么都没留下…
展开
-
shell 批量删除目录下所有数字开头的html文件
shell 批量删除目录下所有数字开头的html文件#!/bin/bashdir="/home/www/wwwroot/"for sfile in $(ls $dir)doif [ ! -d ${dir}${sfile} ];thenecho ${dir}${sfile}."不是文件夹"elsefor rmf in $(ls $dir$sfile/[0-9]*.html)doif [ ${dir}${sfile}/404.html != ${rmf} ];thenrm -vf ${原创 2021-07-13 19:12:05 · 440 阅读 · 0 评论 -
shell 批量删除非指定的文件和空文件夹(包括子文件夹)
#!/bin/bashpath="/www/wwwroot/www.qianduan.ccc"function search_file(){ for file in `ls $1` do if [ -d $1"/"$file ];then search_file $1"/"$file else if [ "${file##*.}"x != "js"x ] && [ "${.原创 2021-06-17 16:00:07 · 517 阅读 · 0 评论