0

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.

6
  • The usual trick is to prefix the name with ./, and use quotes to avoid spltting on spaces, so use mv "./-Cadence NDA Extension- Signed 10.2.17.pdf" whataver
    – xenoid
    Oct 18, 2019 at 15:10
  • I am not able to navigate to a folder in winscp. But I am able to see the folder from putty and I can see ERR and ORA inside the folder. Can you please help me with this? Oct 18, 2019 at 15:26
  • This seems like a different question. @xenoid would you like to answer this one?
    – slhck
    Oct 18, 2019 at 15:27
  • What do you mean by not able to navigate to a folder in winscp? Is your session open? Is that related to a specific folder? And you can access that very folder using Putty? Are you sure you're using the same credentials logging in?
    – SYN
    Oct 18, 2019 at 15:49
  • Yes to a specific folder. I can access the folder in Putty, but not from WinSCP. Also in putty I see ERR, ORA in that particular folder. That is weird. Oct 18, 2019 at 16:14

1 Answer 1

1

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.

1
  • Additionally, instead of escaping the spaces, you could quote the filename. Oct 18, 2019 at 19:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .