0
-rw------- 1 sato_y sato_y   19 Aug 15  2018 _complete 
drwx------ 2 sato_y sato_y   68 Aug 15  2018 files
-rw------- 1 sato_y sato_y  673 Aug 15  2018 _invocation 

[sato_y@ircms-icals fork0]$ rm _complete  
rm: cannot remove ‘_complete’: Permission denied

I am having an error when trying to delete files in my directories in our storage server. As in the example above, when I tried to remove the file, I got a "permission denied" message. I checked and the file and the directory it is in belongs to me with write permission.

However, when I make a new directory and move the file into that said directory, I was able to delete it as I show below.

-rwx------ 1 sato_y sato_y   19 Aug 15  2018 _complete
drwx------ 2 sato_y sato_y   68 Aug 15  2018 files
-rw------- 1 sato_y sato_y  673 Aug 15  2018 _invocation

[sato_y@ircms-icals fork0]$ mkdir delete
[sato_y@ircms-icals fork0]$ mv _complete ./delete/
[sato_y@ircms-icals fork0]$ ll

total 448
drwx------ 3 sato_y sato_y  102 Mar  4  2019 delete
drwx------ 2 sato_y sato_y   68 Aug 15  2018 files
-rw------- 1 sato_y sato_y  673 Aug 15  2018 _invocation

[sato_y@ircms-icals fork0]$ rm -rf delete
[sato_y@ircms-icals fork0]$ ll
total 384
drwx------ 2 sato_y sato_y   68 Aug 15  2018 files
-rw------- 1 sato_y sato_y  673 Aug 15  2018 _invocation

Whenever I try to delete a directory, there will be some leftover files which I was unable to delete and I had to resort to this step (making new directory, transfer the said file into it and delete the new directory) to completely remove everything.

Does anyone faced a similar problem before?

  • This makes no sense. The mv effectively deletes the file from the current directory, just like rm would do. – Kusalananda Mar 4 at 8:51
  • @kingmilo But even if I delete the current directory containing these files with rm -rf, it still gives me a permission denied error. Only after I make a new directory and move the file into it, only I was able to delete it. I am forcing delete the directory because I don't need the files in it anymore. However, if you have any safer method to delete stuff, please inform me. – T.Ben Mar 4 at 9:11
  • Ahh apologies guys, I didn’t look closely enough and thought _complete was a directory, my bad, I’m on my phone. I’ll update comments once on laptop ;) – kingmilo Mar 4 at 9:14
  • @Kusalananda Yes, that's the thing! I have the permission to perform actions in the directory, but some files are stubborn in that they refused to be deleted. I need to perform as I mentioned here to be able to delete them. – T.Ben Mar 4 at 9:15
  • @T.Ben Is this a shared type folder? Could you show us the permissions of the directory you’re currently working in? – kingmilo Mar 4 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.