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 am attempting to erase a directory called apps. When I run rm-rf apps it looks like it erases it for the moment. When I log back on to the server the directory is still there, though it is highlighted in green.

drwxrwxrwx 3 user user 4096 2010-04-24 18:33 apps
share|improve this question

migrated from stackoverflow.com Apr 24 '10 at 22:49

This question came from our site for professional and enthusiast programmers.

3  
Most likely something else is recreating it. –  bmargulies Apr 24 '10 at 22:42

6 Answers 6

Could there be a process that is creating that directory for you?

share|improve this answer

Is the directory empty? If it so, you could try with rmdir: if again it fails, you could try to contact the server admin.

share|improve this answer
3  
I love 'please contact your system administrator' messages I AM THE F*ing administrator. –  xenoterracide Apr 25 '10 at 1:11
    
ahahah, sorry about that! –  dag729 Apr 25 '10 at 11:49

What system are you running? Does your system support the immutable or undeletable flags? If it's supported, and set, you'll get this exact result.

On my system, chflags noschg nouchg will remove the system and user immutable flags; and chflags nosunlnk nouunlnk removes the system and user undeletable flags. The commands on other systems may be different.

share|improve this answer

first Check the created/modified time for the directory using 'ls -l' ( or you can use stat <dir>) and remove the directory 'rm -rf dir' and again check the times. If there is any changes in time, there is some other process creating it. If so check for any running process using 'ps -ef' which may creating this directory again.

share|improve this answer

It may have been the remnant of a git repository that kept regenerating itself. I restarted the linode (my VPS) and it seems to have resolved itself.

share|improve this answer
    
This sort of thing should probably be left as a comment, not an answer. –  David Z Apr 25 '10 at 1:03
    
@david: if this is what solved his problem it should be posted as an answer. @chief: if you register your Stack Overflow and Super User accounts and associate them together you'll regain ownership of this question. –  quack quixote Apr 25 '10 at 7:02
    
@quack: well... it doesn't really answer the question, just says that the problem went away. –  David Z Apr 25 '10 at 17:44

The critical permissions are on the directory containing apps. Suppose it is in /spare/apps, but you do not have write permission in the /spare directory, then the 'rm' command will remove everything it can, but it is unable to do the final step because removing /spare/apps involves writing to /spare, and (under my hypothesis) you do not have permission to write there.

share|improve this answer

Your Answer

 
discard

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