Link to home
Start Free TrialLog in
Avatar of bje
bjeFlag for United States of America

asked on

count number of files in a directory by file name

Need to count the number of files in a directory by file name.  Then write to a file.

This is what I have, however gives me an error,

type1count=$[`find -type f | ls -l type1* | wc -l`]
type2count=$[`find -type f | ls -l type2* | wc -l`]

printf " type1: $type1count, type2: $type2count  \n"  >> /app/temp/log.txt

error message,
type1count=3: command not found
ASKER CERTIFIED SOLUTION
Avatar of Sharath S
Sharath S
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial