It looks like you have an extra pair of single quote characters around your filename that need to be stripped off.
Here, I have a file named "hello":
Trying to delete it with extra single quotes like this:
$ rm "'hello'"
gives exactly the error message you see:
rm: cannot remove `\'hello\'': No such file or directory
\' before and after the name are single quotes you need to strip off.
In your case (as another answerer has noted) the output of
gsettings get org.gnome.desktop.background picture-uri
returns a result like:
So you want to strip the leading
'file:// and the ending
'. This can be done correctly using
sed like this (using only one expression with a group)
sed -e "s|^'file://\(.*\)'$|\1|g"
or maybe easier to read (using two simple expressions)
sed -e "s|^'file://||g" -e "s|'$||"
^ matches the beginning of the line
$ matches the end of the line.
- any character can be used in
sed to surround the search and replace expressions. Normally, you would use
/ but in this case it is easier to use something else, so I use