Deleting "C:\Blah\Blah\..\...\Blah" File on Unix

I have a remote Linode, which I am using Cygwin to access. An errant database file, specifically "C:\Users\Blah\Blah\website\blah\sqlite.db" was created. This file was used for local testing on my Windows machine, but was generated due to a mistake on the Linode. Note, this is the full file name inside the Linode, not the location of it. This is Windows syntax, not Unix, which is where I think the problem lies.

Now, I cannot delete it! It says, cannot remove file "file name" where file name does not have any of the original backslashes. This tells me that it cannot recognize that this is an errant windows DB file.

How can I delete this? If I had access to a GUI folder I could use that, but I only have the command line!

Please help!

Answers


The backslash and colon are not special characters to the filesystem (which is why you can have a file with those characters in its name), but backslash is a special character to the shell (and : is special in some contexts).

You just have to pass the file's name to the rm command. To do this from the shell, you need to escape the backslash characters.

This should work:

rm C:\\Users\\Blah\\Blah\\website\\blahsqlite.db

For example (I just tried this on my own system):

$ touch C:\\Users\\Blah\\Blah\\website\\blahsqlite.db
$ ls
C:\Users\Blah\Blah\website\blahsqlite.db
$ rm C:\\Users\\Blah\\Blah\\website\\blahsqlite.db
$

And if your shell supports tab completion, then you can probably just type rm Ctab and, if there are no other files in the current directory whose names start with C, the shell will expand that to (an escaped version of) the file name. (Bash happens to insert a a \ in front of the : as well; this is unnecessary but harmless.)


Need Your Help

image protection in asp.net application

asp.net security

i have asp.net application , in one page it is showing one model image if u do right click on image and view image it shows of path where it is stored using image id,so people can see other image a...

What settings should I use to resolve this GridBagLayout resizing issue?

java swing jpanel jscrollpane gridbaglayout

I have been searching and trying ways to resolve the problems I encountered with GridBagLayout resizing but to no avail. The problems are: