S
S
shledon2022-01-26 11:21:28
linux
shledon, 2022-01-26 11:21:28

How do folder permissions work in Linux?

I can not understand how the permissions to the folder happen, and specifically the moment with Read and eXecute.
If I leave the rights -wx then I can go into the folder and edit it WHY? I don't have read permissions.
If I leave the rw- rights, then I can’t access the folder and, accordingly, I can’t edit either, although I have read rights.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
J
jcmvbkbc, 2022-01-26
@jcmvbkbc

how the permissions to the folder happen, and specifically the moment with Read and eXecute

Read -- the ability to read the contents of a directory. eXecute -- the ability to make a directory current.
See _

S
Saboteur, 2022-01-26
@saboteur_kiev

R to directory - read its contents
W to directory - edit directory (add, delete files, rename files)
X - go to directory
Read documentation

R
rPman, 2022-01-26
@rPman

what do you mean you can't edit?

mkdir test
chmod -r test
cd test
pwd
# /home/user/test
touch zzz
mkdir qqq
ls -la
# ls: невозможно открыть каталог '.': Отказано в доступе
rm -r zzz qqq
cd ..
rm -r test

you can go in, create files and directories there (they will have all the rights by default), but you can’t read the list

V
Victor Taran, 2022-01-26
@shambler81

Please note that the directory does not have rwx, but three of them
rwxlinux.png
, and this is how it is live
term-ls-la.jpg
. Look, there is a user and a group, due to them you switch between groups of rights.
It is obvious that you are in the root group and you have 1 group.
In general, read about rights.
and x is run because a directory is actually a file to be run and there are no directories.
By the way, there are no files either, there are only inodes, good use of Linux;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question