Batch rename files in directory


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

test with echo instead of mv
example removes spaces after dots, replaces spaces with _, removes ' , and -, and finally lowercases filenames


Copy this code and paste it in your HTML
  1. for F in * ; do NF=`echo $F | perl -lne "s/ /_/g; s/\._/./g; s/[',-]//g; print lc"` ; mv "$F" "$NF" ; done

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.