Convert all file extensions to lower-case

前端 未结 11 1955
生来不讨喜
生来不讨喜 2020-12-07 14:06

I\'m trying to lower-case all my extensions regardless of what it is. So far, from what I\'ve seen, you have to specify what file extensions you want to convert to lower-cas

11条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 14:51

    If your only interested in certain file extensions like converting all higher case "JPG" extensions to lower case "jpg" You could use the command line utility rename like so. CD into directory you want to change. Then

    rename -n 's/\.JPG$/\.jpg/' *
    

    Use -n option to test what will be changed, then when you happy with results use without like so

    rename  's/\.JPG$/\.jpg/' *
    

提交回复
热议问题