How do I count all the files at different subfolder using for loop
0
votes
2
answers
144
views
I want to know could I wc -l files are in subfolder.If only one file I can use code like below.
find ./calss{1..20}/ -name 'C1.student' | xargs wc -l
In fact, I have 20 folders , every folder contain C1.student to C50.student files.I want to use
to count multiple files at different sub folders.
I try this code but got all 0, Did I miss something ? Thanks for your time.
for i in $(seq 1 50); do
find ./calss{1..20}/ -name 'C${i}.student' | xargs wc -l
done
Asked by Roq
(15 rep)
Jan 11, 2023, 05:45 AM
Last activity: Jan 11, 2023, 11:55 AM
Last activity: Jan 11, 2023, 11:55 AM