/ Published in: Bash
URL: http://snipplr.com/view/4468/batch-rename-files-in-directory/
Add this to your .profile or .bashrc file, source the file, navigate to the directory and call "rmwhitespace"
Based on: http://snipplr.com/view/4468/batch-rename-files-in-directory/
Expand |
Embed | Plain Text
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"
You need to login to post a comment.
