1.模拟test文件下的201712{01..31}/pdf这些文件夹下都有100个pdf文件
注意灰色部分有反引号
[[email protected] ~]# cat b.sh
#!/bin/bash
cd /root/test && mkdir -p 201712{01..31}/pdf
WJ=find /root/moban -type f
for f in find /root/test/201712{01..31}/pdf -type d
do
cp $WJ $f &>/dev/null
done
[[email protected] ~]#
2.直接在命令行写for循环
[[email protected] moban]# for f in {002..100};do cp PH0000001.pdf PH0000$f.pdf;done
原文地址:http://blog.51cto.com/12040328/2308106
时间: 2024-10-14 00:57:49