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

Re: adding all users to group



On Mon, Jan 21, 2002 at 06:59:21PM -0800, mike@stonelx.ath.cx wrote:
| Hi,
| I'm trying to find a way to 
| add all my users to a group.
| Is there a simple command to do this?

# for USER in `cat /etc/passwd | sed "s,:.*$,,"` ; do adduser $USER <group> ; done

Unfortunately this method will catch all system users too.  An
alternative would be to list /home, if you have no subdirectories
there.

(the shell is your friend!  learning it comes in handy sometimes)

-D

-- 

"He is no fool who gives up what he cannot keep to gain what he cannot lose."
        --Jim Elliot



Reply to: