I would like a BASH command to list just the count of files in each subdirectory of a directory.
E.g. in directory
/tmp there are
dir2, ... I'd like to see :
`dir1` : x files `dir2` : x files ...
Assuming you want a recursive count of files only, not directories and other types, something like this should work:
Using find is definitely the way to go if you want to count recursively, but if you just want a count of the files directly under a certain directory: