title: Permission denied when trying to compile own shell in linux, what can I do?
body: <p>I know this question was asked before, but I already tried to use chmod or sudo and it's still not working. So the thing is this:</p>
  
  <p>I have bash on ubuntu on windows installed on my windows 10. I wrote my own shell in terminal but I did something wrong and deleted days of work by accident... So to be sure I started and wrote it again in codeblocks and just copied the c file in the directory so that i can see the file when i do the command ls.</p>
  
  <p>The problem is when I try to do this: </p>
  
  <pre><code>gcc -o shell shell.c
  </code></pre>
  
  <p>I get </p>
  
  <blockquote>
    <p>cc1: fatal error: shell.c: Permission denied</p>
  </blockquote>
  
  <p>What can I do?</p>
  
  <p>When I type <code>ls -ld . shell.c shell</code> I get: </p>
  
  <pre><code>drwxr-xr-x 0 Lightning Lightning   512 Jan 16 23:35 .
  -rwxr-xr-x 1 root      root      19576 Jan 16 23:35 shell
  ---------- 1 Lightning Lightning 17310 Jan 16 23:35 shell.c
  </code></pre>
  
  <p>And to clarify as a lot of you understand that I used sudo and that the shell file is the problem. It is not! Sudo solved my problem (I understand that it's not the best solution, that's why I'm trying to find another one), but I had the problem before I used sudo. And when I use the code:</p>
  
  <pre><code> gcc shell.c
  </code></pre>
  
  <p>I still get permission denied!</p>