📌  相关文章
📜  使用渐进式数字重命名文件夹中的所有文件 linux - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:35.755000             🧑  作者: Mango

代码示例1
for i in *.txt; do
    new=$(printf "%01d.txt" "$a")
    mv -i -- "$i" "$new"
    let a=a+1
done

# "%01d.txt" 01 is the number of digits you want your name to be composed of,
# Example: %01.txt --> 1.txt , 2.txt, 3.txt, ..., 10.txt, ...
#           %04.txt --> 0001.txt, 0002.txt, ..., 0010.txt, ...