1
00:00:01,470 --> 00:00:02,520
Welcome back.

2
00:00:02,550 --> 00:00:08,180
So in this lesson, we are going to see how we can give executing permissions.

3
00:00:08,190 --> 00:00:12,180
So far, we have seen the right permission, the right permission.

4
00:00:12,180 --> 00:00:19,290
We have given the permissions, we have removed the permissions, but we have not seen what are the

5
00:00:19,290 --> 00:00:21,030
execute permissions.

6
00:00:21,030 --> 00:00:21,720
All right.

7
00:00:21,720 --> 00:00:29,610
So let's quickly see how we can give and remove the execute permissions and what happens when we do

8
00:00:29,610 --> 00:00:30,120
that.

9
00:00:30,300 --> 00:00:35,100
So execute permission is denoted by X.

10
00:00:35,100 --> 00:00:39,840
So let's quickly give or remove the permissions and see what happens.

11
00:00:40,810 --> 00:00:44,750
All right, so here we have a file which is X, Y, Z.

12
00:00:44,930 --> 00:00:51,110
And here we can see the permissions which is given to the user is read, write, execute.

13
00:00:51,290 --> 00:00:53,780
The group has read, write, execute.

14
00:00:53,810 --> 00:00:56,420
Others do not have any permissions.

15
00:00:56,420 --> 00:01:02,450
So let's quickly first remove the permissions of execute for everyone.

16
00:01:02,480 --> 00:01:06,140
So that is a minus X for the file X, Y, Z.

17
00:01:07,220 --> 00:01:13,850
And now, as you can see, none of them have the execute permission.

18
00:01:14,000 --> 00:01:17,180
So now what does execute mean?

19
00:01:17,360 --> 00:01:21,650
That basically means that the file cannot be executed.

20
00:01:21,650 --> 00:01:25,250
If the file is a script, it cannot run.

21
00:01:25,250 --> 00:01:27,830
So let's quickly make this file a script.

22
00:01:27,830 --> 00:01:37,010
So let me just open it and here, let us remove everything first and let's execute two or three simple

23
00:01:37,010 --> 00:01:37,850
commands.

24
00:01:38,060 --> 00:01:41,090
So the first command that we are going to execute is equal.

25
00:01:41,600 --> 00:01:47,660
Now equal is something which is used to print something on the screen or the terminal.

26
00:01:47,660 --> 00:01:50,240
So let's say we print hi, that's it.

27
00:01:51,110 --> 00:01:56,540
And the second command that we are going to execute now is.

28
00:01:57,410 --> 00:01:58,340
Who am I?

29
00:01:58,850 --> 00:02:04,700
And the third simple command that we are going to execute is Ellis.

30
00:02:05,030 --> 00:02:11,690
So I have added semicolon in between, which is a separator between two commands.

31
00:02:11,720 --> 00:02:12,440
All right.

32
00:02:12,440 --> 00:02:14,450
So let me quickly save this.

33
00:02:15,080 --> 00:02:19,440
And now let me try to execute the file.

34
00:02:19,460 --> 00:02:23,330
So how do we execute files in Linux for that?

35
00:02:23,330 --> 00:02:27,500
We use this combination, which is dot and slash.

36
00:02:27,650 --> 00:02:30,800
So let's try to quickly execute this.

37
00:02:31,310 --> 00:02:38,990
And you can see we got an error and the error is permission denied because it is saying, right, if

38
00:02:39,000 --> 00:02:45,410
we do not have permissions given to the file, as we have seen over here, there is no X.

39
00:02:45,410 --> 00:02:48,920
That means there is no execute permission.

40
00:02:49,700 --> 00:02:50,300
All right.

41
00:02:50,300 --> 00:02:57,110
So let's quickly give the execute permission to this file and we know that how to do it, it is c,

42
00:02:57,110 --> 00:03:07,720
h mod and user plus execute permission to the file x, y, z, and now it looks perfect.

43
00:03:07,730 --> 00:03:15,710
Let's quickly verify that we have given the permissions or not and you can see the user which is root

44
00:03:15,740 --> 00:03:20,300
has the X now, which is the execute permission.

45
00:03:20,600 --> 00:03:30,170
Now let's quickly try to run the same command again and see if this time the file gets executed or not.

46
00:03:30,950 --> 00:03:35,030
Let's hope it gets executed because we have given the right permission.

47
00:03:35,030 --> 00:03:36,980
And let me just hit enter.

48
00:03:37,430 --> 00:03:38,240
Perfect.

49
00:03:38,780 --> 00:03:40,910
Our commands got executed.

50
00:03:40,910 --> 00:03:43,640
The first was equal to print.

51
00:03:43,640 --> 00:03:47,180
Hi on the screen that has got successfully executed.

52
00:03:47,210 --> 00:03:49,900
The second one was who am I?

53
00:03:49,910 --> 00:03:58,790
And yes, the user which is currently logged in as root and the third command that got executed is less

54
00:03:58,790 --> 00:04:06,110
successfully and we are able to list all the content into the current present working directory.

55
00:04:06,560 --> 00:04:08,180
So this is perfect.

56
00:04:08,180 --> 00:04:14,180
We are able to successfully give the execute permission and we are able to see how it works.

57
00:04:14,210 --> 00:04:15,660
I hope you guys understood.

58
00:04:15,680 --> 00:04:22,760
In case you have any issues, feel free to open a thread into the Q&amp;A section or feel free to ask me.

59
00:04:22,790 --> 00:04:23,510
Thank you.
