How do I Remove Specific Characters From File Names Using BASH

前端 未结 5 1457
小鲜肉
小鲜肉 2020-12-23 01:52

I have a lot of files that have a shared pattern in their name that I would like to remove. For example I have the files, \"a_file000.tga\" and \"another_file000.tga\". I

5条回答
  •  清歌不尽
    2020-12-23 02:33

    Bash can do sed-like substitutions:

    for file in *; do mv "${file}" "${file/000/}"; done
    

提交回复
热议问题