1

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!

muru
  • 197,895
  • 55
  • 485
  • 740
Mr T
  • 323
  • 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! – Mr T 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! – Mr T 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
  • You can create a new user and you will get folder with that username. And inside YOUR home folder (/home/your_name/) you can create any folder without "sudo". If I need to create some folders with administrator permission (rarely), I use "sudo nautilus", and I modify folders in Files application. – Ljiljan Veselinovic Nov 26 '15 at 16:30

1 Answers1

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 .

adeen-s
  • 462