0

In my working directory, I have a number of subfolders:

SNPsplit_HS_10k_thrs3
SNPsplit_HS_1k_thrs3
SNPsplit_HS_5k_thrs3
SNPsplit_slidingwindow_1000_thrs3
SNPsplit_slidingwindow_100_thrs3
SNPsplit_slidingwindow_2500_thrs3
SNPsplit_slidingwindow_250_thrs3
SNPsplit_slidingwindow_5000_thrs3
SNPsplit_slidingwindow_500_thrs3

I want to know how many files are in each of these directories. If I use something basic like ls -1 SNPsplit_HS_* | wc -l, ls will show the contents of all the SNPsplit_HS_ subdirectories, and then give me the number of lines of that output. I would rather like to see something similar to

SNPsplit_HS_10k_thrs3: 1700
SNPsplit_HS_1k_thrs3: 4200
SNPsplit_HS_5k_thrs3: 2600

Do I need ot use a loop here? Also, is there a way to filter dir/file/symlink? If I wanted to look at *.vcf files in each directory, how would I go about?

Whitehot
  • 133

0 Answers0