Adding UNIX user to a group

Hi,

I am new to unix. I am facing access permission issue

I want to access path
/app/compress from a user "test" but getting permission denied error

This path exist in "Main" user
So after some googling i came to know we need to add "test" user in "main" group
so path /app/compress will be accessible from "test" user as well.

How to add "test" user in "main" group
Could anyone please help on this.

What is your system? User management is one thing that differs a lot between different UNIX systems. uname -a

As corona688 asked, what is the UNIX system type.

But, general UNIX command is

usermod -G <new secondary group> username
usermod -G main test   (where main is secondary group and test is user)

Hope this helps.

When using usermod, be careful to list ALL old groups of that user, too, else they will be gone!

Holy Moly!

I thought I mentioned it, thanks RudiC.

Unless you use the -a flag too: usermod -aG <groups> user

All,

Thanks for your answers I did

uname -a

below is the output

Linux XXXXXXXX 2.6.18-238.el5 #1 SMP Tue Jan 4 15:41:11 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

Could you please advise now needed it urgently now

As verdepollo mentioned, use '-a' flag with '-G', as '-a' means append.
So,

usermod -aG <secondary group(s)> username
usermod -aG main test