

rename does what you'd expect: it renames files.

The /r means "apply this replacement to a copy of the target string (the file name) and return the modified string. It runs on $_ by default, so it will run on each file name. s/_HBO_DPM_/_dpm_/ replaces the first occurrence of _HBO_DPM_ with _dpm_. $_ is a special variable that holds each element we are iterating over (in the foreach).
#Mass rename files for image sequence free
Of course you are free to be more specific: mmv 'sb_606_HBO_DPM_*' 'sb_606_dpm_#1' Also note that the command above assumes that all the files which match the first glob shall be renamed. The command receives exactly two arguments, and then finds corresponding files internally, without tight limits on the number of files. Note that the arguments are passed as strings, so the glob expansion does not happen in the shell. mmvįrom the package of the same name: mmv '*HBO_DPM*' '#1dpm#2' Each is a simple single line command, but I'll provide variants for more complicated cases, mainly in case the files to process are mixed with other files in the same directrory.
