Force deleting a file.

Posted:
in Genius Bar edited January 2014
I have an IE file that I can't delete. Every time I try to delete it a message comes up saying that the document is being used in another task.



I have tried using the console, but to no avail, I'm using OSX.2.1 wit IE 5.2, does anyone know how to delete this file?



Thanks,

Matty.

Comments

  • Reply 1 of 13
    rodukroduk Posts: 706member
    As a last resort you could always try booting into OS9 and deleting it from there (are you sure it's a file you should be deleting?).
  • Reply 2 of 13
    defiantdefiant Posts: 4,876member
    hmm... you have to use that in terminal:



    [code] sudo find path/of/the/file -name nameofthefile -print0 | xargs -0 rm -rf </pre><hr></blockquote>



    copy and paste it into textedit, modify it to suit your needs, and off you go. It wants your password, because it is dangerous.



    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!



    VERY DANGEROUS !!!!

    Make sure you know what you are doing, and make sure you typed in the right path and the right name !!!! it can delete files you don't want if you type in the wrong things.



    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!



    also, can't you move it to the trash ?



    IF it is already in the Trash, use <a href="http://macchampion.com/arbysoft/"; target="_blank">BatChmod</a>'s "Force Emptying Trash" function.
  • Reply 3 of 13
    mattyjmattyj Posts: 898member
    Sadly enough I can't move it into the wastebasket, but thank you for your suggestions, I have found your input helpful.
  • Reply 4 of 13
    defiantdefiant Posts: 4,876member
    the reality is that I had the same happening to me some days ago. a corrupted .sit file couldn't be moved to the trash. I had to use the terminal (above).



    If you're not sure if you type in the right thing, just post it in here, I'm gonna check, and give you an O.K. ok?
  • Reply 5 of 13
    mattyjmattyj Posts: 898member
    Thanks Defiant, well it didn't work, and it asked for a password... Is that really as bad as some people say? Anyway, this is what I typed into the console:



    sudo find path/of/the/file -name and Roll -print0 | xargs -0 rm -rf



    The it came up with:



    path/of/the/file: Roll: unknown option



    "and Roll" is the files name.



    So, any pointers? <img src="confused.gif" border="0">
  • Reply 6 of 13
    defiantdefiant Posts: 4,876member
    yeah, you forgot the path of the file !



    [code] sudo find /users/flo/desktop/ -name "and Roll" -print0 | xargs -0 rm -rf</pre><hr></blockquote>



    and use quotes for files with a space between them. "file name"



    [ 11-04-2002: Message edited by: Defiant ]</p>
  • Reply 7 of 13
    mattyjmattyj Posts: 898member
    I tried it, but I got the error:



    No such file or directory



    What do I do?!??! This is really getting annoying now..



    P.S. Thanks for the persistent help.
  • Reply 8 of 13
    chychchych Posts: 860member
    or you could just type in, in terminal:



    sudo rm -f (space)



    And drag the undeletable file into terminal

    (The space is a spacebar, don't type in "(space)")

    Then hit enter...

    And then enter your admin password (though you shouldn't need sudo in the first place)



    Erm, why are you using IE in the first place?



    [ 11-04-2002: Message edited by: chych ]</p>
  • Reply 9 of 13
    mattyjmattyj Posts: 898member
    Ok this is what I did, but it still doesn't work:



    davidlindsay% sudo rm -f/Users/davidlindsay/Desktop/\\ and\\ Roll

    Password:

    rm: illegal option -- /

    usage: rm [-f | -i] [-dPRrvW] file ...

    unlink file





    Stiil doesn't work... "illegal option" WTF, I am the admin of this mac. Grrr
  • Reply 10 of 13
    defiantdefiant Posts: 4,876member
    [code] sudo find /users/davidlindsay/desktop/ -name "and Roll" -print0 | xargs -0 rm -rf

    </pre><hr></blockquote>



    use THIS !!



    that before was VERY dangerous. it almost deleted your whole desktop...
  • Reply 11 of 13
    chychchych Posts: 860member
    [quote]Originally posted by mattyj:

    <strong>Ok this is what I did, but it still doesn't work:



    davidlindsay% sudo rm -f/Users/davidlindsay/Desktop/\\ and\\ Roll

    Password:

    rm: illegal option -- /

    usage: rm [-f | -i] [-dPRrvW] file ...

    unlink file





    Stiil doesn't work... "illegal option" WTF, I am the admin of this mac. Grrr</strong><hr></blockquote>



    Gah, I told you to put a space after the -f



    should be:

    sudo rm -f /Users/davidlindsay/Desktop/\\ and\\ Roll



    Read!

    If it's a directory make it -rf instead of -f
  • Reply 12 of 13
    chychchych Posts: 860member
    And geez, it's not that dangerous, just make sure you don't put the -r in the paramters, then it won't delete folders...



    [ 11-04-2002: Message edited by: chych ]</p>
  • Reply 13 of 13
    mattyjmattyj Posts: 898member
    I'm sorry chych, and it works! Thanks very much, I appreciate the help a lot.



    [ 11-05-2002: Message edited by: mattyj ]</p>
Sign In or Register to comment.