Rename all files in directory from $filename_h to $filename_half?

前端 未结 11 896
执念已碎
执念已碎 2020-12-02 03:45

Dead simple.

How do I rename

05_h.png
06_h.png

to

05_half.png
06_half.png

At least, I think it\

11条回答
  •  春和景丽
    2020-12-02 04:33

    Use the rename utility written in perl. Might be that it is not available by default though...

    $ touch 0{5..6}_h.png
    
    $ ls
    05_h.png  06_h.png
    
    $ rename 's/h/half/' *.png
    
    $ ls
    05_half.png  06_half.png
    

提交回复
热议问题