Linux file permissions

chmod 2755 (rwxr-sr-x)

Owner: read, write, execute · Group: read, execute · Others: read, execute

2755numeric
rwxr-sr-xsymbolic
7 · 5 · 5owner · group · others
Commands
chmod 2755 filename chmod u=rwx,g=rx,o=rx filename # plus g+s chmod -R 2755 folder/ # apply to a folder and everything in it

Change any permission with the chmod calculator.

What chmod 2755 means

WhoDigitLettersCan
Owner (user)7rwxread, write, execute
Group5r-sread, execute
Others5r-xread, execute

Each digit is the sum of read (4), write (2) and execute (1). The leading 2 is a special bit: setgid — programs run with the file’s group, and new files in a folder inherit the folder’s group.

When to use 2755

Folders where new files should inherit the folder’s group (setgid).

Related permissions

Questions

What does chmod 2755 mean?

chmod 2755 sets the permissions to rwxr-sr-x: the owner can read, write, execute, the group can read, execute and others can read, execute. The leading digit sets special bits (setgid).

When should I use 2755?

Folders where new files should inherit the folder’s group (setgid).

What is 2755 in symbolic form?

2755 is rwxr-sr-x (shown by ls -l as -rwxr-sr-x for a file or drwxr-sr-x for a folder). The symbolic chmod command is chmod u=rwx,g=rx,o=rx file.