LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to delete a file with this syntax: index.php\n (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-delete-a-file-with-this-syntax-index-php%5Cn-767500/)

Procher 11-07-2009 05:06 AM

How to delete a file with this syntax: index.php\n
 
Hello,

I have a big problem, in several folders, I have 2 files:

index.php
index.php\n


The first is correct but not second.


Which is the command to delete the second file called: index.php\n

I do not to find...

Please help me.

Pascal

vinaytp 11-07-2009 05:18 AM

Welcome to LQ procher....

Quote:

Originally Posted by Procher (Post 3748046)
Which is the command to delete the second file called: index.php\n

Hope you can try the following
Code:

rm 'index.php\n'
Cheers!!!

Procher 11-07-2009 07:07 AM

Hello,

No, here message when: rm 'index.php\n'

rm: cannot lstat `index.php\\n': No such file or directory


Are-you another suggestion?

Pascal

tredegar 11-07-2009 12:58 PM

Maybe rm -i index.ph*

It will ask (Remove file _______ Yes / No ? ) before removing each file that starts with index.ph

r3sistance 11-07-2009 01:24 PM

Quote:

Originally Posted by Procher (Post 3748122)
Hello,

No, here message when: rm 'index.php\n'

rm: cannot lstat `index.php\\n': No such file or directory


Are-you another suggestion?

Pascal

Don't use escape characters in file names, really isn't a good idea. I think the method above should work tho.


All times are GMT -5. The time now is 05:31 PM.