Use the following command.
Code:
ls -l | grep "^-" | wc -l
It will give the number of files in the current directory.
If you want to know the number of files in a specific directory , then you need to specify its name as
Code:
ls -l <directory_path> | grep "^-" | wc -l