To show how many files and directories in the current (target) directory: $ ls | wc -l To count just files, and exclude directories, you could try something like: $ find /target/directory -type f -print | wc -l A quick, if somewhat ugly, way to do it, counting the dotfiles too: $ ls -aF | grep -v /$ | wc -l Again, you can use the Unix tool for everything - grep: $ ls -F | grep -Ev '/$'|wc -l Or, if you also want to exclude symlinks: $ ls -F | grep -Ev '/$|@$'|wc -l How about: $ find /target/directory -maxdepth 1 -type f -print | wc -l or: $ find /target/directory -type f -maxdepth 1 | wc -l ls(1) which is terribly slow at displaying (actually at sorting) large directories, is better off having the -f switch. If you'd like to test the difference in how long it takes ls to count files, depending on the switches you put on the end, try: $ time ls -f /usr/local/news/News | wc -l 0.42 real 0.29 user 0.07 sys 35935 $ time ls /usr/local/news/News | wc -l 147.02 real 33.92 user 0.07 sys 35935 And ls -lf makes working with awk faster, too. E.g: $ ls -lf | awk '$8 == 2007 {print $9}' $ ls -ltf | awk '$8 == 2007 {print $9}' If you've got a large number of files, ls -lf is roughly twice as fast. Here's a more dramatic change in the time, using ls, awk & wc: $ time ls -lf | awk '$8 == 2006 {print $9}' | wc -l 15 0m0.07s real 0m0.06s user 0m0.01s system $ time ls | awk '$8 == 2006 {print $9}' | wc -l 0 0m0.04s real 0m0.00s user 0m0.03s system I guess from my reading on the FreeBSD mailing list, there may be some conjecture as to if you have a large number of files, that ls -lf appears to be faster than just ls. One person on the mailing list has said they find the most intuitive way is to use something like: $ find . -maxdepth 1 | wc -l where you can specify how many levels of subdirectories to include in the count. Please note that count also includes the current directory ("."). To exclude hidden files (.*), use $ find * -maxdepth 0 | wc -l or $ expr `ls -l | wc -l` - 1