title: Shell Script to Display Number of Files and Directories in a Directory
body: <p>I'm trying to write a script that will tell you how many files and how many directories are in a given directory. </p>
  
  <p>Here's the script I've written, but the output is always "Number of files is ." and "Number of directories is ."</p>
  
  <p>Here's my code:</p>
  
  <pre><code>#!/bin/sh
  if [ -d "$@" ]
  then
  find "$@" -type f | ls -l "$@" | wc -l | echo "Number of files is $@"
  find "$@" -type d | ls -l "$@" | wc -l | echo "Number of directories is $@"
  fi
  </code></pre>