eustatos
eustatos

Reputation: 714

How I can get GID for group in linux?

I need get GID for group with name docker. In my case

$ cat /etc/group | grep docker
docker:x:990

Which command can get me 990?

Upvotes: 3

Views: 5878

Answers (1)

Shawn
Shawn

Reputation: 52674

You can use

getent group docker | cut -d: -f3

to get the group id of the docker group.

Upvotes: 5

Related Questions