Click to See Complete Forum and Search --> : kernel programming


gcurious
03-01-2003, 04:08 PM
how do i get the number of users on the system? It should probably be in the proc fs somewhere but I don't know where to look.

This is for part of a fair-share scheduler.

gcurious

bwkaz
03-03-2003, 02:22 PM
who | wc -l

That's the current number login sessions. You could do who | awk '{print $1; }' | sort | uniq to get the number of unique usernames logged in at the time.

Or you could do wc -l /etc/passwd to get the number of users set up in the passwd file.