rename_to_lowercase.sh 216 B

12345678910
  1. #/bin/bash
  2. find . -depth -name '*[[:upper:]]*' -exec sh -c '
  3. for f do
  4. dir=${f%/*}
  5. name=${f##*/}
  6. newname=$(awk "BEGIN{print tolower(ARGV[1])}" "$name")
  7. mv -f -- "$f" "$dir/$newname"
  8. done' sh {} +