bulk rename with \'rename\' command on linux


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # command: rename <options> 's/<old>/<new>/ <where>
  2.  
  3. # first testing with param -n
  4. rename -n 's/(\w+)\s(.*)\.pdf/$1\.pdf/' *
  5.  
  6. # placeholder $1 is the first group matched, etc
  7.  
  8. # execute with verbose
  9. rename -v 's/(\w+)\s(.*)\.pdf/$1\.pdf/' *

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.