LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't delete file (https://www.linuxquestions.org/questions/linux-newbie-8/cant-delete-file-922601/)

decenter 01-07-2012 11:38 AM

Can't delete file
 
Hi,

Today a new problem. There is a folder and two files displayed in my debian 6 server. When ever I try to delete it, it wont.It will say "No such file or directory). But it displays the folder and files. I used rm -rf command. I'm with full root permission. How to delete those?

Thanks

corp769 01-07-2012 12:34 PM

Hello,

Could you show us the full directory path, along with a detailed list view of the contents? (ls -al)

Cheers,

Josh

John VV 01-07-2012 07:00 PM

you might want to use the "rmdir" command .

and have a read through some terminal tutorials
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html

decenter 01-08-2012 12:00 AM

Quote:

Originally Posted by corp769 (Post 4568903)
Hello,

Could you show us the full directory path, along with a detailed list view of the contents? (ls -al)

Cheers,

Josh

Quote:

drwxrwx--- 2 jessi jessi 4096 Jan 6 11:14 flat\rent_it\
-rw-rw---- 1 jessi jessi 0 Jan 6 11:14 flat\rent_it\details.txt
-rw-rw---- 1 jessi jessi 272 Jan 6 11:14 flat\rent_it\details.txt
Even when I try to delete the files via FTP, it said there is no such file, but it is displaying. This is so weird.

Thanks

corp769 01-08-2012 05:09 AM

Is that the actual output of ls -al?

decenter 01-08-2012 06:26 AM

Quote:

Originally Posted by corp769 (Post 4569339)
Is that the actual output of ls -al?



Yes. That's weird. These files are displaying , but not in filesystem. (It is there, but not there).

corp769 01-08-2012 06:38 AM

Try the following:
Code:

file details.txt
Also try seeing if you can open the file with vim or such editor. If the file command gives you any output, you know that the file is really there. This is weird indeed.

decenter 01-08-2012 06:57 AM

Quote:

Originally Posted by corp769 (Post 4569375)
Try the following:
Code:

file details.txt
Also try seeing if you can open the file with vim or such editor. If the file command gives you any output, you know that the file is really there. This is weird indeed.

Solved. Finally deleted it. I have to use
Code:

rm flat\\rent_it\\details.txt
.Instead I was using
Code:

rm flat\rent_it\details.txt
. Thanks for helping a lot and sorry for kinda confusing you.

EricTRA 01-08-2012 07:03 AM

Hi,

Glad you've got is solved. On a side note, have a look at Bash special characters on how to escape them. This happens when you use a special character like a '\' or others in a filename. I'm sure Josh is still a bit sleepy since he didn't notice it earlier.

Kind regards,

Eric

corp769 01-08-2012 07:05 AM

I thought that looked different. And yes Eric, I am a bit out of it. At first, I thought "He needs to escape the backslash" but didn't think to mention it. Due for my medications.....

Cheers,

Josh


All times are GMT -5. The time now is 02:14 AM.