title: Recursively count specific files BASH
body: <p>My goal is to write a script to recursively search through the current working directory and the sub dirctories and print out a count of the number of ordinary files, a count of the directories, count of block special files, count of character special files,count of FIFOs, and a count of symbolic links. I have to use condition tests with [[ ]]. Problem is I am not quite sure how to even start.</p>
  
  <p>I tried the something like the following to search for all ordinary files but I'm not sure how recursion exactly works in BASH scripting:</p>
  
  <pre><code>function searchFiles(){
      if [[ -f /* ]]; then
          return 1
      fi
  }
  searchFiles
  echo "Number of ordinary files $?"
  </code></pre>
  
  <p>but I get 0 as a result. Anyone help on this?</p>