Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为文件夹中的所有文件夹添加编号前缀。
例如,我有以下
我希望有
我有 91 张照片要以这种方式重命名。谢谢!
一个简单的for循环来遍历文件并printf生成新的文件名应该这样做:
for
printf
#!/bin/bash i=1 for orig in *.jpg do new=$(printf "%02d_%s" $i $orig) mv $orig $new ((i++)) done