mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-31 02:41:46 +00:00
34 lines
637 B
Plaintext
34 lines
637 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# id
|
|
|
|
> Display current user and group identity.
|
|
> More information: <https://www.gnu.org/software/coreutils/id>.
|
|
|
|
- Display current user's ID (UID), group ID (GID) and groups to which they belong:
|
|
|
|
`id`
|
|
|
|
- Display the current user identity:
|
|
|
|
`id -un`
|
|
|
|
- Display the current user identity as a number:
|
|
|
|
`id -u`
|
|
|
|
- Display the current primary group identity:
|
|
|
|
`id -gn`
|
|
|
|
- Display the current primary group identity as a number:
|
|
|
|
`id -g`
|
|
|
|
- Display an arbitrary user's ID (UID), group ID (GID) and groups to which they belong:
|
|
|
|
`id {{username}}`
|