Add execute permission for the owner.
chmod u+x ./script.shChange file permissions. This example grants the owner execute permission.
chmod [OPTION]... MODE FILE...Add execute permission for the owner.
chmod u+x ./script.shSet owner read/write and group read permissions.
chmod 640 ./secrets.txt| Option / clause | Description |
|---|---|
MODE (symbolic) | Use forms such as u+x, go-w or a=rx. |
MODE (numeric) | Use octal digits such as 640 or 755. |
-R, --recursive | Change permissions recursively (directories and contents). |
-v, --verbose | Report every processed file. |
-c, --changes | Report only files whose permissions changed. |
-f, --silent | Suppress most error messages. |
--reference=FILE | Use FILE's mode instead of MODE. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.