How do I rename files in sub directories?

前端 未结 15 1447
臣服心动
臣服心动 2020-12-04 11:10

Is there any way of batch renaming files in sub directories?

For example:

Rename *.html to *.htm in a folder which has directories

15条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 12:01

    In Bash, you could do the following:

    for x in $(find . -name \*.html); do
      mv $x $(echo "$x" | sed 's/\.html$/.htm/')
    done
    

提交回复
热议问题