@MyFartSoTart
"Also in the /opt/retropie/configs/all, there is already a file named retroarch.cfg." -> obviously. Windg told you that file is corrupted. He explained you should replace it with a non-corrupted copy.
"mu: target" -> the command is "mv" (with a v, like in "velocity", not with a "u" like "unknown").
"‘retroarch.cfg.rp-dist' is not a directory" -> that's because you forgot to type the space between the two names.
Here is in 3 steps something that could help you to make less typing errors (press return after each end of line):
cd /opt/retropie/configs/all
rm retroarch.cfg
cp retroarch.cfg.rp-dist retroarch.cfg
The commands are :
cd, like Change Directory
rm; like ReMove
cp, like CoPy
Mind the fact there is, in the last line, a space between "retroarch.cfg.rp-dist" and "retroarch.cfg". Don't type "retroarch.cfg.rp-distretroarch.cfg" as if it was only one long word.
(as sleve_mcdichael said, it's not required to remove the file in step 2, because the cp command in step 3 will delete the original-corrupted file anyway. But I think it could help you to best understand what you are doing).