Reading, writing and executing.
So access rights to files and directories are defined in terms of read access, write access and execution
access.
So if we look at the output of the command right here and you will see here LSL here, so you will see
here that we can see, we can get some clue as how this is implemented.
So in previous lectures we learned about file attributes and the first characters is the file type.
So the file type describes the file types you are most likely to see.
And there are other less common types to do.
For example, this here.
This means a regular file.
This first attributes means here.
So let me actually write that down here and you will see what is going on here.
So the minus here means a regular file.
Regular file.
And as you can see here, some of examples.
For example, my file, my name here, this might be like my new dear back, but the name.
Just a minute.
It's actually a file.
And as you can see here, it starts with this attribute.
All of the files starts with the, uh, the regular file starts with this attributes.
We also have notice here we have a directory.
Directory here.
The IS directory.
And we also have l.
This is a symbol.
This is for the symbolic links that we learned earlier.
In this case, we don't have symbolic links and we will create that symbolic symbolic link.
See here means a character special file.
Here.
This is a character special file.
And this file type refers to a device that handles data as a stream of bytes such as terminal or dev
null.
And we also have B, the B is for a special file block, special file block, special file.
And this file types refer to a device that handles data in blocks such as hard drives or DVD drives.
So the remaining nine characters of the file attributes called the file mode here, actually let me
write that down here.
So, for example, let's take this right?
Copy this.
And here.
Oops.
Here.
Open our notepad.
And here.
So this.
This was our directory.
This is a file type directory.
And.
And others are file mode.
So these file modes represents the read, write and execute permissions here.
And actually, let me get my mark here.
Here.
So I can show you better.
Also.
Okay, so let me here.
So this D here.
So these are the file mode here.
So actually, let me write that down here.
So these are file.
Maud.
And the first letter.
The first letter represents us that the represents us.
The file type.
Yeah.
File.
Type.
As I explained, whether it is a regular file directory, symbolic link or cache spatial file or block
spatial file here.
Here.
So.
Uh, and in order to understand that here, first lecture, let me take this down right here.
So the remaining nine characters of file attributes, as I said, is the file mode.
So for the file's owner, the file's group owner or everybody else.
So in this case, for example, it's going to be like, this is for oops, actually, let's here so
one.
That's actually it will be more easier to understand right here.
So.
As I said, this is file type and all of these are.
File permission attributes.
But here the first three, the first three means owner permissions.
The next three.
Means the group permissions, which you will learn all of this about in this section.
And the last means the world that everybody else so the.
Here.
The R here.
R means read.
Read.
The W.
W means.
Execute ops, not execute.
The W means write.
And here x here means.
Execute.
So now let's explain all of this now.
So.
The R here, the R allows a file to be opened and read.
So if this r, you can see this R in a file, for example, in this case this.
Right r.
This means a lot of file to be opened and read.
But if you see this r in directories, this allows a directory contents to be listed if the execute
attribute is also set.
We also have w.
As you learned here.
So the W allows a file to be written or truncated.
However, this attribute does not allow files to be renamed or deleted.
The ability to delete or rename files is determined by directory attributes, and if you see this w
attribute in a directory, this in that in that directory allows a files within a directory to be created,
deleted and renamed here.
So here first one we learned about the file with this w and now so if you open this, if you use this
in directories, you will get gain an access to create, delete and renamed and if the execute arbitrary
is set or actually dir.
So we also have we also have let me here.
Oops.
Yeah, right.
That's actually.
We also have.
The X here.
Actually, let's delete all of this.
So the x?
Just an x.
So this x loves a file to be to.
And by the way, if you use this x in a file, a file loves a file to create a program as a create treat
as a program and execute it.
So program files written in scripting languages must also be set as a readable to be executed.
And here if you use this x in directories, this will use a low.
This is the low directory to be entered.
For example, see the my.
There.
So if you use this in directory X in directory, you can enter and in that directory here.