0

I have a directory I want to remove in /opt/

[user /] $ sudo su
[root /] # cd /opt
[root opt] # rm -rf tomcat9
[root opt] # ls
[root opt] # ls
tomcat9

But i still cannot seem to remove the tomcat9 directory. There are still nested directories inside tomcat9 (/opt/tomcat9/openam/openam/debug/SystemCore) but rm -rf tomcat9 as root should remove it.

There are no errors when i remove. It did actually remove but after a few seconds, tomcat9 directory reappeared again. Why is that?

2
  • 3
    Someone or something recreated it. Sep 22, 2020 at 11:21
  • I managed to fix it. Thanks for your help!
    – Noose780
    Sep 22, 2020 at 11:57

2 Answers 2

1

Welcome to Server Fault.

As @Michael said, the directory cannot re-appear magically. Someone maybe recreated it, or you didn't wrote down the command correctly... it's difficult to say what happened, but no magic here.

2
  • 1
    I managed to fix it! I checked the users which i added earlier and killed the process and deleted the user which was recreating the file. After that rm -rf tomcat9 worked beautifully.
    – Noose780
    Sep 22, 2020 at 11:56
  • Haha, glad you found out :) Have a nice day
    – LeRouteur
    Sep 22, 2020 at 13:13
0

Shutdown the tomcat server. This recreates the directory you've removed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .