can anyone help me in making singleline command for
Capital Letters are folders ,small letter are files
X,Y,Z are subfolders of A
as shown below
A - X,Y,Z
Folder X has three files a.txt,b.txt,c.txt similarly Y,Z.
as shown below
X- a.txt,b.txt,c.txt
Y- a.txt,b.txt,c.txt
Z- a.txt,b.txt,c.txt
Now i want the count no.of files in all subfolders in A
comp:A admin$ ls | xargs wc -l
will give the count in each folder
but what i want is to print X and its count also
X
3
Y
3
Z
3
Now what i want is to print "X" on screen before its piping to xargs
MAINIDEA: The main idea of this question is it possible to redierct output to screen before piping to another command
eg: i tried just like
comp:A admin$ ls | xargs tee |xargs wc -l
comp:A admin$ ls | tee |xargs wc -l
but not working any ideas???