1

I'm accessing a Windows HDD from my MacBook (local network). The HDD has a file with a : in it, which is not a valid character on both Windows and Mac. I wanted to rename the file from my Mac since it seems impossible from Windows but to no avail. The : is replaced by a backslash but the file throws an error when I try to modify it. Is there a way other than rely on a Linux computer?

1
  • Have you tried escaping the character? if you are doing touch : try with touch \:. Another option is to use TAB after touch ./ to try and see if it completes the filename or gives any hint. May be also interesting to list the directory and see if you have permissions to edit with ls -la. Also, check if you have a literal colon : or a fullwidth colon . Send feedback!
    – MrJavy
    Commented Oct 20, 2020 at 5:52

1 Answer 1

0

You should be able to rename it via the command line without doing anything special - this at least works on an APFS volume, but perhaps your Windows volume will work differently.

These commands worked as expected:

touch : 
mv : a
12
  • In your case it seems to work. However I can't make it work if the file also has a space. Can you rename a file such as touch "Test: New"? Commented Oct 21, 2020 at 3:35
  • Nevermind, I just made it work for my Mac (local file). However it doesn't appear to work on my remote HDD. :( Commented Oct 21, 2020 at 3:37
  • @EdgarDerby OK - I was about to tell you the same - that it works locally. What is the nature of the remote connection? Is it an SMB or NFS share?
    – Scot
    Commented Oct 21, 2020 at 3:38
  • SMB. Any other suggestions? :) Commented Oct 21, 2020 at 3:41
  • Did you try what @MrJavy wrote as a comment above? The tab autocomplete is worth a shot, though it seems that the issue really lies on the Windows machine rather than the Mac...
    – Scot
    Commented Oct 21, 2020 at 3:43

You must log in to answer this question.

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