Thursday, November 18, 2021

[SOLVED] Linux: How to get group id from group name? and vice versa?

Issue

I want to retrieve group id of a particular group name. Is there a command in Linux/UNIX systems to do this? Also if I want to do it the other way - get group name from group id, is that also possible?


Solution

# getent group 124
mysql:x:124:

# getent group mysql
mysql:x:124:


Answered By - kberg