Convert all file extensions to lower-case

前端 未结 11 1973
生来不讨喜
生来不讨喜 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:33

    If you have mmv (=move multiple files) installed and your filenames contain at most one dot, you can use

    mmv -v "*.*" "#1.#l2"
    

    It does not get more than one dot right (since the matching algo for * is not greedy in mmv), however, it handles () and ' correctly. Example:

    $ mmv -v "*.*" "#1.#l2"
    FOO.BAR.MP3 -> FOO.bar.mp3 : done
    foo bar 'baz' (CD 1).MP3 -> foo bar 'baz' (CD 1).mp3 : done
    

    Not perfect, but much easier to use and remember than all the find/exec/sed stuff.

提交回复
热议问题