Remove cap and space from filename using bash


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



Copy this code and paste it in your HTML
  1. for f in *; do
  2. file=$(echo $f | tr A-Z a-z | tr ' ' _)
  3. [ ! -f $file ] && mv "$f" $file
  4. done

URL: http://www.linuxquestions.org/questions/programming-9/bash-script-to-remove-capitalisation-and-spaces-form-a-filename-309567/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.