Permission drwxrwxr -x [duplicate]

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


Solution 1:

For drwxrwxr-x it's:

chmod 775  the_path_to_target

For drwxr-xr-x it's:

chmod 755  the_path_to_target

Solution 2:

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

Solution 3:

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