title: Check if file exist Linux bash
body: <p>So I'm trying to check if a file exists or not and then the script is supposed to do something if it does. The problem I'm having is actually getting it to recognize that something is actually there.</p>
  
  <pre><code>if [ -e /temp/file.txt ]; then
          echo "file found!"
          sudo cp -r temp/* extra
  else
          echo "file not found! Creating new one..."
          ./create.sh
  fi
  </code></pre>
  
  <p>below is an example of the files in the directory I'm testing. they are clearly there, but for some reason I can't get the script to see that. what am I doing wrong?</p>
  
  <pre><code>nima@mkt:/docs/text$ ls -a temp
  .  ..  more  file.txt  file2.txt
  </code></pre>