lammert

msg:3087671 | 5:58 pm on Sep 18, 2006 (gmt 0) |
Seems to be a popular topic: [webmasterworld.com...]
|
jjc_mn

msg:3087700 | 6:15 pm on Sep 18, 2006 (gmt 0) |
That was a total count. I was looking for directory by directory file count so you could see how many files were in any subdirectory. This will have to be a shell script in a for loop, not a quick one liner becuase the loop will first have to identify the subdirectory, then do the count, and then print subdirectory name and file count to the screen.
|
jjc_mn

msg:3087795 | 7:46 pm on Sep 18, 2006 (gmt 0) |
Couldn't wait. wrote it myself. Here it is in case anybody else finds themself with a Unix box running out of space. #Counts files in subdirectories date_stamp=`date +"%m%d%Y.%H%M%S"` temp_file="temp.$date_stamp.txt" find . -type d > $temp_file exec 3< $temp_file until [ $done ] do read <&3 myline if [ $?!= 0 ]; then done=1 continue fi dircount=`find $myline"/." \( -name . -o -prune \) -type f ¦ wc -l` echo "$dircount"$myline done rm $temp_file #EOF
|
|