In question How to rename all files in folder with name ending with "_backup" @Radu Rădeanu gave a good answer that was useful to me as well:
find . -type f -name '*.jpg_backup' -print0
| while IFS= read -r -d '' file ; do mv -- "$file"
"$(echo $file | sed 's/_backup//g')"; done
However, I would like to fully understand his one-liner. Precisely, the part that I don't understand is:
while IFS= read -r -d '' file
I get that IFS is "internal field separator" and I suppose this is removing or ignoring the whitespace, but I don't understand the syntax and the options.
I would also like to understand why the --
is necessary after mv.
Could someone help? Thanks.