Empulse Group a collection of notes from a sys admin, musician, and father

12Aug/12Off

file count BASH script

#!/bin/bash
# 20120812
# by: eric hernandez
#
# usage: ./file_count [path]
#
for DIR in `find $1 -type d`; do
   COUNT=0
   for FILE in $DIR/*; do
      if [ -f $FILE ]; then
         ((COUNT++))
      fi
   done
   echo -e "$COUNT \t $DIR"
done
Tagged as: , Comments Off
Comments (0) Trackbacks (0)

Sorry, the comment form is closed at this time.

Trackbacks are disabled.