超简单的 shell 批量删除指定文件

shell文件 : removeFiles.sh

#!/bin/bash
#removeFiles.sh

cat wait4delfiles.txt | while read myline
do
 echo rm -rf $myline
 rm -rf $myline
done

echo remove success!

wait4delfiles.txt 文件内容:

/usr/nassir/dir/aa.class
/usr/nassir/dir/bb.xml
/usr/nassir/dir/cc.properties

sh 授权命令: chmod 744 removeFiles.sh

创建文件命令: touch aa.class bb.xml cc.properties

参照:

http://luyafei.blog.51cto.com/1092421/794826

http://hi.baidu.com/bluedeman520/blog/item/40754753467cf5998d54302f.html

猜你喜欢

转载自nassir.iteye.com/blog/1462745