Though Unix/Linux will technically allow any character in file and directory names, using punctuation is almost always fraught with peril due to the extensive use the O/S makes of punctuation for delimiters, etc.

That said, I'm experimenting with something that would benefit from having a directory named just the single character @ (at sign).

I've encountered no problems with a few days of use but may be overlooking something.

Are there commands or circumstances where this could come back to bite me?

  • 3
    If code, including shell code, doesn't handle all possible filenames it is buggy and broken. – jordanm Mar 17 '13 at 4:28
  • 3
    @ might be a problem in perl where @ needs to be escaped in double quoted strings. I second @jordanm's comment though that it's only a problem with buggy code. – Stéphane Chazelas Mar 17 '13 at 12:16

I'm fairly sure that one is reasonably safe. It's not a shell metacharacter in any shell that I'm familiar with, and I can't think of anything that uses it as a delimiter. It's also already in use in file names by common applications. For example, it's common to use it for naming the sockets for ssh's ControlMaster.

ls -F does use it as the character to mark symlinks, which may be slightly confusing to someone, but colorized ls won't have that ambiguity.

| improve this answer | |
  • @ in sockets I think you're refering to is something else. It's for the abstract namespace that is for Unix(7) domain sockets not in the filesystem (and is Linux only). – Stéphane Chazelas Mar 17 '13 at 12:19
  • I'm referring to the results of ControlPath /home/eagle/.ssh/sockets/%r@%h:%p, which will lead ssh to create UNIX domain sockets in the file system with @ in the name. I was looking around for places where @ was used in the file system. (Those sort of UNIX domain socket endpoints are just special types of files.) You don't have to use that setting, of course, but it was in an example that I based my configuration on, and I think it's reasonably common. – rra Mar 17 '13 at 18:57
  • OK sorry, my bad. – Stéphane Chazelas Mar 17 '13 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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