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

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

Permission denied

The path resolves fine — the system simply will not let you do that with it.

The commands behind it

chmod

Change file permissions with numeric (755, 644) and symbolic (u+x) modes — clearly explained.

chown

Assign files to users and groups — the other half of Linux permissions.

ls

List the contents of a directory, with options for hidden files, long format, sorting and more.

Concepts involved: File permissions

More how-to guides

Check disk space in Linux

See how much space is left, and find out what is using it.

Extract a .tar.gz archive

Unpack tar.gz, tar.bz2, tar.xz and zip archives from the command line.

Free a port that is already in use

Find which process holds a port and stop it cleanly.

Find and replace text in files

Replace text in one file or across a whole project, safely.