WEBVTT

00:00.500 --> 00:02.630
Reading, writing and executing.

00:02.630 --> 00:11.240
So access rights to files and directories are defined in terms of read access, write access and execution

00:11.240 --> 00:11.870
access.

00:11.870 --> 00:19.670
So if we look at the output of the command right here and you will see here LSL here, so you will see

00:19.670 --> 00:25.640
here that we can see, we can get some clue as how this is implemented.

00:25.640 --> 00:32.540
So in previous lectures we learned about file attributes and the first characters is the file type.

00:33.550 --> 00:37.690
So the file type describes the file types you are most likely to see.

00:37.690 --> 00:41.170
And there are other less common types to do.

00:41.170 --> 00:43.360
For example, this here.

00:43.390 --> 00:45.100
This means a regular file.

00:45.280 --> 00:47.650
This first attributes means here.

00:47.650 --> 00:54.130
So let me actually write that down here and you will see what is going on here.

00:54.130 --> 00:59.540
So the minus here means a regular file.

00:59.570 --> 01:01.900
Regular file.

01:01.900 --> 01:03.820
And as you can see here, some of examples.

01:03.820 --> 01:09.340
For example, my file, my name here, this might be like my new dear back, but the name.

01:09.340 --> 01:10.230
Just a minute.

01:10.390 --> 01:11.410
It's actually a file.

01:11.410 --> 01:15.490
And as you can see here, it starts with this attribute.

01:15.880 --> 01:21.580
All of the files starts with the, uh, the regular file starts with this attributes.

01:21.610 --> 01:26.230
We also have notice here we have a directory.

01:27.260 --> 01:28.670
Directory here.

01:30.210 --> 01:33.060
The IS directory.

01:35.670 --> 01:37.280
And we also have l.

01:37.380 --> 01:38.810
This is a symbol.

01:38.820 --> 01:41.850
This is for the symbolic links that we learned earlier.

01:41.850 --> 01:48.960
In this case, we don't have symbolic links and we will create that symbolic symbolic link.

01:50.040 --> 01:54.000
See here means a character special file.

01:55.050 --> 01:55.620
Here.

01:55.650 --> 02:00.510
This is a character special file.

02:00.510 --> 02:08.880
And this file type refers to a device that handles data as a stream of bytes such as terminal or dev

02:08.880 --> 02:09.540
null.

02:09.540 --> 02:17.340
And we also have B, the B is for a special file block, special file block, special file.

02:17.340 --> 02:24.180
And this file types refer to a device that handles data in blocks such as hard drives or DVD drives.

02:24.180 --> 02:30.330
So the remaining nine characters of the file attributes called the file mode here, actually let me

02:30.330 --> 02:31.890
write that down here.

02:31.890 --> 02:35.760
So, for example, let's take this right?

02:36.740 --> 02:37.670
Copy this.

02:38.690 --> 02:39.530
And here.

02:39.570 --> 02:39.960
Oops.

02:40.940 --> 02:41.480
Here.

02:41.480 --> 02:42.820
Open our notepad.

02:42.830 --> 02:43.910
And here.

02:44.090 --> 02:45.260
So this.

02:45.530 --> 02:47.750
This was our directory.

02:48.050 --> 02:50.150
This is a file type directory.

02:50.150 --> 02:50.720
And.

02:51.110 --> 02:54.570
And others are file mode.

02:54.590 --> 03:01.130
So these file modes represents the read, write and execute permissions here.

03:01.130 --> 03:03.750
And actually, let me get my mark here.

03:03.760 --> 03:04.220
Here.

03:04.220 --> 03:06.080
So I can show you better.

03:07.630 --> 03:08.160
Also.

03:11.050 --> 03:14.440
Okay, so let me here.

03:14.440 --> 03:16.810
So this D here.

03:21.180 --> 03:25.590
So these are the file mode here.

03:25.590 --> 03:28.230
So actually, let me write that down here.

03:28.230 --> 03:31.290
So these are file.

03:32.090 --> 03:32.900
Maud.

03:34.720 --> 03:37.120
And the first letter.

03:37.150 --> 03:41.710
The first letter represents us that the represents us.

03:41.710 --> 03:43.180
The file type.

03:43.750 --> 03:44.220
Yeah.

03:44.230 --> 03:45.220
File.

03:47.250 --> 03:47.880
Type.

03:48.240 --> 03:54.660
As I explained, whether it is a regular file directory, symbolic link or cache spatial file or block

03:54.660 --> 03:55.710
spatial file here.

03:56.890 --> 03:57.550
Here.

03:58.740 --> 03:59.430
So.

04:00.470 --> 04:07.960
Uh, and in order to understand that here, first lecture, let me take this down right here.

04:07.970 --> 04:12.500
So the remaining nine characters of file attributes, as I said, is the file mode.

04:12.590 --> 04:16.460
So for the file's owner, the file's group owner or everybody else.

04:16.460 --> 04:24.020
So in this case, for example, it's going to be like, this is for oops, actually, let's here so

04:24.500 --> 04:25.430
one.

04:30.180 --> 04:33.090
That's actually it will be more easier to understand right here.

04:33.090 --> 04:33.810
So.

04:34.570 --> 04:39.610
As I said, this is file type and all of these are.

04:42.010 --> 04:43.450
File permission attributes.

04:43.450 --> 04:50.170
But here the first three, the first three means owner permissions.

04:50.380 --> 04:52.030
The next three.

04:53.170 --> 04:58.720
Means the group permissions, which you will learn all of this about in this section.

04:58.720 --> 05:05.680
And the last means the world that everybody else so the.

05:06.890 --> 05:07.490
Here.

05:07.490 --> 05:09.550
The R here.

05:09.590 --> 05:11.990
R means read.

05:12.730 --> 05:13.570
Read.

05:14.880 --> 05:17.310
The W.

05:18.130 --> 05:20.140
W means.

05:21.270 --> 05:23.780
Execute ops, not execute.

05:23.790 --> 05:25.650
The W means write.

05:28.060 --> 05:32.350
And here x here means.

05:35.690 --> 05:36.440
Execute.

05:44.550 --> 05:48.000
So now let's explain all of this now.

05:48.000 --> 05:48.810
So.

05:50.810 --> 05:59.630
The R here, the R allows a file to be opened and read.

06:00.080 --> 06:06.770
So if this r, you can see this R in a file, for example, in this case this.

06:07.130 --> 06:08.520
Right r.

06:08.600 --> 06:11.770
This means a lot of file to be opened and read.

06:11.780 --> 06:18.140
But if you see this r in directories, this allows a directory contents to be listed if the execute

06:18.140 --> 06:20.030
attribute is also set.

06:20.060 --> 06:22.360
We also have w.

06:24.650 --> 06:26.090
As you learned here.

06:26.090 --> 06:32.410
So the W allows a file to be written or truncated.

06:32.420 --> 06:36.220
However, this attribute does not allow files to be renamed or deleted.

06:36.230 --> 06:45.260
The ability to delete or rename files is determined by directory attributes, and if you see this w

06:45.260 --> 06:52.190
attribute in a directory, this in that in that directory allows a files within a directory to be created,

06:52.190 --> 06:54.440
deleted and renamed here.

06:54.440 --> 07:04.010
So here first one we learned about the file with this w and now so if you open this, if you use this

07:04.040 --> 07:13.280
in directories, you will get gain an access to create, delete and renamed and if the execute arbitrary

07:13.280 --> 07:17.570
is set or actually dir.

07:18.800 --> 07:24.870
So we also have we also have let me here.

07:28.020 --> 07:28.290
Oops.

07:28.290 --> 07:28.950
Yeah, right.

07:28.980 --> 07:29.820
That's actually.

07:32.460 --> 07:34.200
We also have.

07:34.680 --> 07:35.790
The X here.

07:35.790 --> 07:37.150
Actually, let's delete all of this.

07:37.170 --> 07:38.580
So the x?

07:38.580 --> 07:39.690
Just an x.

07:40.110 --> 07:44.500
So this x loves a file to be to.

07:44.520 --> 07:54.420
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

07:54.420 --> 07:55.950
as a program and execute it.

07:55.950 --> 08:03.300
So program files written in scripting languages must also be set as a readable to be executed.

08:03.300 --> 08:09.150
And here if you use this x in directories, this will use a low.

08:09.180 --> 08:11.700
This is the low directory to be entered.

08:11.700 --> 08:15.690
For example, see the my.

08:17.290 --> 08:17.740
There.

08:18.880 --> 08:27.220
So if you use this in directory X in directory, you can enter and in that directory here.
