Rename small part of multiple files in middle of name using Bash?

前端 未结 4 1945
孤独总比滥情好
孤独总比滥情好 2021-02-04 04:15

I\'d just like to change this

cc211_AMBER_13062012i.II  cc211_GROMOS_13062012i.II
cc211_CHARM_13062012i.II  cc211_OPLS_13062012i.II

to

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-04 04:49

    How about this:

    for i in *.II; do mv $i $(echo $i | sed 's/_13/_15/g'); done
    

    This will replace _13 with _15 in all files with extension .II

    More information on sed here.

提交回复
热议问题