How to Use chmod to Change File Permissions in Linux
chmod changes read, write, and execute permissions for a file's owner, group, and others. Learn the numeric (755) and symbolic (u+x) notation.
Published September 20, 2026
chmod changes who can read, write or execute a file. Permissions are set for three groups (owner, group, others) using either numbers like 755 or letters like u+x.
The concept
Each file has three permission sets. Read = 4, write = 2, execute = 1; add them up per group. 7 = rwx, 6 = rw-, 5 = r-x, 4 = r--.
So 755 means owner rwx, group r-x, others r-x. Directories need execute permission to be entered.
Decode 755
ls -l script.sh
-rwxr-xr-x 1 ada dev 120 script.sh
│││ │││ │││
owner group others → 7 5 5
Practical examples
Make a script executable
chmod +x deploy.shNumeric modes
chmod 644 file.txt # rw-r--r--
chmod 600 ~/.ssh/id_rsa # private keyRecursive, directories only
find site -type d -exec chmod 755 {} \;
find site -type f -exec chmod 644 {} \;Symbolic changes
chmod u+x,g-w,o-rwx fileCommon mistakes
- Using chmod 777 'to make it work' and opening the file to everyone.
- Using chmod -R 755 on files, making every file executable.
- Forgetting directories need x to be entered.
Key takeaways
- r=4, w=2, x=1.
- 644 for files, 755 for directories and scripts, 600 for secrets.
- Avoid 777.
FAQ
What does chmod +x do?
Adds execute permission for all classes allowed by your umask.
chmod vs chown?
chmod changes permissions; chown changes the owner and group.