Ad space (banner)
🖥️Linux Lessons
Lesson 49 / 61

Checking Your User Info with id

id is for when "I want detailed info about my own user account (UID and groups)." id displays the current user's user ID (UID), group ID (GID), and the list of groups they belong to.

Just type id alone to run it. To check a specific user's info, you can also pass an argument, like id username.

Running id displays your user ID and group memberships, something like uid=1000(taro) gid=1000(taro) groups=1000(taro),27(sudo).

A common early mistake is not noticing the difference in detail between whoami (username only) and id (detailed permission info), leaving you without enough information when investigating a permission issue.

In real work, when a permissions error occurs, this is used as an investigative command to check which groups that user belongs to.

Linux
Try it (type this into the pseudo terminal)
id

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)