Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
Do you get the same error when copying from the AFP share to another place in the AFP share? (E.g. is the error on cp's read from AFP, on on the write to the SMB share (with NTFS behind it?) – Hennes Aug 3 '12 at 13:31

Escape the question mask with a backslash:

$ cp tes\?t /mnt/share/
share|improve this answer

Is removing the ? an option? That's an invalid character for a file or pathname under NTFS-compatible filesystems, as it's actually a one-character wildcard.

The resource busy error is probably a result of the ? being interpreted as a wildcard, and the filesystem trying to access all the possible, invalid filenames it thinks that might stand for.

I'm fairly positive you'll have to access the files from a filesystem that doesn't consider ? an invalid character (is it a valid character on Macs?) to replace the ? with a valid one.

share|improve this answer

The ? symbols represent unrecognized characters.

Most likely the problem here is that AFP uses UTF-8 filenames, but you are not logged in to the system that mounted the AFP share using a UTF-8 locale. If it's a Linux box, you can check your locale using the locale command.

If you find it's not using a UTF-8 locale, you can temporarily change the locale with something like:

export LC_ALL="en_US.UTF-8"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.