title: List all subdirectories of a folder with with an specified depth
body: <p>I want to list all  sub-directories of a folder which their depth is only 2. So far by looking at previous questions and users answers I come up to this code,</p>
  
  <pre><code>i=0                  
  for directory in `find  ./input   -maxdepth 3   -type d -mindepth 2 `
     do
     arr[i]=$directory
     let "i += 1"
   echo $directory
  done
  </code></pre>
  
  <p>I run this code in Fedora machine and it gave me correct answers, but when I run it in centOS, it is not working. Actually -maxdepth works but not -mindepth.</p>
  
  <p>to be more specific in Fedora the output is like this:</p>
  
  <p>-./input/ Staphylococcus/200</p>
  
  <p>-./input/ Staphylococcus/50</p>
  
  <p>-./input/ Staphylococcus/100</p>
  
  <p>-./input/ Staphylococcus/150</p>
  
  <p>-./input/Neisseria_meningitidis/200</p>
  
  <p>-./input/Neisseria_meningitidis/50</p>
  
  <p>-./input/Neisseria_meningitidis/100</p>
  
  <p>-./input/Neisseria_meningitidis/150</p>
  
  <p>which is my desire output and in in centOS the output contains these list as well as some other directories with longer depth.</p>
  
  <p>Another interesting thing is when I run </p>
  
  <p>./input -mindepth 2 -maxdepth 2  -type d</p>
  
  <p>in my command prompt screen it gives me  again correct answer, but not in bash file.</p>
  
  <p>I am really confused whatever I searched I didn't find any alternative for mindepht flag.  </p>