Invalid argument when copying files with ? in filename on OS X

afpmac-osxserver-message-block

I'm trying to copy files from an AFP share to an SMB share.

Several files on the AFP share have a ? in the name. If I try to copy them, I get invalid argument'.

I don't know how the files got the ? in the name in the first place.

Here is an example:

user$ cp tes?t /mnt/share/
cp: tes?t: invalid argument

I have tried to rename the file, but I get a 'resource busy' error message.

What can I do so that I can copy the files?

Best Answer

Escape the question mask with a backslash:

$ cp tes\?t /mnt/share/
Related Topic