On Tuesday 04 December 2001 03:56 pm, Juan Miguel Cacho wrote: > En Tue, Dec 04, 2001 at 12:43:46AM +0800, dek escribio: > > #_ it is there for a purpose and that purpose is what ian was looking > #_ for and you forgot to put there that it is dangerous to go out of > #_ your room cause the world is a crazy place :) and using that is way > #_ better than manually editing the /etc/group files it was made for > #_ that purpose :) > #_ -Dek > #_ janitor@busylinux > > But if you want to "add a user to a pre-existing group" using usermod -G > you have to know the groups that the user belongs to and list them all > too, if you forget to list a group the user will be removed from that > group, baka ma bad trip. That's what I understand from the "man > usermod". It seems easier to just edit the file. Now, If you're adding > hundreds, or thousands of users... a shell script w/ usermod would be > better.
This should work if you want to preserve the existing groups and don't want to bother typing them all up or if it's too many to type usermod -G `id -G username | sed s/\ /,/g -`,newgroup username -- Deds Castillo Infiniteinfo Philippines Hiroshima '45, Chernobyl '86, Windows 95/98/2K _ Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph To leave: send "unsubscribe" in the body to [EMAIL PROTECTED] To subscribe to the Linux Newbies' List: send "subscribe" in the body to [EMAIL PROTECTED]
