whatis chmod
chmod
Also known as: change mode
The command that changes a file's permission bits, using either octal numbers (chmod 644) or symbolic notation (chmod u+x).
What Does chmod Do in Linux?
Octal mode sets all bits at once: chmod 600 key.pem makes a file readable and writable only by its owner. Symbolic mode adjusts specific bits: chmod g+w file adds group write, chmod o-r file removes read for others.
chmod -R recurses, but applying one mode to files and directories alike is a common mistake. find with -type f and -type d, or the capital X symbol, sets execute only where it belongs.
Example
chmod 755 deploy.sh
chmod -R u=rwX,go=rX /srv/www Learn more about chmod
- chmod Command Explained chmod changes the read, write, and execute permissions on files and directories. This guide covers numeric mode, symbolic mode, recursive changes, and the most common chmod values used in practice.
- chown Command Explained chown changes which user and group own a file or directory. This guide covers the user:group syntax, recursive ownership changes, and common patterns for web servers and shared directories.
- How Linux Permissions Work Linux permissions control who can read, write, and execute every file and directory on the system. This guide explains the permission model from the basics through to special bits, umask, and ACLs.
Related tools
- chmod / chown Builder Work out permission octals and ownership commands with a visual rwx matrix.