PDA

View Full Version : [ubuntu] Deleting Gedit back-up files - poor grammar saved the day



eMacDude
June 11th, 2010, 08:41 PM
I had some poorly named files from some time ago that I wanted to delete. The files were simple C programs that I was playing with while trying to learn basic programming. Unfortunately I saved the files using names with spaces between words and one that was wrapped in quotation marks. Yes, I really did. For example:

File Name

"File Name"

Besides not realizing that this was poor form I didn't realize that Gedit was by default making back-up files. As a result I ended up with:

File Name~

"File Name"~

Tried using the command line to remove the files but this didn't work. For example:

rm File Name~

rm "File Name"~

Result:

rm: cannot remove `File Name': No such file or directory

The solution? I found the solution for the first one in the Ubuntu forums. As suggested, I wrapped the file name in quotation marks:

rm "File Name~"

This did not work in the second example since it already had quotation marks. After a lot of shots in the dark and some head scratching I recalled an old grammar lesson albeit incorrectly. When quoting a quote within a quote you place double quotation marks around single quotations - which is correct. I remembered this lesson the opposite way and placed single quotation marks around the double quotation marks:

rm '"File Name"~'

That solved it! Poor grammar saved the day. With this in mind I'm thinking of using bad math for my next income tax return and see if it's as successful.