LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-27-2012, 12:35 PM   #1
leebrent
Member
 
Registered: Oct 2007
Location: Nanaimo
Distribution: Red Hat 5
Posts: 39

Rep: Reputation: 15
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??{?>@?
 
Old 03-27-2012, 12:41 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
You don't need the
Code:
./
try to use the bash completion function
Code:
rm ? <TAB>
Kind regards
 
Old 03-27-2012, 12:41 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,271

Rep: Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379Reputation: 1379
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?
 
Old 03-27-2012, 12:45 PM   #4
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 837

Rep: Reputation: 201Reputation: 201Reputation: 201
Quote:
rm -i *B*jm*
and be sure to delete just the required file when it comes up.
 
Old 03-27-2012, 02:56 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,544

Rep: Reputation: 2428Reputation: 2428Reputation: 2428Reputation: 2428Reputation: 2428Reputation: 2428Reputation: 2428Reputation: 2428Reputation: 2428Reputation: 2428Reputation: 2428
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.
 
Old 03-27-2012, 06:16 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,372

Rep: Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382
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
 
Old 03-27-2012, 06:33 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Also you can list files by inode (\'ls -il') and use 'find . -inum [INODE_NR] -exec rm -i {} \;' to remove it.
 
Old 03-28-2012, 07:11 AM   #8
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959
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.
 
Old 03-28-2012, 09:30 AM   #9
leebrent
Member
 
Registered: Oct 2007
Location: Nanaimo
Distribution: Red Hat 5
Posts: 39

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] File Permissions - Funny story newholborn Linux - Server 2 09-27-2009 07:16 AM
LXer: Lawyer's Funny AntiLinux FUD Turns Out to be Not So Funny LXer Syndicated Linux News 0 08-11-2008 04:00 AM
removing a file (--exclude is the name of the file) Santinelli Linux - General 2 01-14-2004 09:03 AM


All times are GMT -5. The time now is 02:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration