Terminal Dojo
Help العربية Sign inGet started

Command library / chmod

chmod

BashDraft — pending expert review4 practice missions

Change file permissions

Changes who may read (r), write (w) or execute (x) a file. Permissions are set for three audiences: the owner (u), the group (g) and everyone else (o). In octal mode each audience is one digit — r=4, w=2, x=1 added together — so 755 means rwx for the owner and r-x for the group and others.

Practice chmod

Usage

chmod [options] mode file...
chmod [options] octal-mode file...

Options and flags

Examples

Common mistakes

chmod backup.sh 755 chmod 755 backup.sh

The mode comes first, then the file.

chmod +x chmod +x deploy.sh

chmod needs a file to act on.

Related commands

lschown