Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Similar to rm on cygwin, cannot unlink not owner, but for MINGW32. I tried chmod u+w path but this did not help.

user@computer /d
$ rm dir -d
rm: cannot unlink `dir': Not owner

user@computer /d
$ chmod u+w dir

user@computer /d
$ rm dir -d
rm: cannot unlink `dir': Not owner
share|improve this question

super-user (root) is the only account able to use rm -d flag

From the rm man page

-d, --directory

      unlink FILE, even if it is  a  non-empty  directory  (super-user
      only; this works only if your system supports ‘unlink’ for 
          nonempty directories)

I don't think mingw supports su root or anything like it so using rm -d is unavailable.

Have you tried rm -rf /full/path/to/dir or (if empty) rmdir /full/path/to/dir ?

share|improve this answer
@tnorthcutt mingw does not support changes through chmod. The developers expect you to maintain permissions via Windows – Jeremy W Jun 13 '12 at 17:33

I don't know mingw but on "real" *nix systems you need write access to the parent dir. You don't specify the permissions of "dir" or it's parent directory but I assume that is the problem here as well.

share|improve this answer
For me, the permissions of the parent directory are drwxr-xr-x. I tried chmod 775 on the parent directory (which should result in drwxrwxr-x), but running ls -l again shows that the permissions did not change. If I run the chmod with the verbose flag, it claims that permissions were changed, but again, running ls -l shows that they were not. – tnorthcutt Jun 7 '12 at 15:53
FYI On my machine I have full permissions in Windows for this folder. – csauve Jun 7 '12 at 18:40

From the looks of it, it seems like you're trying to 'rm' a directory ("dir"). "rmdir" would rather do the trick.

Otherwise, other things that come to mind:

  1. Can you remove the file from windows explorer or a dos prompt? If yes, then it could be a mingw bug.
  2. If the file is marked as "read-only" then you can't rm it.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.