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 Answer
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
-
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?– ScotCommented Oct 21, 2020 at 3:38
-
-
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...– ScotCommented Oct 21, 2020 at 3:43
touch :
try withtouch \:
. Another option is to use TAB aftertouch ./
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 withls -la
. Also, check if you have a literal colon : or a fullwidth colon :. Send feedback!