UnixDroid

System · Linux command

id command in Linux

What does id do?

id shows your user id (uid), group id (gid) and every group you belong to.

id [user]

Most useful options

OptionWhat it does
-uonly the uid
-Gonly group ids

id examples

$ id Try it ›

uid=1000(student) gid=1000(student) groups=…

$ id www-data Try it ›

info about another user

In security work

Check group memberships regularly: groups like sudo or docker give a lot of power.

Questions about id

What is uid 0?

uid 0 is always root, whatever the account is called.