Linux id command details how to use the Linux id command

Source: Internet
Author: User

The actual and valid IDs of users and groups are displayed. If the two IDs are the same, only the actual IDs are displayed. If only the user name is specified, the current user ID is displayed.

Syntax

Id [-gGnru] [-- help] [-- version] [user name]

Parameter description:

  • -G or -- group: displays the ID of the group to which the user belongs.
  • -G or -- groups displays the ID of the additional group to which the user belongs.
  • -N or -- name indicates the name of the user, group, or additional group.
  • -R or -- real displays the actual ID.
  • -U or -- user displays the user ID.
  • -Help: displays help.
  • -Version: displays the version information.

Instance

Display current user information

# Id // display the current user id

Uid = 0 (root) gid = 0 (root) groups = 0 (root), 1 (bin), 2 (daemon), 3 (sys), 4 (adm ), 6 (disk), 10 (wheel)

Context = root: system_r: unconfined_t

Show user group ID

# Id-g

0

Show IDs of all groups

# Id-g

0 1 2 3 4 5 6 10

Display specified user information

# Id hnlinux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.