I have done

chmod -R 644 .

inside the directory dir

My user's permissions are drw-r--r-- and i'm the owner of the directory

When trying chmod 755 dir, error is popped

chmod: changing permissions of dir Operation not permitted

The same error is popped when doing ls even as root

How can i change permissions back to 755?

Best Answer


from the level above dir .

chmod -R a+x *dir*

to give all users (a) execute permission to all subdirectories and files (+x) or.

chmod -R a+X *dir*

to give all users execute permission to all subdirectories only (+X)