How do I rename files in sub directories?

前端 未结 15 1424
臣服心动
臣服心动 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 11:52

    AWK on Linux. For the first directory this is your answer... Extrapolate by recursively calling awk on dir_path perhaps by writing another awk which writes this exact awk below... and so on.

    ls dir_path/. | awk -F"." '{print "mv file_name/"$0" dir_path/"$1".new_extension"}' |csh
    

提交回复
热议问题