No such file or directory when chown on newly created directory

429

The mistake you made is to mix up /media/samsung with ~/media/samsung notice the ~

The ~ sign refers to your home folder location for example /home/$USER/ when you stated ~/media/samsung you were actually typing /home/$USER/media/samsung

You could also use sudo chown paul:paul ./media/samsung the . means from current folder (or something like it) but this will set the ownership for the folder located at /home/$USER/media/samsung.

Share:
429

Related videos on Youtube

Jomo
Author by

Jomo

Updated on September 18, 2022

Comments

  • Jomo
    Jomo almost 2 years

    I have an HTML form with 10 input fields of type text. I want users to be able to copy&paste one text with 10 lines into the first input field and then automatically place them into the 10 fields with Javascript. But the line breaks seem to be removed immediately, at least by Firefox. So when I get the value of the first field with Javascript, it has no line breaks anymore.

    Is there a way to get the text with the line breaks? I can't use textareas because this would lead to other problems.

    • muru
      muru over 9 years
    • Rinzwind
      Rinzwind over 9 years
      "After creating (with sudo) the /media/samsung directory". When did you do that?(it is not in the commands you supplied).
    • muru
      muru over 9 years
      @Rinzwind aside from the typo, chmod/chown on an NTFS in itself is not going to work, hence the possible dupe.
    • Rinzwind
      Rinzwind over 9 years
      Yes, I know. But it is not an answer to the problem; it is an answer to what user the wants. So I am in doubt _O-
    • muru
      muru over 9 years
      @Rinzwind Another XY problem, I suppose.
    • Paul Davies
      Paul Davies over 9 years
      I created the media and media\samsung folders previous to this step. That was successful. the script I included here was just to demonstrate the apparent incongruity between the existence of the folder and the error message. I shall try elmer82's proposed answer tomorrow.
    • Vaibhav Vishal
      Vaibhav Vishal almost 5 years
      Best option is to use textarea. What other problems it may cause, can you be more specific.
    • anirudh chauhan
      anirudh chauhan almost 5 years
    • Spark Fountain
      Spark Fountain almost 5 years
      Can you please show us the relevant part of your JavaScript code?
    • André Reichelt
      André Reichelt almost 5 years
      Why can't you use a textarea? It might be easier to fix your "other problems".
    • Jomo
      Jomo almost 5 years
      I couldn't find a way to make a textarea behave exactly the same way as an input field and I had problems with the display of overflowing content, that is why I preferred a solution with input field.
  • Paul Davies
    Paul Davies over 9 years
    Thank you. I shall try it tomorrow evening. It's late here now.
  • Paul Davies
    Paul Davies over 9 years
    thank you. I am a little less frustrated today and looking forward to learning more
  • Jomo
    Jomo almost 5 years
    Thanks, this seems to work. I only had to add "event.preventDefault()", otherwise the original clipboard content would also be added to the field.
  • estavillo
    estavillo over 4 years
    neat; I'll add that to my answer :D