users list linux

C++
cat /etc/passwdawk -F: '{ print $1}' /etc/passwdcut -d: -f1 /etc/passwd
or
cat /etc/passwdgetent passwd $LOGNAME | cut -d: -f7
Source

Also in C++: