Groups: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Operating systems such as Linux, and Mac OS, (and Windows 10???) have a notion of groups to manage collaboration of the [[users]] of the system.


  groups - print the groups a user is in
== Check the groups of a user ==


Operating systems such as Linux, and Mac OS, (and Windows 10???) have a notion of groups to manage collaboration of the [[users]] of the system.
  groups


Related linux commands:
  groups ''username''
* chgrp


== Add an Existing User Account to a Group ==
== Add an Existing User Account to a Group ==


   usermod -a -G ''group'' ''username''
   usermod -a -G ''group'' ''username''
== Create a new group ==
  sudo groupadd ''mynewgroup''
== Change the group of a file/folder ==
  chgrp ''group'' ''fileorfolder''
To change the group of a folder and all its contents, use the -R (recursive) option:
  chgrp -R ''group'' ''folder''
For even more social/sharable folders, see [[ACL]].


== Links ==
== Links ==


* https://www.howtoforge.com/tutorial/linux-groups-command/
* https://www.howtogeek.com/50787/add-a-user-to-a-group-or-second-group-on-linux/
* https://www.howtoforge.com/linux-adduser-addgroup-command/

Latest revision as of 10:40, 22 April 2020

Operating systems such as Linux, and Mac OS, (and Windows 10???) have a notion of groups to manage collaboration of the users of the system.

Check the groups of a user

 groups
 groups username

Add an Existing User Account to a Group

 usermod -a -G group username

Create a new group

 sudo groupadd mynewgroup

Change the group of a file/folder

 chgrp group fileorfolder

To change the group of a folder and all its contents, use the -R (recursive) option:

 chgrp -R group folder

For even more social/sharable folders, see ACL.

Links