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?
I saw here that you can use the id command to get gid or uid from group name or username respectively. man page for id says last argument is username, so id -g foo will display the name of the main group for user "foo".
1) In a Unix system, a GID (group ID) is a name that associates a system user with other users sharing something in common (perhaps a work project or a department name).
# getent group 124
mysql:x:124:
# getent group mysql
mysql:x:124:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With