Rename multiple files based on pattern in Unix

前端 未结 22 908
死守一世寂寞
死守一世寂寞 2020-11-22 06:31

There are multiple files in a directory that begin with prefix fgh, for example:

fghfilea
fghfileb
fghfilec

I want to rename a

22条回答
  •  无人及你
    2020-11-22 07:10

    To install the Perl rename script:

    sudo cpan install File::Rename
    

    There are two renames as mentioned in the comments in Stephan202's answer. Debian based distros have the Perl rename. Redhat/rpm distros have the C rename.
    OS X doesn't have one installed by default (at least in 10.8), neither does Windows/Cygwin.

提交回复
热议问题