#!/bin/bash
# Show the number of files on the system with the same name.
# The first argument, if provided is the directory to start from
# Version: 0.1
# Dean Wilson (2004/11/18)

BASEDIR=${1-'/'}

find $BASEDIR -path '/proc' -prune -o -exec basename {} \; \
| awk '{ file[$1]++;}
   END {
     for (i in file)
      printf("%0.3d === %s\n", file[i], i)
    }'
