1

I want to know the meaning of these strings drwxr-xr-x and drwxrwxr- that appear in the terminal.

Zanna
  • 70,465
Mower
  • 19
  • 1
  • 1
  • 2

1 Answers1

5

Those are the file access privileges.

The first character d tells you that it's a directory and not a regular file.

The next 3 characters tells you that the owner has write, read, and 'traverse' privileges on this directory.

The next 3 are the permissions for group ownership. Anyone that belongs to the group has the privileges that are shown in these 3 characters. In this case, the r-x means that anyone belonging to the group can read and traverse the directory(s) but cannot write to them.

The final three characters are permissions for anybody else. Here again this says that anyone can read and traverse directory(ies) but not write to them.

The 'x' on a directory does not refer to execute. The 'x' bit has a different meaning. "You cannot traverse the directory if the x bit is not set" but that's so confusing. Best to see what happens when you try. With a directory z with file y in it and x bit set, you can do an

ls z

and see y. You can do an

ls -l z

and see y's information. You can

cd z

With 'x' bit not set, and you do an

 ls z

you see that y is there but get

ls: cannot access 'z/y': Permission denied

When you do

ls -l z

you get the same error message but see a line that looks like

-????????? ? ? ? ? ? y

i.e. you cannot see anything but the file name. You also cannot

cd z
jpezz
  • 1,120