举两个自己实际用到的例子:

1.批量转换 Flac 为 MP3

for i in *.flac; do ffmpeg -i "$i" -vsync 2 -b:a 320k "${i%.flac}.mp3"; done

2.去除文件后缀名带的参数

for i in *.jpg*; do mv "$i" "${i%.jpg*}.jpg"; done