1

This question already has an answer here:

I am new to Ubuntu. I want to create a new dir in /home, lets call it myDir, and then I want to create a .txt file that outputs the current date. All these through terminal comands. So, to be more specific... I am in /home and I type

sudo -l #So I can type comands as superuser, I think.
sudo -mkdir myDir #That works fine, the new directory is created, but 

then.

sudo date > myDir/output.txt 

It still does not give me any permission.

Someone might wonder, "You really have to create a new dir in /home?", well to tell you the truth, yes I do! Its a step from a school exercise and I am also really curious. I'am telling you so far I love ubuntu (installed 3 days ago) and if I can manage to fix a problem with my internet connection (one issue at a time) I am so gonna delete windows from my laptop!

Thank you in advance!

marked as duplicate by muru, Eric Carvalho, user68186, Community Nov 26 '15 at 22:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    I'm reasonably certain your school exercise meant you to use your home directory, not /home. – muru Nov 26 '15 at 12:33
  • Yes I am sorry, I am a super noob! I meant home directory! – Skemelio Nov 26 '15 at 12:34
  • 1
    Then you want something like /home/skemelio, or ~, or $HOME. The terminal opens to your home directory by default. No sudo required. – muru Nov 26 '15 at 12:35
  • That would really make sense, but the professor's orders are clear. He wants a new directory in home. If that is not possible then its ok... Thanks a lot for your help! – Skemelio Nov 26 '15 at 12:41
  • 3
    Unless he specifically said /home with a / at the beginning, you are misunderstanding him. – muru Nov 26 '15 at 12:43
2

Your home directory means $HOME which is actually /home/username . You cannot write to /home because it is a system folder which you do not have the rights to modify .

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