30

I need some help about permission. I had a permission drwxrwxr-x but I try to change the permission with chmod 755 /folder/ and after that I receive permission drwxr-xr-x but I would like to change it back to drwxrwxr-x. Please can you help me with this? Filip

1
  • See this answer for a description of the symbolic names. The d prefix means that the file in question is a directory. Regular files have a - prefix. There are other types too, look in the info page of ls for more.
    – Lekensteyn
    Jan 22, 2014 at 9:53

3 Answers 3

45

For drwxrwxr-x it's:

chmod 775  the_path_to_target

For drwxr-xr-x it's:

chmod 755  the_path_to_target
28

allways remember the following

r - read
w - write
x - execute

and permission matrix is

7 = all rights
6 = read and write
5 = read and execute
4 = read only
3 = execute and write
2 = write only
1 = execute only
0 = no rights

i think this will help you to understand the permission and by adding + you give the permission and - you remove the permission

1
  • Very good explaination!
    – supersan
    Feb 1, 2020 at 12:38
7

remembering the letter form is easier than the numbers (in my opinion) for example:

chmod a+w file

the part before the sign

the user who owns it (u), other users in the file's group (g), other users not in the file's group (o), or all users (a)

the sign

The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added and causes unmentioned bits to be removed except that a directory's unmentioned set user and group ID bits are not affected.

the last part

read (r), write (w), execute (or search for directories) (x)

you can run

chmod a+rx file
chmod ug+w file

Not the answer you're looking for? Browse other questions tagged .