Id command
We can use id command to check user id (uid), group id (gid) and secondary group name of users.
"Every user can view the id information of any other user"
"Using id command we can confirm the existence of a user account in our system"
We can use id command to check user id (uid), group id (gid) and secondary group name of users.
"Every user can view the id information of any other user"
"Using id command we can confirm the existence of a user account in our system"
Basic Usage of id command: Print all id details of the user centos
UID : User Id of the user centos
GID : Group ID of the user centos
Groups : Names of all groups where centos has membership.
GID : Group ID of the user centos
Groups : Names of all groups where centos has membership.
Print the UID of current user: If we want to view the current user's UID, we can use Linux id command with -u option
Print the UID of a different user: If we want to view the UID of a different user , just use the name with id command. We are going to print the UID of the user redhat using id command.
Print the user name related to UID : If we want to view the account name instead of the numerical UID of the account, we can use Linux id command with -n option
Print the GID of current user: If we want to view the current user's GID, we can use Linux id command with -g option
Print the GID of a different user: If we want to view the GID of a different user , just use the name with id command. We are going to print the GID of the user centos using id command.
Print the group name instead of the GID value of a different user: If we want to view the Group name instead of the numerical GID of a different user , just use the switch -n and -g with id command. We are going to print group name related to the GID of the user centos using id command.
Print all secondary group names where redhat has member ship ,