With commands, you can do many intricate things. Following command which is a small script, counts the number of .htm files in each subdirectory upto depth 2 of the current working directory.
for x in `find . -type d -maxdepth 2`; do y=`find $x -name "*.htm" | wc -l`; if [ $y != 0 ]; then echo $x - $y; fi done This command is useful for webmasters who spend some time once in a while to figure out number of files in each of the website's subdirectories.
Notes - The value of -maxdepth may be changed as needed
- The above command uses current directory (find . -type ...). The dot may be replaced by path of a directory of which the stats is needed.
- "*.htm" part of the filename may also be replaced with whatever you want