id [user]Arguments explained
- user is optional; without it id shows the current user.
- -u prints only user ID.
- -g prints only primary group ID.
- -n prints names with some options.
Common examples
idPrints UID, GID, and groups for your current user.
id www-dataShows service account identity and groups.
| Field | Details |
|---|---|
| Command | id |
| Category | System Information |
| Primary use | Shows user and group IDs. |
| Syntax | id [user] |