Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > deleting the file from hell...

deleting the file from hell...
Thread Tools
fisherKing
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 20, 2003, 09:57 PM
 
this:

help!

the top image is from resedit (i tried to delete this in os9. no luck.)

the bottom image is the full file name in 10.2.8.

tried the terminal, got this:

rm: illegal option -- /
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file


any ideas? (outside of shooting it, which i've considered)
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
gorickey
Posting Junkie
Join Date: Nov 2001
Location: Retired.
Status: Offline
Reply With Quote
Oct 20, 2003, 10:01 PM
 
Can you delete the file in root?
     
fisherKing  (op)
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 20, 2003, 10:10 PM
 
Originally posted by gorickey:
Can you delete the file in root?


which i do...how?
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
C.J. Moof
Mac Elite
Join Date: Aug 2001
Location: Madison, WI
Status: Offline
Reply With Quote
Oct 20, 2003, 10:11 PM
 
What if you rm "filename here" with the quotes around it? Dunno for sure, just making this up based on how I've dealt with other funky paths in the past.
OS X: Where software installation doesn't require wizards with shields.
     
jokell82
Professional Poster
Join Date: May 2001
Location: Hampton Roads, VA
Status: Offline
Reply With Quote
Oct 20, 2003, 10:11 PM
 
try this:

sudo rm -rf <file name>

All glory to the hypnotoad.
     
fisherKing  (op)
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 20, 2003, 10:15 PM
 
Originally posted by jokell82:
try this:

sudo rm -rf <file name>
oh i've tried it (see the message i got in the terminal, in my orig post)

in os9, got the message "file does not exist"


can't kill this sucker!!
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
wreks
Forum Regular
Join Date: Nov 2002
Location: Bay Area
Status: Offline
Reply With Quote
Oct 20, 2003, 10:23 PM
 
Can you rename it? try renaming it then rm it. Llike rename bush then rm -R bush
     
fisherKing  (op)
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 20, 2003, 10:27 PM
 
Originally posted by wreks:
Can you rename it? try renaming it then rm it. Llike rename bush then rm -R bush
i get an "unexpected error -43" when i try to rename it

and an "error code 2" when i try to change permissions



???????
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
gorickey
Posting Junkie
Join Date: Nov 2001
Location: Retired.
Status: Offline
Reply With Quote
Oct 20, 2003, 10:42 PM
 
Originally posted by fisherKing:
which i do...how?
http://macos.about.com/library/weekly/aa091102a.htm

You need to enable the root account first and then login as root once the account is created....
     
romeosc
Mac Elite
Join Date: Oct 2000
Location: Memphis, Tn. USA
Status: Offline
Reply With Quote
Oct 20, 2003, 10:50 PM
 
The easiest way to delete tough files is to use Stuffit

Stuff file with setting to delete original after stuffing then throw away archive!


Works Great!
     
fisherKing  (op)
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 20, 2003, 10:56 PM
 
Originally posted by romeosc:
The easiest way to delete tough files is to use Stuffit

Stuff file with setting to delete original after stuffing then throw away archive!


Works Great!

stuffit's message: "file not found"


!!!!!
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
fisherKing  (op)
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 20, 2003, 11:04 PM
 
Originally posted by gorickey:
http://macos.about.com/library/weekly/aa091102a.htm

You need to enable the root account first and then login as root once the account is created....

no luck.
i keep seeing "unlink" in the terminal message;
could this file be connected to something important? (or not important?)

file is on my firewire drive, btw...
maybe dropping the drive from my 5th floor window will help...
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
gorickey
Posting Junkie
Join Date: Nov 2001
Location: Retired.
Status: Offline
Reply With Quote
Oct 20, 2003, 11:06 PM
 
Originally posted by fisherKing:
no luck.
i keep seeing "unlink" in the terminal message;
could this file be connected to something important? (or not important?)

file is on my firewire drive, btw...
maybe dropping the drive from my 5th floor window will help...
Instead of using the Terminal...login into root and try deleting the file via the GUI...

What exactly does the file/folder have current permissions of?
     
fisherKing  (op)
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 20, 2003, 11:13 PM
 
Originally posted by gorickey:
Instead of using the Terminal...login into root and try deleting the file via the GUI...

What exactly does the file/folder have current permissions of?

system. i can unlock it, but not change it (see error message above)

if i drag the file to the trash, it tells me "required item can not be found"

this folder does not seem to exist. so what am i looking at??

(insert more-confused-than-ever smilie)
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
snerdini
Senior User
Join Date: Jun 2001
Location: Merry Land
Status: Offline
Reply With Quote
Oct 20, 2003, 11:56 PM
 
Can you delete the surrounding folder with that file in it?
     
snerdini
Senior User
Join Date: Jun 2001
Location: Merry Land
Status: Offline
Reply With Quote
Oct 20, 2003, 11:59 PM
 
What I meant to say is if your file is somewhere like this:

~/Documents/Some Folder/FileWon'tDelete

Try:
rm -Rf ~/Documents/Some\ Folder

Does this work?

If it doesn't, you might want to think about DiskWarrior, just in case that file/folder is corrupted.
     
Sarc
Mac Elite
Join Date: Sep 2001
Location: Chile
Status: Offline
Reply With Quote
Oct 21, 2003, 12:25 AM
 
sounds like the filesystem is corrupted, showing you a file that's not there ... try repairing it in Disk Utility.
If that fails, boot into single user mode and do a fsck -y
:: frankenstein / lcd-less TiBook / 1GHz / radeon 9000 64MB / 1GB RAM / w/ext. 250GB fw drive / noname usb bluetooth dongle / d-link usb 2.0 pcmcia card / X.5.8
:: unibody macbook pro / 2.4 Ghz C2D / 6GB RAM / dell 2407wfp - X.6.3
     
Cipher13
Registered User
Join Date: Apr 2000
Status: Offline
Reply With Quote
Oct 21, 2003, 12:29 AM
 
ls -F

What kind of file is it? Is it a link of some sort?

rm -f /Path/to/file_na <tab>

Use tab-autocomplete to complete the path to the file. If it's a funky name, it'll take care of it in a way that it knows how to.
     
fisherKing  (op)
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 21, 2003, 01:09 AM
 
tried all of the above.

ran disk warrior, spotted it, but...
it is still there.
cannot be deleted.

seems to be a system file, perhaps with a corrupted (!) name; so...maybe essential??

i am tucking it away where i won't see it & calling it a day.

strange stuff!

anyway
thanx all,
c u at 10.3

(where this file will remain, as it is on my firewire drive, not my hd)

oh well, bedtime
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
placebo1969
Grizzled Veteran
Join Date: Jan 2001
Location: Washington (the state) USA
Status: Offline
Reply With Quote
Oct 21, 2003, 01:34 AM
 
Can you put the file within a couple of folders and try to trash the folder?
     
machem
Forum Regular
Join Date: Sep 2003
Location: Great Central Valley
Status: Offline
Reply With Quote
Oct 21, 2003, 01:40 AM
 
can you use a wildcard, and delete only that file?

(in that directory)
> rm -i *

then type 'y' for that weird file?

Sorry if that has been mentioned before.
1.25GHz 1024M SD 15" AlBook
     
fisherKing  (op)
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 21, 2003, 02:03 AM
 
Originally posted by Karl Snyder:
Can you put the file within a couple of folders and try to trash the folder?

in fact, i can ONLY move this around in the folder it is in (now named "kill me"); if i try to move it, i am told it doesnt exist..
!!

will torture it more tomorrow



thanx all!
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
scoot
Junior Member
Join Date: Oct 2003
Status: Offline
Reply With Quote
Oct 21, 2003, 02:13 AM
 
You almost had it. You tried it in terminal, and got the "illegal option" error message. That occurs when you don't put a space before the filename.

[bleargh:~]% rm -rf/Users/scott/filefromhell
rm: illegal option -- /
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file


[bleargh:~]% rm -rf /Users/scott/filefromhell
[bleargh:~]% ls filefromhell
ls: filefromhell: No such file or directory
[bleargh:~]%


Try a space after the rm -rf .
For that matter, you can probably leave off the '-rf' if its just a file. Use "rm ", with the space, then the filename.
     
SSharon
Professional Poster
Join Date: Jan 2003
Location: Teaneck, NJ
Status: Offline
Reply With Quote
Oct 21, 2003, 02:43 AM
 
until a few days ago I would have told you what romeosc told you with the stuffit (I've posted that fix many times here) but the last time I suggested it for a similar problem I was pointed to an app called cocktail and although I haven't used it apparently it can delete anything so give that a shot.

good luck
     
geekwagon
Senior User
Join Date: Dec 2002
Location: Portland, OR
Status: Offline
Reply With Quote
Oct 21, 2003, 03:39 AM
 
Just a tip, that I haven't seen mentioned in this thread yet..

When a filename contains odd characters or spaces that the command is misinterpreting, you can "escape" by prefixing them with a \ character.. for instance:

rm -rf this\ file\ contains\ spaces.\[.asd

Also, when you are using the rm command in the terminal, it has a little known yet highly useful option of "--" which allows you to delete a filename that starts with a "-" sign (otherwise rm will try to use the filename as a parameter, yes even with a glob like *) these kind of files get made quite often when people screw up a piping operation. A command line option to some command accidently is misplaced and ends up getting made into a file.
     
voodoo
Posting Junkie
Join Date: Mar 2001
Location: Salamanca, España
Status: Offline
Reply With Quote
Oct 21, 2003, 07:22 AM
 
Once I had this problem and I managed to fix it by throwing the folder that contained the file in OS 9.

Else it is just to format the HD. This is a silli bug between Direct Connect and OS X. Hate it.
I could take Sean Connery in a fight... I could definitely take him.
     
Targon
Grizzled Veteran
Join Date: Aug 1999
Location: a void where there should be ecstasy
Status: Offline
Reply With Quote
Oct 21, 2003, 07:53 AM
 
hrm this is a difficult one.

try this

open text edit or simple text, it should create a new file, now save the file to the same location as the file u want to delete BUT save this new text file with the same file name as the file u that is givving u the shiots, when u hit 'Save' tell the OS to 'Replace' the file that has the same name. Now u should be able to delete this new text file an of course the other file is gone as well...

I'd prolly back up the contents of the disk then zero all the data with disk utility.
     
fisherKing  (op)
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 21, 2003, 08:45 AM
 
well...
i have tried as much of the above as i can figure out.
even textedit, and a saved file with the same name did not work (they were both in the parent folder, it didnt replace the problem folder)
cocktail "could not remove file"

interesting; when i click on the name of the file, it comes up as a "help" window, a yellowish rectangle...maybe this is a needed file, just misnamed somehow...

this is, again, on my firewire drive (which has about 50G of audio & other files)...so i will not be re-initializing it (as there is no backup system for my fw drive)

again...gonna hide it.

thanx all!
( Last edited by fisherKing; Oct 21, 2003 at 08:54 AM. )
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
riverfreak
Mac Enthusiast
Join Date: Aug 2001
Status: Offline
Reply With Quote
Oct 21, 2003, 10:30 AM
 
There is NO REASON to log on as root to do this and NO REASON to reformat your hard drive. Sheesh, those are some pretty heavy-handed solutions.

If you want to delete a file that contains "unusual" characters, try:

1) escaping the bizarre characters with '\'

% rm riverfreaks\ river\ odyssey.txt

2) Try de-aliasing your rm

% \rm filename.txt

3) If it starts with a dash, try

% rm -- -filename.txt

(the -- prevents the -filename.txt from being interpreted as an argument)

4) use rm in interactive mode with a wildcard (selecting "y" when your evil file comes up).

% rm -i *

This happens to me all the time, where I inadvertently programmatically create a file that starts with a dash. Aggravating.
     
Detrius
Professional Poster
Join Date: Apr 2001
Location: Asheville, NC
Status: Offline
Reply With Quote
Oct 21, 2003, 08:54 PM
 
It sounds like your directory is corrupt. Run Norton Disk Doctor (whatever the latest version is--not any of the older) or Disk Warrior 3 (booting from the CD).

I would HIGHLY recommend doing this. The only reason OS X would not allow you to move or delete a file is if it is locked in the Finder. Otherwise, you should be able to delete it, even if it IS a necessary file.

After fixing your directory, turn on file system journaling to prevent this kind of stuff from happening in the future:

sudo diskutil enableJournal /

(and any other mounted volumes)
ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
Targon
Grizzled Veteran
Join Date: Aug 1999
Location: a void where there should be ecstasy
Status: Offline
Reply With Quote
Oct 21, 2003, 10:27 PM
 
Originally posted by Detrius:
It sounds like your directory is corrupt. Run Norton Disk Doctor
I highly recommend NOT running Norton. Disk Warrior is by far the preferred tool.
     
israces
Mac Enthusiast
Join Date: Aug 2000
Location: Land of the Free
Status: Offline
Reply With Quote
Oct 22, 2003, 01:33 PM
 
Running Norton will fix his problem. It will mangle his system so bad that he will have to re-format all of his drives and then reinstall the OS. Works like a champ!

Backup your Backup
     
alex_wlu_82
Forum Regular
Join Date: Sep 2002
Location: Ottawa, ON
Status: Offline
Reply With Quote
Oct 22, 2003, 07:38 PM
 
Originally posted by wreks:
Can you rename it? try renaming it then rm it. Llike rename bush then rm -R bush
haha.. nice.. if only it were that easy.
     
fisherKing  (op)
Professional Poster
Join Date: Jan 2001
Location: brooklyn ny
Status: Offline
Reply With Quote
Oct 22, 2003, 07:42 PM
 
i have tried most of the above.
disk warrior found it, but...it is still there.

now i am worried that it IS linked to something, and that deleting it might cause a new set of problems.

so i've buried it (for now) deep in a set of folders on the fw drive.

will revisit it after panther (which should keep us all on toes with new conflicts & challenges)


...and i can hardly wait!
"At first, there was Nothing. Then Nothing inverted itself and became Something.
And that is what you all are: inverted Nothings...with potential" (Sun Ra)
     
Brass
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Oct 22, 2003, 08:23 PM
 
can you do a full listing of the directory containing the file and post the output here?

Ie, in Terminal enter:

ls -la directory-name

(where directory name is the full path to the directory containing the bad file).

I've had this problem once before, and when I did and ls -l, I noticed that the link count for that file was incorrect. If this is the case, then it is a minor corruption in the file system. It's a pity OS X can't handle it nicely.

Logging in in single user mode, then running "fsck -y" on the relevant file system would probably fix it, but you'd need to figure out how to identify that external HD's file system from single user mode. NOt sure how to do that in OS X.
     
lenox
Senior User
Join Date: Aug 2003
Location: united states empire
Status: Offline
Reply With Quote
Oct 23, 2003, 11:47 AM
 
Here's another trick that I always use for deleting strange files:

emacs /directory/containing/file/

emacs is a text editor by trade but it can also edit the actual directory containing the file. Just delete the line dealing with that crazy file...and bamm! It's gone.


Hope this helps.
     
entrox
Senior User
Join Date: Jan 2003
Location: Stuttgart, Germany
Status: Offline
Reply With Quote
Oct 23, 2003, 12:15 PM
 
You can delete files by their inode number. First, get the number by running `ls -i <filename>` and the device, on which the filesystem is mounted by running `mount` (the first column). Then run `clri <device> <inode-number>` and finally boot to single-user mode and start a fsck to clean up the mess you've just made. If this doesn't work (as root), something's really, really b0rken in your filesystem.
     
   
 
Forum Links
Forum 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 On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 02:01 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,