How can I batch rename files using the Terminal?

后端 未结 10 1738
情歌与酒
情歌与酒 2020-12-12 17:43

I have a set of files, all of them nnn.MP4.mov. How could I rename them so that it is just nnn.mov?

10条回答
  •  [愿得一人]
    2020-12-12 18:23

    ls -1 *.MP4.mov | while read f; do mv -i "$f" "$(basename \"$f\" .MP4.mov)"; done
    

    Edit: completly rewritten.

提交回复
热议问题