/ Published in: Bash

Add this to your .profile or .bash_rc file, source the file, navigate to the directory and call "rm_whitespace"
Based on: http://snipplr.com/view/4468/batch-rename-files-in-directory/
Based on: http://snipplr.com/view/4468/batch-rename-files-in-directory/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
alias rm_whitespace="for F in * ; do NF=\`echo \$F | perl -lne \"s/ /-/g; s/\_/-/g; s/[,']//g; s/[-]+/-/g; print\"\` ; mv \"\$F\" \"\$NF\" ; done"
URL: http://snipplr.com/view/4468/batch-rename-files-in-directory/
Comments
