terminal.cab

All commands

chmod

Topic: Permissions and ownership

Program: chmod

Changes file permissions.

Package: perm

Usage

chmod [OPTION]... MODE FILE...

Description

Set the permissions of each FILE. MODE is octal (644, 4755) or symbolic: who (u, g, o, a), then +, - or =, then r, w, x, X, s, t or u, g, o to copy; several parts are joined with commas. Without who the umask holds bits back.

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 decides how chmod treats symbolic links; the simulator only follows links named on the command line.

  • -h, --no-dereference not in the simulator yet

    On a real system it decides how chmod treats symbolic links; the simulator only follows links named on the command line.

  • --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 how chmod treats symbolic links; the simulator only follows links named on the command line.

  • -L not in the simulator yet

    On a real system it decides how chmod treats symbolic links; the simulator only follows links named on the command line.

  • -P not in the simulator yet

    On a real system it decides how chmod treats symbolic links; the simulator only follows links named on the command line.

  • --version not in the simulator yet

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

Examples

From the lesson Reading and setting permissions
ls -l deploy.sh
-rw-r--r-- 1 lerner lerner 34 Oct 17 08:30 deploy.sh
chmod +x deploy.sh
ls -l deploy.sh
-rwxr-xr-x 1 lerner lerner 34 Oct 17 08:30 deploy.sh

Try it in the terminal

Where you learn it

Lessons

All commands