I want to delete directory 982899. It is located under directory big. When I first try to delete 982899, it shows many lines of messages like this:

rm: cannot remove `982899/.../...v': Permission denied

So I use chmod 777 . to make directory big be able to change everything.

However, after it, rm -rf 982899 still shows the same messages:

rm: cannot remove `982899/.../...v': Permission denied

I even executed chmod 777 982899, but nothing changed!

Why ? What should I do to delete directory 982899?


rm -rf 982899 will try to recursively remove anything inside that directory, and then, once it is empty, remove the directory itself. So your problem may be that you do not have permission to delete the items inside 982899. You can try to chmod -R 777 982899, or chown -R <your_user> 982899 to get around this. Be careful though that chxxx commands use an uppercase -R for recursive operation.


It is possible that the below message:

rm: cannot remove `982899/.../...v': Permission denied

was caused as the owner of the file is another user (e.g. root).

This can be solved by running as root by using sudo

sudo rm -rf 982899
  • I copied 982899 from other place to my directory. I'm not in the sudoers file, So I can't use sudo rm -rf 982899 . Is there another way? – Yuan Wen Apr 27 '17 at 6:46
  • what is the result of running ls -lsa 982899/.../...v ? – Yaron Apr 27 '17 at 6:48
  • If you can't use sudo, then you might be able to switch to root with su, then try rm -r 982899 again. If you have no root access, then you need to contact the administrator of the machine. – Mio Rin Apr 27 '17 at 6:49
  • hoe is right@Yaron I have remove the directory successfully. – Yuan Wen Apr 27 '17 at 6:52
  • @YuanWen great :) – Yaron Apr 27 '17 at 6:54

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.