0
[EDIT] Please don't waste your time reading my question below. It turns out my colleague is an idiot.. :)
On my server I'm trying to remove a folder and all its subfolders with the usual rm -rf dirname
, but it silently fails:
kramer65@vps1:~$ ls -l
total 24
drwxrwxr-x 2 kramer65 kramer65 4096 Jul 11 22:00 backups
drwxrwxr-x 2 kramer65 kramer65 4096 Jul 17 17:37 bin
drwxrwxr-x 3 kramer65 kramer65 4096 Sep 1 11:11 cxs
kramer65@vps1:~$ rm -rf cxs/
kramer65@vps1:~$ ls
backups bin cxs
kramer65@vps1:~$ sudo rm -rf cxs/
kramer65@vps1:~$ ls
backups bin cxs
kramer65@vps1:~$ rmdir cxs/
rmdir: failed to remove ‘cxs/’: Directory not empty
I also tried removing all contents of the dir:
kramer65@vps1:~$ cd cxs
kramer65@vps1:~/cxs$ ls
app README.md
kramer65@vps1:~/cxs$ rm -rf *
kramer65@vps1:~/cxs$ ls
app README.md
kramer65@vps1:~/cxs$ sudo rm -rf *
kramer65@vps1:~/cxs$ ls
app README.md
I'm okay with failing commands, if only it would tell me whats wrong. Any idea what I'm doing wrong here? All tips are welcome!
[EDIT] I tried the following (also to no avail):
kramer65@vps1:~$ sudo rm -vrf cxs/*
removed ‘cxs/app/static/img/face1.jpg’
removed ‘cxs/app/static/img/face2.jpg’
removed ‘cxs/app/static/img/face3.jpg’
[etc.etc.]
removed directory: ‘cxs/app’
removed ‘cxs/README.md’
kramer65@vps1:~$ ls cxs/
app README.md
kramer65@vps1:~$
[EDIT2] Turns out a colleague had an rsync running which constantly re-wrote the files to that folder. So it did remove them, but it automatically re-created them again as well. (I'm banging my head against the wall here!)
Have you tried going back a directory and running sudo rm -rf /cxc/* – Matthew Williams – 2014-09-01T09:27:02.323
@MatthewWilliams - Just tried that, to no avail.. :S – kramer65 – 2014-09-01T09:28:52.517
Try running sudo rm -vf /cxc/* and see what it dumps out – Matthew Williams – 2014-09-01T09:30:12.497
@MatthewWilliams - I ran it, checkout my updated question. – kramer65 – 2014-09-01T09:35:29.790
At least you know your rsync is working correctly ;) – Matthew Williams – 2014-09-01T09:50:15.157