chmod
is a command-line utility used to change the file mode bits of a file system object. It is used to define the permissions for the owner, group, and others.
chmod [OPTION]... MODE[,MODE]... FILE...
-R, --recursive
: change files and directories recursively-v, --verbose
: output a diagnostic for every file processed--reference=RFILE
: use RFILE’s mode instead of MODE valuesChange the permissions of a file to be readable, writable, and executable by the owner, and readable and executable by others:
chmod 755 filename
Recursively change the permissions of a directory and its contents:
chmod -R 755 directory
Change the permissions of a file to match those of another file:
chmod --reference=referencefile filename