linux show uid

C++
id -u $username
Source

Also in C++: