Find the answer to your Linux question:
Results 1 to 8 of 8
Dear Experts, I own a directory, the directory permission is 000. d--------- 2 pawan pawan 4096 Jun 1 19:16 dd Can I delete this directory without changing the access permissions ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2006
    Posts
    40

    How to delete a directory with 000 permission ?? Any idea ?


    Dear Experts,

    I own a directory, the directory permission is 000.

    d--------- 2 pawan pawan 4096 Jun 1 19:16 dd

    Can I delete this directory without changing the access permissions ?

    I think, If a file has permission like 000, you can delete that file, but its not working for a directory. Is it possible to delete a directory with 000 permission ?


    Thanks-
    Pawan

  2. #2
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    x_x, Thats a strange question.
    But you can delete file/folders even if they are having 000 permissions.

    In Linux directory is also a file..Deleting file = Editing the directory

    So if you want permission to delete files, the parent directory should have the execute and write permission.
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  3. #3
    Linux User saivin's Avatar
    Join Date
    Dec 2008
    Location
    Bengaluru, India
    Posts
    305
    Quote Originally Posted by Pawan Sangal View Post
    Dear Experts,

    I own a directory, the directory permission is 000.

    d--------- 2 pawan pawan 4096 Jun 1 19:16 dd

    Can I delete this directory without changing the access permissions ?
    Pawan, don't you think you should try deleting it, instead of asking here?
    A candle looses nothing by lighting other candles. - Khalil Zibran.
    Registered Linux User #490076

  4. #4
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    Quote Originally Posted by saivin View Post
    Pawan, don't you think you should try deleting it, instead of asking here?
    X_X lol, its true
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  5. #5
    Just Joined!
    Join Date
    Jun 2006
    Posts
    40
    Quote Originally Posted by saivin View Post
    Pawan, don't you think you should try deleting it, instead of asking here?
    Thanks..Saivin and b2Bwild...

    Thanks for your valuable suggestions....I posted here, only after trying at my end.

    Per b2Bwild, I found that true, if a file has a permission 000, but inside a parent directory having the read write permissions, you can delete that 000 permission file (assumed that you're the logged in user).

    But, if a parent directory has a permission 000, you can't delete either the file nor the directory, even if you're the logged in user (may be root can do that, don't know ?)

    My intension was to get an expert opinion on this, so that my confusion gets off, and the reality comes into my silly mind

    Thanks-
    Pawan

  6. #6
    Linux User saivin's Avatar
    Join Date
    Dec 2008
    Location
    Bengaluru, India
    Posts
    305
    Oh thank god you took my comment in good spirit... It was not to insult anyway.
    (may be root can do that, don't know ?)
    Yes, root can delete directories (and files) with 000 permissions. I tried with dummy directories and files just now. If you are the owner of the file/directory, you can delete it even if the permission is 000. If you are not the owner of the file/directory, then root can play terminator.
    A candle looses nothing by lighting other candles. - Khalil Zibran.
    Registered Linux User #490076

  7. #7
    Just Joined!
    Join Date
    Jun 2006
    Posts
    40
    Quote Originally Posted by saivin View Post
    Oh thank god you took my comment in good spirit... It was not to insult anyway.
    Yes, root can delete directories (and files) with 000 permissions. I tried with dummy directories and files just now. If you are the owner of the file/directory, you can delete it even if the permission is 000. If you are not the owner of the file/directory, then root can play terminator.
    I simply respect those who give their valuable time in reading my problems and share some very good ideas towards problem resolution.

    Thanks once again Saivin.

    Regards-
    Pawan

  8. #8
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108

    Smile

    Quote Originally Posted by saivin View Post
    Yes, root can delete directories (and files) with 000 permissions. I tried with dummy directories and files just now. If you are the owner of the file/directory, you can delete it even if the permission is 000. If you are not the owner of the file/directory, then root can play terminator.
    It can be said like this
    "Permissions are not applied for 'root' user"
    So whoever the owner of the file with whatever permissions.

    This is the main reason you should not use 'root' by default.
    That's why I like SELinux
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •