title: Command not found when using sudo
body: <p>I have a script called <code>foo.sh</code> in my home folder. </p>
  
  <p>When I navigate to this folder, and enter <code>./foo.sh</code>, I get </p>
  
  <p><code>-bash: ./foo.sh: Permission denied</code>. </p>
  
  <p>When I use <code>sudo ./foo.sh</code>, I get </p>
  
  <p><code>sudo: foo.sh: command not found</code>.</p>
  
  <p>Why does this happen and how I can fix it? </p>