Find count of files matching a pattern in a directory in linux

前端 未结 6 1330
面向向阳花
面向向阳花 2021-02-02 09:06

I am new to linux. I have a directory in linux with approx 250,000 files I need to find count of number of files matching a pattern.

I tried using following command :

6条回答
  •  执念已碎
    2021-02-02 09:52

    ls -1 | grep '20061101-20131101_kh5x7tte9n_2010_*' | wc -l
    

    Previous answer did not included quotes around search criteria neither * wildcard.

提交回复
热议问题