chmod

Syntax

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

Parameters

ParametersDescriptionExamplesLevel
-R --recursive chmod -R 755 dir/ Common
755 rwx, and rx chmod 755 script.sh Common
644 rw, and r chmod 644 config.txt Common
+x chmod +x deploy.sh Common
u+w chmod u+w file.txt Advanced

Examples

chmod +x deploy.sh
Common

chmod 644 index.html
,

chmod 755 public/
, and

chmod -R 755 /var/www/html/

chmod a-w important.conf

Common Errors

chmod: changing permissions of 'xxx': Operation not permittedsudo

Tips

Related Commands