hello.txt ----> hello1.txt
test.txt ----->test2.txt
====================================
#!/bin/bash
i=1
for file in `ls *.txt`
do
mv $file `echo $file|sed "s/\./$i\./"`
i=$(($i+1))
done
结果
重点是红色定 sed 部分
2022-01-07 03:11:13
hello.txt ----> hello1.txt
test.txt ----->test2.txt
====================================
#!/bin/bash
i=1
for file in `ls *.txt`
do
mv $file `echo $file|sed "s/\./$i\./"`
i=$(($i+1))
done
结果
重点是红色定 sed 部分