How do I successfully remove or file the file?
$-, you need to quote the filename when using the
rm command, and other commands, as the
$- unquoted is being expanded to a name other then the actual filename and is why the file isn't been found.
Terminal command examples:
% touch '~$-foobar' % ls ~$-foobar zsh: no such user or named directory: 569XZilmsfoobar % ls '~$-foobar' ~$-foobar % rm ~foobar zsh: no such user or named directory: foobar % rm '~$-foobar' % % ls '~$-foobar' ls: ~$-foobar: No such file or directory %