count number of files linux command

C++
ls | wc -lls -1q log* | wc -l
Source

Also in C++: