Tuesday, December 18, 2007

In Unix, how do I remove files with names that contain strange characters, such as spaces, semicolons, and backslashes?

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 rm command 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 rm command 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 the rm command.

Thursday, December 13, 2007

A story about Software Testing and How Important This Stuff REALLY is

Been busy lately and don't really have time to blog any stuff, but recently i came across a very interesting article called "The Book of Testing" and its not really a book but rather about an article written by James Hamilton.

Here's a little excerpt from that article but i would strongly recommend that you go read the entire stuff, really interesting :-)

Q: What is the most interesting bug you have seen?
A: Over the years, every software release on which I’ve been involved has had some truly difficult bugs. One of the most interesting was just prior to shipping DB2 V2.....
Signing out for now....oh yes, go read my friend's blog on this encounter with "The Netflix Problem" and it might get you interested in the importance of the art of solving problems.