Sometimes you want to rename every single files in a directory tree. I had this issue when I transfered a huge numbers of digital pictures to my linux box. I realized that Microsoft Windows was naming imported digital pictures with a space in the name making it very difficult to rename in batch.
This little script allows you to rename every single file of a directory tree including files with funny characters and spaces with filename like pictures0001.jpg.
Here is the script :
#!/bin/bash
let COUNT=0
find /home/boismarj/images/AnneAlex -name '*.jpg' -exec ls -li {} \; | sed 's/\/Picture.*.jpg//' | awk '{print $1"|"$10}' > file.txt
for lines in `cat file.txt`
do