Monday 23 January 2012

get files count and list from all sub directories

#!/bin/bash

DIRS=$(find "$1" -type d)

for d in $DIRS
do
   [ "$d" != "." -a "$d" != ".." ] && echo -e "$d $(ls $d | wc -l)\n$(ls $d)" || :
done

1 comment: