WEBVTT - This file was automatically generated by VIMEO

0
00:00:05.600 --> 00:00:08.600
Welcome back. So in this lesson, we are

1
00:00:08.600 --> 00:00:12.100
 going to see how we can give executing permissions

2
00:00:11.100 --> 00:00:14.200
 so far. We have seen the

3
00:00:14.200 --> 00:00:17.400
 read permission the right permission. We have given the

4
00:00:17.400 --> 00:00:20.800
 permissions we have removed the permissions, but

5
00:00:20.800 --> 00:00:23.200
 we have not seen what are the

6
00:00:23.200 --> 00:00:26.400
 execute permissions? All right. So let's

7
00:00:26.400 --> 00:00:29.700
 quickly see how we can give and remove the

8
00:00:29.700 --> 00:00:32.600
 execute permissions and what happens

9
00:00:32.600 --> 00:00:36.600
 when we do that so execute permission

10
00:00:35.600 --> 00:00:38.700
 is denoted by X.

11
00:00:38.700 --> 00:00:41.800
 So, let's quickly give or remove

12
00:00:41.800 --> 00:00:43.500
 the permissions and see what happens.

13
00:00:45.100 --> 00:00:48.800
All right. So here we have a file which is XY said

14
00:00:48.800 --> 00:00:52.000
 and here we can see the permissions which

15
00:00:51.100 --> 00:00:55.100
 is given to the user is read write execute.

16
00:00:54.100 --> 00:00:57.700
 The group has read write execute

17
00:00:57.700 --> 00:01:00.800
 others do not have any permissions. So

18
00:01:00.800 --> 00:01:03.600
 let's quickly first remove the permissions of

19
00:01:03.600 --> 00:01:06.900
 execute for everyone. So

20
00:01:06.900 --> 00:01:09.300
 that is a minus X for the file

21
00:01:09.300 --> 00:01:10.200
 XY said

22
00:01:11.400 --> 00:01:14.800
And now as you can see, none of

23
00:01:14.800 --> 00:01:17.800
 them have the execute permission.

24
00:01:18.400 --> 00:01:21.800
So now what does execute mean that

25
00:01:21.800 --> 00:01:24.400
 basically means that the file cannot

26
00:01:24.400 --> 00:01:28.000
 be executed if the file is a script it

27
00:01:27.300 --> 00:01:30.400
 cannot run. So let's quickly make

28
00:01:30.400 --> 00:01:33.200
 this file a script. So let me just open it.

29
00:01:34.100 --> 00:01:38.300
And here let us remove everything first and let's

30
00:01:37.300 --> 00:01:40.500
 execute two or three

31
00:01:40.500 --> 00:01:43.300
 simple commands. So the First Command that

32
00:01:43.300 --> 00:01:45.100
 we are going to execute is Eco.

33
00:01:45.800 --> 00:01:48.900
Now Eco is something which is used to print

34
00:01:48.900 --> 00:01:51.100
 something on the screen or The

35
00:01:51.100 --> 00:01:54.300
 Terminal. So let's say we print high that's it.

36
00:01:55.400 --> 00:01:59.200
And the second command that we are going to execute now

37
00:01:58.200 --> 00:02:00.100
 is

38
00:02:01.400 --> 00:02:02.100
who am I?

39
00:02:03.100 --> 00:02:07.600
And the third simple command that we are going to execute is

40
00:02:06.600 --> 00:02:08.600
 LS.

41
00:02:09.300 --> 00:02:12.300
So I have added semicolon in between

42
00:02:12.300 --> 00:02:16.100
 which is a separator between two commands. All

43
00:02:15.100 --> 00:02:18.200
 right, so let me quickly save this.

44
00:02:19.300 --> 00:02:23.200
And now let me try to execute the

45
00:02:22.200 --> 00:02:25.900
 file. So how do we execute files

46
00:02:25.900 --> 00:02:28.700
 in Linux for that? We use this combination,

47
00:02:28.700 --> 00:02:32.100
 which is Dot and slash. So

48
00:02:31.100 --> 00:02:34.600
 let's try to quickly execute this.

49
00:02:35.500 --> 00:02:38.600
And you can see we got a error and the error

50
00:02:38.600 --> 00:02:42.100
 is permission denied because it

51
00:02:41.100 --> 00:02:45.200
 is saying right we do not have permissions given

52
00:02:45.200 --> 00:02:48.500
 to the file as we have seen over here. There is no

53
00:02:48.500 --> 00:02:52.900
 X that means there is no execute permission.

54
00:02:53.800 --> 00:02:57.100
All right. So let's quickly give the execute permission

55
00:02:56.100 --> 00:02:59.300
 to this file and we know that how to

56
00:02:59.300 --> 00:03:03.800
 do it which is chmod and user

57
00:03:02.800 --> 00:03:06.400
 plus execute permission

58
00:03:05.400 --> 00:03:09.100
 to the file x y z

59
00:03:08.100 --> 00:03:11.500
 and now it looks perfect.

60
00:03:11.500 --> 00:03:14.500
 Let's quickly verify that we have given

61
00:03:14.500 --> 00:03:17.200
 the permissions or not and you can

62
00:03:17.200 --> 00:03:20.800
 see the user which is root has the

63
00:03:20.800 --> 00:03:24.200
 X now, which is the execute permission.

64
00:03:24.800 --> 00:03:27.400
Now, let's quickly try to run

65
00:03:27.400 --> 00:03:30.900
 the same command again and see if this

66
00:03:30.900 --> 00:03:33.900
 time the file gets executed or

67
00:03:33.900 --> 00:03:34.100
 not.

68
00:03:35.100 --> 00:03:38.300
Let's hope it gets executed because we have given the

69
00:03:38.300 --> 00:03:40.800
 right permission and let me just hit enter.

70
00:03:41.600 --> 00:03:41.900
Perfect.

71
00:03:42.900 --> 00:03:45.600
Our commands got executed. The first

72
00:03:45.600 --> 00:03:48.400
 was Eco to print high on

73
00:03:48.400 --> 00:03:51.900
 the screen that has got successfully executed. The second

74
00:03:51.900 --> 00:03:55.100
 one was who am I and yes,

75
00:03:54.100 --> 00:03:57.800
 the user which is currently logged

76
00:03:57.800 --> 00:04:00.400
 in as root and the third command

77
00:04:00.400 --> 00:04:04.300
 that got executed is LS successfully and

78
00:04:03.300 --> 00:04:06.700
 we are able to list all the content

79
00:04:06.700 --> 00:04:10.200
 into the current present working directory.

80
00:04:10.800 --> 00:04:14.200
So this is perfect. We are able to successfully give

81
00:04:13.200 --> 00:04:16.400
 the execute permission and we

82
00:04:16.400 --> 00:04:19.700
 are able to see how it works. I hope you guys understood

83
00:04:19.700 --> 00:04:22.300
 in case you have any issues. Feel free

84
00:04:22.300 --> 00:04:25.800
 to open a thread into the Q&A section, or

85
00:04:25.800 --> 00:04:27.300
 feel free to ask me. Thank you.
