for dir in `find /alidata1/trip/img/ -type d ` ;do echo -n "$dir " ;find $dir -name "*.jpg" -type f | wc -l ;echo "" ;done;
Statement description:
- The for dir in loop processes the list of folders queried by `find /opt -type d`,
- do echo -n "$dir " output folder name
- find $dir -name "*.jpg" -type f | wc -l ; count the number of files in a folder
- done ends the loop
Parameter Description:
- -type file type matches d folders, f files
- -name The file name matches *.jpg to match the file with the suffix jpg