The following is a page pulled off from the University of Indiana which i thought is useful, some of you might have seen it before but if you haven't, go right ahead at the link and read more about it.
If you've transferred files to your Unix account from a PC or Macintosh with filenames containing what Unix considers to be meta-characters, they may cause problems. Meta-characters (including semicolons, spaces, backslashes, dollar signs, question marks, and asterisks) are characters that are interpreted under Unix as commands or instructions. Although these characters may not cause any trouble in other operating systems, their special Unix interpretations may cause problems when you try to delete them. Try the following suggestions for deleting these files:
- Try the regular
rmcommand and enclose your troublesome filename in quotes. This may solve the problem of deleting files with spaces in their name, for example: rm "File Name" You can also remove some other characters in this manner, for example: rm "filename;#" The quotes prevent the semicolon from being interpreted as a stacking command. (Since you can string commands together in Unix with semicolons, Unix will interpret a semicolon in a filename that way, unless you put it in quotes.)- You can also try renaming the problem file, using quotes around your original filename, by entering: mv "filename;#" new_filename If this command successfully renames the file, you can then use the
rmcommand to delete the file using the new name.- If this does not work, insert a backslash ( \ ) before the meta-character in your filename. The backslash causes the character that follows to be interpreted literally. For example, to remove the file named
my$project, enter: rm my\$project- To remove a file whose name begins with a dash (
-) character, refer to the file with the following syntax: rm ./-filename Using the redundant./directory information prevents the dash from occurring at the beginning of the filename, and being interpreted as an option of thermcommand.