|I have created a directory with a weird character in it (in this case, a tilde '~' character), and my FTP client won't let me delete it. I'd really like to get rid of it.
Many operating systems have special characters, called 'meta-characters', which carry special meanings. For instance, a period in a DOS/Windows style file name usually comes before the file's extension (which identifies the file type). Due to its DOS underpinnings, Windows also recognizes a whole host of other characters, such as asterisks and spaces as have special meanings.
The Macintosh only has one such character, the colon. All other characters are legal and perfectly usable in file and folder names.
Our servers run on Linux, which is a very close cousin to Unix. Just as with most forms of Unix, Linux has its own share of special characters. For example, take the following path name:
The forward-slash character (aka. '/') is a special character that designates the seperation between different directories and files. Here is another example:
In this case, the tilde character (aka. '~') is being used at the beginning of a path. Why? Well, the tilde is a special meta-character that denotes the start of a user's home directory. This is basically used as a shortcut for the standard '/home/username/' path. There are many characters such as these that carry special meanings.
Deleting Files/Directories With Odd Names
The tricky part about this is that you can actually use these characters in file and directory names (and occasionally, we find someone that does). Usually this doesn't cause too many problems until the point that an individual wishes to perform a function on the file or directory, and receives an error message. In particular, graphical FTP clients such as NetFinder or WS_FTP have trouble handling such filenames. If you attempt to delete such an item from your shell using the following command (as usual):
rm -r ~dirname
...you will usually end up gaining nothing but an error message. The way to delete such an item from a shell is to surround the file or directory name in quotes, ie.
rm -r "~dirname"
...this way, the name is interpreted exactly as it is typed, instead of applying special meaning to any particular meta-characters found (in this case, a tilde).
If you do not have a plan which provides shell access via telnet, just send us a message via the tech support form and we can delete the file or directory for you. Of course, the best technique to avoid such problems is generally to avoid creating items with such names to begin with.
Last updated: Jul 11, 2001.