Linux: Summary of some user and group related commands

  • useradd raj (User raj is created)
  • passwd raj (Password to user raj be given)
  • cat /etc/passwd (Displays the account details of the users)
  • cat /etc/group (Displays the group details)
  • groupadd test (Creates a group but no directory is created)
  • mkdir tst ( A directory tst is created)
  • chgrp test /home/tst (Directory is assigned to group test)
  • usermod –G g1 t1 (t1 user and g1 is the group t1 is made the member of g1)
  • usermod –a –G g2 t1 (-a append, so user t1 is the member of both g1 and g2 group)
  • userdel raj (Deletes the user raj but home directory of raj not deleted)
  • rm –r raj (Deletes the directory raj emptying all its contents)
  • userdel –r raj (Deletes user with the home directory)
  • groupdel muroor (Deletes the group muroor)
  • groupmod -g with the new ID number and the group name (Change the group ID or group name)
  • groupmod -n udupi muroor (Change the name of a group, use the -n option. The muroor group has its name changed to udupi )

Linux: Managing Groups << Previous
Next>> Linux: Managing the permission of file

Our aim is to provide information to the knowledge seekers. 

comments powered by Disqus