I am trying to create a file in "/" directory (which contains bin, boot , cdrom, dev, etc) but I am unable to do so. Although I am the one who install ubuntu and I am the root user? The error I get is of permission denied. When I used sudo it asks for password but I haven't set any password for it.

Also I cannot calculate the hash of a file in this directory.

I am sorry for my lame question as I just have switched to linux after using windows for long time.

  • Welcome to AskUbuntu. In all likelihood your user does not have permissions to write in that folder. Could you please post the output of the command ls -la / ? – Luís de Sousa Dec 27 '13 at 19:50

In Ubuntu most anything you do outside of your own home directory requires you to become a superuser, in other words to become Root, or to gain root privileges which are all the same.

Now with being root you will have a greater responsibility to keep your system in a stable state but also a very high risk to break it. Root can do anything including breaking your OS to a state where you will have to re-install Ubuntu as the only option remaining for repair.

There are only rare conditions where creating directories outside of /home/ may be needed. It certainly is not the way our understanding of the file system heirarchy is. In addition backups or a system reinstallation becomes harder with every single file residing outside of /home.

So if you are a beginner to the Ubuntu world I strongly advise you to not create directories or files outside of your home directory unless you really really know that you badly need them to be there, and your are 100% certain that there is no other solution.

| improve this answer | |

It is file permissions, you can start a root shell with

 sudo bash

But be careful what you do. Also please note that, on Linux, you usally don't create dictionaries in the roor dir / - if you want to store files such as documents or photos, they should go in your home directory.

echo $HOME

will print the path of the current user's home directory to the shell.

| improve this answer | |

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.