Current user information:

id

Other user's information:

id username

UID only:

id -u username

GID only:

id -g username

Linux / Unix id Command Examples