Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Consider this example. I download a tar.gz file from the internet and open the contents of that file into a directory. Let's say I choose to remove the directory. Unfortunately, I do not have permission to delete the directory. What do I do? I get an error message that I don't have permission to remove this directory.

~$ cd /home/amathew
~$ sudo tar xzf hadoop-0.20.2.tar.gz
~$ sudo mv hadoop-0.20.2 hadoop
~$ sudo chown -R hadoop:hadoop hadoop

Thanks in advance.


~$ lsattr -RVadlv hadoop
lsattr 1.41.12 (17-May-2010)
2903294105 hadoop                       Extents
share|improve this question
up vote 1 down vote accepted

You should also modify permissions to that file by:

sudo chmod 777 FOLDERNAME -R

This way the file will be editable/deletable by anyone (which -of course- includes you).

After that, try to delete and succeed.

Good luck!


FOLDERNAME = change this for the folder name of your choice.

Just for the record: If the user has already changed the ownership of the folder, he can now run this with no hassle. Thank you!

share|improve this answer

According to the commands you cite, you changed the ownership to user "hadoop" before you tried to delete it. Since user "amathew" no longer owns the directory, he does not have permission to delete it (unless there's a group relationship that's not specified here).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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