Linux: View GID by Group Name

I just wanted to save this for me so that I can't forget this. For example, if you want to view the GID of group "dialout", issue the command below.

$> groupname=dialout
$> sed -nr "s/^$groupname:x:([0-9]+):.*/\1/p" /etc/group


This is helpful since there's no command like "id" can do for a group.


Comments

Anonymous said…
bloddy shit
nothing worked
spent half an hour on it
go to hell u suckers

Popular posts from this blog

Using Oracle 11g thru VirtualBox appliance in Mac OS X Lion

Use Shell Editor for Eclipse for editing bash, ksh, csh in Unix/Linux system

LVM: How to remove a volume using pvremove