How to Use chmod 755 in Linux
Understand what chmod 755 means and when it is appropriate.
The mode 755 is built from 4=read, 2=write and 1=execute for owner, group and others.
Step by step
1 Set the mode
$ chmod 755 script.sh Sets the file to rwxr-xr-x.
2 Verify it
$ ls -l script.sh Look for `-rwxr-xr-x`.
3 Use it on a directory
$ chmod 755 myapp/ Directory execute permission allows traversal.
4 Make a smaller change
$ chmod u+x script.sh Adds execute for the owner without replacing all other bits.
Tips worth knowing
- Avoid chmod 777 as a generic fix.
- A private executable may suit 700 better.
- Remember 4=read, 2=write, 1=execute.
Frequently asked questions
What does chmod 755 mean?
Owner has read/write/execute; group and others have read/execute.
What is the difference between chmod +x and chmod 755?
+x adds execute permission while 755 sets the complete mode.
If it goes wrong
The commands behind it
Change file permissions with numeric (755, 644) and symbolic (u+x) modes — clearly explained.
chownAssign files to users and groups — the other half of Linux permissions.
lsList the contents of a directory, with options for hidden files, long format, sorting and more.
Concepts involved: File permissions
More how-to guides
See how much space is left, and find out what is using it.
Extract a .tar.gz archiveUnpack tar.gz, tar.bz2, tar.xz and zip archives from the command line.
Free a port that is already in useFind which process holds a port and stop it cleanly.
Find and replace text in filesReplace text in one file or across a whole project, safely.