One of the possibilities is to use this command line:
ls -1 your/directory/ | grep -c ""
(your/directory/ is to replace by the directory you want to count its files)
your/directory/
ls -l your/directory/ | wc -l
works too.
Discussion
ls -l your/directory/ | wc -l
works too.