Permissions and owners

The chgrp command

Changes the group a file belongs to.

Syntax

chgrp <grupo> <archivo>

Most useful options

-RRecursive through the folder

Copy-ready examples

$ touch notas.txt && sudo chgrp alumno notas.txtAssign a group
$ sudo chgrp -R alumno ProyectosRecursive through the folder

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Sharing by group is the clean way for a team to collaborate.

Related commands

FAQ

What is a group for?

To give the same permissions to several users at once.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course