Determine Number of Processes Running

I am pretty new to unix, and I have a project to do.

Part of the project asks me to determine the number of processes running and assign it to a variable. I know how to every part of the project but determine the number of processes running.

How can I get just the number of processes running?

Thanks,
-Kevin

ps -ef | wc -l

Thanks a bunch!

To be precise:

var=$(ps -fe | wc -l)

assigns the value to variable var.

bakunin

Do you need the -f option with ps?
(All it does is use up a load of cpu cycles gathering extra information about each process, that you will then throw away.)

Another option is to use sar to list the system process table utilization:

sar -v 5 5