madasafish
Technical User
I have used the following code and was delighted with it until today.
The above counts files in a directory and displays
directoryname filecount
Someone pointed out to me today that it does not show the empty directories with a 0 count. I know I can do a for loop etc to get the result but would realy like it to be an efficient 1 liner if possible.
Maybe this is not right forum for this question but would appreciate any input from our learned friends on here
As always,thanks in advance,
Madasafish
Code:
/usr/bin/find . -type f -iname '*' -printf "%h\n" | uniq -c | grep content | gawk '{print substr($2,3),$1}'
The above counts files in a directory and displays
directoryname filecount
Someone pointed out to me today that it does not show the empty directories with a 0 count. I know I can do a for loop etc to get the result but would realy like it to be an efficient 1 liner if possible.
Maybe this is not right forum for this question but would appreciate any input from our learned friends on here
As always,thanks in advance,
Madasafish