chmod
Syntax
chmod [OPTION]... MODE[,MODE]... FILE...
Parameters
| Parameters | Description | Examples | Level |
|---|---|---|---|
-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
- : 4=(r) 2=(w) 1=(x), //
- 755 = rwxr-xr-x( and Common)
- 644 = rw-r--r--(Common)
- 600 = rw-------( and more)