chmod flags & options

-R, --recursive

Change permissions recursively for all files and directories.

chmod -R 755 ./public
chmod -R u+rw ./project

-v, --verbose

Print a message for each file processed.

chmod -v 644 *.txt

--reference

Set permissions to match another file.

chmod --reference=template.sh script.sh

u+x

Add execute permission for the file owner. Common symbolic mode.

chmod u+x script.sh

a+r

Add read permission for all users (owner, group, others).

chmod a+r public-file.txt

go-rwx

Remove all permissions for group and others.

chmod go-rwx private-key.pem

755

Owner can read/write/execute, everyone else can read/execute. Standard for directories and scripts.

chmod 755 deploy.sh

644

Owner can read/write, everyone else can only read. Standard for regular files.

chmod 644 config.yml

600

Owner can read/write, no access for anyone else. Use for private keys and secrets.

chmod 600 ~/.ssh/id_rsa