Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to delete all files/dirs named .svn using rm on cgywin

drwxr-xr-x    6      4096 Oct 26 15:33 .svn

$ rm -d .svn
rm: cannot unlink `.svn': Not owner
share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

If you are the adminsitrator on your machine, ownership is a concept that shouldn't concern you much.

Do chmod u+w .svn, then try your remove again.

share|improve this answer
    
not sure that'll work on cygwin. may need cacls (if administrator) to get permissions on the file. –  quack quixote Oct 27 '09 at 5:18
    
@~quack. Thanks - You may be right - I think there is a dependency with the CYGWIN environment variable (cygwin.com/cygwin-ug-net/using-cygwinenv.html) I may have forgotten about. –  DaveParillo Oct 27 '09 at 22:56
    
The CYGWIN variable needs to include a setting for ntea (NT Extended Attributes). This should be done in the file cygnus.bat. Add the following line in the file: export CYGWIN=ntea –  DaveParillo Oct 27 '09 at 23:01
    
good find, but actually i think you want ntsec not ntea (same link, further down the page), to get real permissions instead of faked. more here: cygwin.com/cygwin-ug-net/ntsec.html ... –  quack quixote Oct 28 '09 at 4:53
    
Good catch. Thank's for keeping me honest! –  DaveParillo Oct 28 '09 at 15:10
add comment

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)

You will need to su root or something similar before using rm -d

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

share|improve this answer
add comment

Your Answer

 
discard

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.