Undeletable Directory

Discussion in 'Mac Basics and Help' started by Dark Lain, Jul 14, 2006.

  1. Dark Lain macrumors member

    Dark Lain

    Joined:
    Apr 29, 2005
    #1
    It's me again. This time instead of undeleatable files I am having a problem with undeleatable directories.

    No it is not a system directory. I, in the past month changed user accounts on my Mac and previously locked files and folder became unmovable and undeletable and immune to changing permissions even from the command line. They can be copied, opened, and executed; and the copied versions can have their permissions changed.

    Yes I am running as Administrator

    I try

    sudo rmdir directoryname

    and I get

    rmdir: directoryname: Operation not permitted


    Thanks again for any advice!
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Is the directory empty? You can't rmdir a directory with contents (including files whos filename starts with . (. and .. excluded).

    Try (very very very carefully):
    Code:
    sudo rm -rf directoryname
    
    Only do this when you have backed up and checked twice as rm -rf is very destructive if you get the wrong path...
     
  3. Dark Lain thread starter macrumors member

    Dark Lain

    Joined:
    Apr 29, 2005
    #3
    No the directories are not empty.

    What is -rf
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    These are options for the rm command. You can find out about the options a command takes by using man:

    Code:
    man rm
    
    In this case -r specified Recursive, so traverse subdirectories as well and -f is Force to make rm just do it without warning us. This can be shortened to -rf.
     

Share This Page