how to remove the user from group using userod command?

Posted on 2011-05-11
Last Modified: 2012-05-11
how to remove the user from group using userod command?  in linux?
Question by:mokkan
    LVL 31

    Accepted Solution

    It is usermod

    You have to name all the groups except for the one you want to remove

    usermod -G g1,g2,g3 userid
    LVL 12

    Assisted Solution

    Farzani is correct but if you want to remove a user from its initial/primary group then you have to change its primary group.

    # usermod -g <new group>

    Could you please paste the output of below given command and update from which group you want to remove the user then we can help you accordingly.

    # groups userid or username

    Author Closing Comment

    thank  you.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now