1

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
1
  • 3
    Most likely something else is recreating it.
    – bmargulies
    Apr 24, 2010 at 22:42

6 Answers 6

2

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

1

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

2
  • 3
    I love 'please contact your system administrator' messages I AM THE F*ing administrator. Apr 25, 2010 at 1:11
  • ahahah, sorry about that!
    – dag729
    Apr 25, 2010 at 11:49
1

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.

1

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.

0

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.

3
  • This sort of thing should probably be left as a comment, not an answer.
    – David Z
    Apr 25, 2010 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. Apr 25, 2010 at 7:02
  • @quack: well... it doesn't really answer the question, just says that the problem went away.
    – David Z
    Apr 25, 2010 at 17:44
0

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.

You must log in to answer this question.