LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Removing a funny file (https://www.linuxquestions.org/questions/linux-newbie-8/removing-a-funny-file-936725/)

leebrent 03-27-2012 12:35 PM

Removing a funny file
 
Alright,

This file named is a file I cannot seem to rename or move...

?<?????>??×??B??áŠ<????d=?????jm???z?N??T?G?9???!sd!y?7o??-yJU?????_|????????9???Z?Z??{?>@?

Any suggestions? Tried:

rm ./?<?????>??×??B??áŠ<????d=?????jm???z?N??T?G?9???!sd!y?7o??-yJU?????_|????????9???Z?Z??{?>@?

repo 03-27-2012 12:41 PM

You don't need the
Code:

./
try to use the bash completion function
Code:

rm ? <TAB>
Kind regards

yancek 03-27-2012 12:41 PM

Where is the file, in which directory?
What are the permissions on the file?
Who is the owner of the file?
Exactly how did you try to rename/move it?

AnanthaP 03-27-2012 12:45 PM

Quote:

rm -i *B*jm*
and be sure to delete just the required file when it comes up.

jefro 03-27-2012 02:56 PM

I'd begin to wonder why a file like that exists. Some file structure issue or partition overlapping??

I'd check the file structure and maybe test the partitions to be sure they are correct.

Boot to a live cd and remove the file would be last but I'd make a backup of any important data before you did it.

chrism01 03-27-2012 06:16 PM

I'm with jefro; very good advice.

A technique I've used for really recalcitrant files is to move all required files out of that dir, then cd one level up and
Code:

rm -rf thatdir
then re-create dir & put files back

unSpawn 03-27-2012 06:33 PM

Also you can list files by inode (\'ls -il') and use 'find . -inum [INODE_NR] -exec rm -i {} \;' to remove it.

David the H. 03-28-2012 07:11 AM

I concur with the above. There are two possibilities that I can see.


1) There has been some kind of file system corruption, resulting in a file with a garbage name (it may not even be a real file, but just some kind of ghost data structure). So the FS should be scanned for errors first, before doing anything else. If this is coming from a network share, the file should be checked on the source machine, just in case the problem is due to the share connection.

2) Somehow a file was accidentally created or renamed with a funky name. This is easier to handle, as all you need to do is correctly use quoting, globbing, tab completion, or the inode to remove/rename it, according to the advice given above.


It would be nice if the OP could post any details he has on how the file was created, what file system it's sitting on, what ls -il shows for that file when run on its directory, and any other possibly-relevant information.

leebrent 03-28-2012 09:30 AM

Thanks Folks
 
So many options with posted! I was able to remove the file and I think in the past, some directory corruption occurred, but it appears I could remove the file with no impact.

Cheers,

Brent.


All times are GMT -5. The time now is 05:03 AM.