File Permissions

chmod

Change file access permissions using symbolic or octal notation.

Synopsis

syntax
chmod [OPTION]... MODE FILE...

Examples

rwxr-xr-x — owner full, others read+execute
chmod 755 script.sh
Add execute permission for all
chmod +x deploy.sh
Set files to rw-r--r-- recursively
chmod -R 644 content/
Add write for owner, remove for group and others
chmod u+w,go-w file.txt
Copy permissions from another file
chmod --reference=ref.txt target.txt

Common options

FlagDescription
-RChange files and directories recursively
-vVerbose — output each processed file
-cLike -v but report only changes
--referenceCopy permissions from reference file

About chmod

The `chmod` command change file access permissions using symbolic or octal notation. File permission commands control access to files and directories on Linux.

The Unix permission model uses owner, group, and other categories with read, write, and execute bits. Properly managing permissions is essential for system security, multi-user environments, and running services that require specific access levels.

The command accepts 4 commonly used flags shown above, though the full set of options is available in the man page (`man chmod`). The 5 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More File Permissions Commands

Other commands in the File Permissions category

Related tools