How do I delete a directory when the file manager says I do not have permission to? I created the directory on my local machine, I am the admin (and sole user) of this machine Yet if I right click to view properties it says "you are not the owner so you can not change the permissions" Owner is listed as "root" and group is listed as "staff"
-
4Possible duplicate of How do I get permissions to edit system configuration files? – muru Oct 01 '15 at 07:18
-
It almost always is not a good idea to delete directories created and owned by root. We may exceptionally do so in case we had accidentally created them while working with root permissions. Also I would not recommend you run Nautilus as root unitl you get a bit more experienced. – Takkat Oct 01 '15 at 11:26
2 Answers
As with any tool in linux, you can launch it by proceeding the applications name with sudo.
$ sudo nautilus
This will grant the application super user rights during that windows usage.
You should probably add yourself to "staff," instead. You won't be giving an application with read/write capabilities control at that level for a simple permissions issue. There are exploits that will take advantage of this

- 1,028
- 2
- 9
- 21
In ubuntu (and Linux in general) even though you are the admin of the machine, you do not get the super user permissions. This is a security feature, because that way programs that run do not have permissions to change your system or install other (malicious) programs. You can request these permissions in the terminal by using sudo. If you type sudo and than the command you want to perform this command has super user permissions and if you run a program with sudo it gets these permissions as well. You need to be carefull with running programs with sudo, these programs could misuse these permissions.
you can delete the directory without running nautilus as root as suggested by Miphix. Now you use the therminal. first go to the folder that contains the folder you want to remove: cd /[path to folder]
. Now if you run ls
to see the content of this folder, it should include the folder you want to remove. now run sudo rm -rf [foldername]
to remove it.
rm -rf
is not without danger, if you where to run sudo rm -rf /
you would delete your whole file system. Do not try this at home ^^.

- 713