mass files with illlegal names in linux

Windows are notorious for having files that are named with illegal characters like ?, & spacing…etc. To mass rename them, remember to use quotations in the mv command. eg

for i in *; do mv "$i" newfile_"$i"; done;

It took me along time to figure out that the error lies in the mv command and not the filenames… I was trying all sorts of backslash tricks with sed and couldn’t get the desired result.