1

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?

Yuan Wen
  • 113
  • 1
  • 1
  • 5

2 Answers2

3

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.

hoe
  • 301
  • 1
  • 2
  • 6
1

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
Yaron
  • 4,229
  • 2
  • 20
  • 33