Permissions and Ownership

chmod

Changes file mode permissions.

chmod controls read, write, execute, and special permission bits. It can use symbolic modes or numeric modes such as 644 and 755.

Syntax
chmod [options] mode file...

Arguments explained

  • mode can be numeric like 755 or symbolic like u+x.
  • file is one or more paths.
  • -R applies recursively.

Common examples

Make a script executable
chmod u+x script.sh

Adds execute permission for the file owner.

Set common web file permissions
chmod 644 index.html

Owner can write; everyone can read.

chmod Command
FieldDetails
Commandchmod
CategoryPermissions and Ownership
Primary useChanges file mode permissions.
Syntaxchmod [options] mode file...