Reveal UID, GID and group membership instantly with a tiny utility. 25.03.2026 | reading time: 2 min Need to confirm who a process belongs to or why a file permission fails? Use `id` to print the numeric and textual UID and GID, plus supplementary groups, for the current or a specified user. Quick check Run `id` and get output like `uid=1000(user) gid=1000(user) groups=1000(user),4(adm),27(sudo)`; to extract just the numeric UID run `id -u` which prints `1000`, and to show group names use `id -Gn` which prints `user adm sudo`. Script-friendly usage Automate checks by calling `id -u` or `id -g` in scripts, for example `if [ $(id -u) -eq 0 ]; then echo root; fi` will detect root; parse `id -G` for numeric group lists when you must compare group membership programmatically. Security contexts and oddities On systems with SELinux, `id -Z` prints the security context; note that names and numbers may differ across containers and NFS-mounted home directories, so prefer numeric IDs when you need unambiguous checks. Related commands Combine `id` with `getent` to resolve user entries, use `groups` for a quick group list, and `chown` to change ownership when IDs show misassignment. Final thought Small commands reveal big facts: `id` is a fast verifier for identity and a handy tool when debugging permissions; master it and consider studying further for CompTIA Linux+ or LPIC-1 with intensive prep at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. utilities security filesystem processes scripting troubleshooting