count number of files in a directory

what's the script to do that?
i want to only count the number of files in that directory, not including any sub directories at all

ls -l | grep -c "^-.*"

then how do I count the number of files that has the word 'test'? assuming that the word only exist in the file once

grep "test" * | wc -l

Use ls | wc -l
This lists the total number of files in current directory.

check the "More UNIX and Linux Forum Topics You Might Find Helpful" box above...there's a similar thread on this