terminal.cab

All commands

chgrp

Topic: Permissions and ownership

Program: chgrp

Changes the group of files.

Package: besitzer

Usage

chgrp [OPTION]... GROUP FILE...

Description

Give each FILE the group GROUP, a name or a number. Without root you must own the file and belong to GROUP.

Options in the simulator

8 more options of the real program, not in the simulator yet
  • --dereference not in the simulator yet

    On a real system it changes the target of each symbolic link with -R; without -R that is the default anyway.

  • --from needs a value not in the simulator yet

    On a real system it only changes files that have the given current owner or group.

  • --no-preserve-root not in the simulator yet

    On a real system it protects or allows the root directory / with -R; the simulator treats / like any directory.

  • --preserve-root not in the simulator yet

    On a real system it protects or allows the root directory / with -R; the simulator treats / like any directory.

  • -H not in the simulator yet

    On a real system it decides which symbolic links -R follows; the simulator follows none with -R (like -P).

  • -L not in the simulator yet

    On a real system it decides which symbolic links -R follows; the simulator follows none with -R (like -P).

  • -P not in the simulator yet

    On a real system it decides which symbolic links -R follows; the simulator follows none with -R (like -P).

  • --version not in the simulator yet

    On a real system it prints the version of the program.

Examples

From the lesson Owners and the starting mode
chgrp adm deploy.sh
ls -l deploy.sh
-rw-r--r-- 1 lerner adm 34 Oct 17 08:30 deploy.sh
chown root deploy.sh
chown: changing ownership of 'deploy.sh': Operation not permitted
ls -l /srv/shared/data.txt
-rw-r--r-- 1 root root 12 Oct 17 08:30 /srv/shared/data.txt
chown lerner /srv/shared/data.txt
chown: changing ownership of '/srv/shared/data.txt': Operation not permitted

Try it in the terminal

Where you learn it

Lessons

All commands