You are not logged in.

#1 2010-04-26 04:26:09

Turgon
Member
Registered: 2009-01-14
Posts: 19

Cannot remove file or folder with root

Hey! i have one problem. I download one rar file, named in russian language. I did unrar, but "unrar" was unsuccesfull. now i my home folder
there is a strange folder with name:߻ӿ. i cannot remove, move or copy it (not by user, not by root). i cannot also view contents of this folder,
and cannot view properties of this folder. Here is output:

[root@mighty ir]# ls
??ӿ?  AUDIO BOOKS  Desktop  Documents  Downloads  Music  Pictures  Study
[root@mighty ir]# rm -r ??ӿ?
rm: cannot remove `??ӿ?': No such file or directory
[root@mighty ir]#

What can i do?
Thank you for help!


My life is my message.

Offline

#2 2010-04-26 04:32:13

n0dix
Member
Registered: 2009-09-22
Posts: 956

Re: Cannot remove file or folder with root

First list bad file with inode e.g.

$ ls –il
Output

14071947 -rw-r--r-- 1 <username> dba 0 2010-01-27 15:49 \-®Å

Note: 14071947 is inode number.

Now Use find command to delete file by inode:
$ find . -inum 14071947 -exec rm -f {} \;
It will find that bad file and will remove it with force i.e remove without prompt.

Last edited by n0dix (2010-04-26 04:34:26)

Offline

#3 2010-04-26 04:32:31

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Cannot remove file or folder with root

wrap it in single quotes. Bash is interpreting the ? as a wildcard to match any single character.

Offline

#4 2010-04-26 15:38:30

Turgon
Member
Registered: 2009-01-14
Posts: 19

Re: Cannot remove file or folder with root

Thank to both of you for replies! I did as n0dix said and this help me.. I tried also to wrap it in a single quotes, but this doesn't help me..


My life is my message.

Offline

#5 2010-04-26 20:06:40

holstein
Member
From: /home
Registered: 2009-02-19
Posts: 13

Re: Cannot remove file or folder with root

This kind of problem often happened to me when I created or deleted a large amount of files on my USB-stick. Then the stick ejected and creating or deleting files wasn't finish, so there where files with stranges names, and stranges creation time (between 1930 up to 2050).

What I did is a fsck

fsck.vfat -rw /dev/sdXY

where vfat is the type of filesystem and XY the partition.

I think your problem is solved, but I wanted to add the other method.

Offline

#6 2010-04-26 21:08:21

n0dix
Member
Registered: 2009-09-22
Posts: 956

Re: Cannot remove file or folder with root

Turgon wrote:

Thank to both of you for replies! I did as n0dix said and this help me.. I tried also to wrap it in a single quotes, but this doesn't help me..

i'm glad it helps you, can you mark the thread as Solved, please.

Offline

Board footer

Powered by FluxBB