[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: shell cmd: group name from gid?



On Thu, Oct 30, 1997 at 07:28:02PM -0500, Paul Miller wrote:
> Using bash, how can I get the group name of a gid?

$ grep ":gid:" /etc/group | cut -d: -f1

Where you replace gid with the number you need.

grep will find the line in /etc/group containing the string :gid: (have a
look at /etc/group and you'll understand) ; the result is then "piped"
into cut which retrieves only the first field (-f1) if you separate the
line based on the colon (-d:)

olive
-- 
		Olivier Tharan, <tharan@int-evry.fr>

Le dernier a se delogger eteint le systeme en partant, merci !


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: