The folder was renamed to '-Cadence NDA Extension- Signed 10.2.17.pdf' by mistake and now am not able perform anything on the folder. How to rename it to dicarta? I am trying this in UNIX Shell Script.
1 Answer
Try this:
mv -- -Cadence\ NDA\ Extension-\ Signed\ 10.2.17.pdf some-other-name.pdf
The reason you may have had an issue is that, if your source file starts with a -
, then mv
tries to parse it as an option. Passing a --
before your arguments usually helps (also with commands other than mv
)
Or as suggested in comments:
mv ./-Cadence\ NDA\ Extension-\ Signed\ 10.2.17.pdf some-other-name.pdf
Prefixing your file with a relative (or absolute) path can help get around that issue.
-
Additionally, instead of escaping the spaces, you could quote the filename. Oct 18, 2019 at 19:50
./
, and use quotes to avoid spltting on spaces, so usemv "./-Cadence NDA Extension- Signed 10.2.17.pdf" whataver