what kind of retropie distribution do you use?
for cd home/pi/RetroPie-Setup/
it says no such file or directory
are you sure sure you typed it the same way I wrote it (with the caps, etc.)? linux is case sensitive!
as for saving, try CTRL + O and CTRL + X to quit(?), but it will not work if you have no permission. I edit the retroarch.cfg over WinSCP on my Windows pc
you can also try this:
in the console type startx – this will boot up a front end. from here you can open some kind of file/directory explorer (like windows explorer) as well as some Terminals where you can type into the console. in the explorer check whethere you really dont have the home/pi/RetroPie-Setup/
in the console try
sudo chown -R pi /opt/retropie/
sudo chgrp -R pi /opt/retropie/
to change the owner and group rights for the directory “retopie” (and its subdirectories and files). now the user pi should be able to edit and save changes in all files within this directory.
if you still can’t edit the retropie.cfg try
sudo chmod 660 /opt/retropie/configs/all/retroarch.cfg
I’m not sure if either of what I posted works but you can give it a try