[brlug-general] Script help

Tim Fournet tfournet at tfour.net
Wed May 30 09:29:25 CDT 2007


B. Estrade wrote:
>
> I find the following one liner very helpful for renaming files:
>
> # find . | perl -ne'chomp; next unless -e; $oldname = $_; s/aaa/bbb/;
> next if -e; rename $oldname, $_'
>
> Not so obviously, this replaces 'aaa' with 'bbb'.
>   

The equivalent using the 'rename' command would be:
rename aaa bbb *




More information about the General mailing list