title: What is the difference between the -d, -e , and -f flags in test / [ in shell scripting?
body: <p>What is the difference between <code>-d</code>, <code>-e</code>, <code>-f</code> in shell scripting? I am trying to understand difference between <code>-e</code>, <code>-d</code> and <code>-f</code> parameters.</p>
  
  <p>Examples: <code>if [ -d /path ]</code>, <code>if [ -e /path/ ]</code>, <code>if [ -f /path ]</code></p>
  
  <p>As per my knowledge</p>
  
  <ul>
  <li><code>-d</code> checks for the directory existence</li>
  <li><code>-e</code> checks for directory along with content (if a directory exists with contents then return true)</li>
  <li><code>-f</code> checks for file existence</li>
  </ul>