0

Im trying to rename all .avi files recursively which start with "." to not starting with a dot. So

.04-03-29_15-00.00.avi  .04-03-31_17-54.00.avi
.04-03-25_00-09.00.avi  .04-03-25_20-28.00.avi 

should become

04-03-29_15-00.00.avi  04-03-31_17-54.00.avi
04-03-25_00-09.00.avi  04-03-25_20-28.00.avi 

Im experimenting with this commmand, but i cant get it working, the error ist rename: not enough arguments

find . -name "*.avi" -exec rename -n 's/^\.*/\/i' *avi {} \;
peterge
  • 11
  • 3
  • [Rename all files in a folder with a prefix in a single command](https://stackoverflow.com/q/6329505/608639), [Add prefix to all images (recursive)](https://stackoverflow.com/q/6140134/608639), [Find and replace filename recursively in a directory](https://stackoverflow.com/q/9393607/608639), [Bulk rename, change prefix](https://unix.stackexchange.com/q/47367), [Recursively rename all files whose name starts with a dash](https://askubuntu.com/q/882773) and friends. – jww Nov 24 '19 at 15:45

1 Answers1

0

Got it working with:

find . -name '*.avi' -type f -exec bash -c 'mv "$1" "${1/\/.//}"' -- {} \;
peterge
  • 11
  • 3