1
00:00:00,750 --> 00:00:05,160
Was check what permission are said for our script.

2
00:00:05,160 --> 00:00:15,540
Firstly I will clear the screen and then using as Desch L command a list and dedicatory dish out is

3
00:00:15,600 --> 00:00:24,110
argument to outlasts command and it shows us our extended information about files and directories such

4
00:00:24,110 --> 00:00:31,430
as permission and ownership because we don't want to display extended information about all files in

5
00:00:31,430 --> 00:00:32,930
the current directory.

6
00:00:33,080 --> 00:00:38,990
And we can use another argument to ask someone to specify the file.

7
00:00:39,020 --> 00:00:43,600
It means that we will see information only about that file.

8
00:00:44,090 --> 00:00:47,360
So I am typing out as.

9
00:00:47,750 --> 00:00:49,370
And the name of our script

10
00:00:54,560 --> 00:00:59,240
now you see on the informations about our script but doesn't it.

11
00:00:59,240 --> 00:01:06,430
Permission means in Unix like systems the permissions of files are divided into three categories.

12
00:01:06,740 --> 00:01:11,410
First category means permission for owner of that file.

13
00:01:12,520 --> 00:01:19,440
Second category is group permission and it tells us that all users of that group will have following

14
00:01:19,450 --> 00:01:21,100
permissions.

15
00:01:21,100 --> 00:01:28,280
So the category is for the others which are not part of first two categories.

16
00:01:28,700 --> 00:01:39,090
But let's quickly talk about characteris permission field araw means that it's permission to read permission

17
00:01:39,540 --> 00:01:41,440
then read that file.

18
00:01:42,670 --> 00:01:50,010
W means write permission where it can write to that file without the right permission.

19
00:01:50,140 --> 00:02:00,470
We couldn't even create our first script X means execute permission and whoever has it together with

20
00:02:00,540 --> 00:02:07,050
the permission then can execute that script if we want to change file permissions.

21
00:02:07,110 --> 00:02:12,340
We need to use change mode command by typing change mode.

22
00:02:12,740 --> 00:02:21,190
A plus X followed by the screen name we granting execute permissions for all users.

23
00:02:21,300 --> 00:02:31,400
He had a correct means for all three categories change permissions plus X means a grand exit but emissions

24
00:02:32,570 --> 00:02:40,070
by typing ls command we can ensure that exec permissions has been added.

25
00:02:40,160 --> 00:02:50,430
If you want to move permissions we can use the same command except for a plus sign we use mimes.

26
00:02:50,560 --> 00:02:54,190
Here we can see that execute permissions is missing.

27
00:03:00,990 --> 00:03:02,920
Just for the recap type.

28
00:03:02,940 --> 00:03:04,400
The exact same commands.

29
00:03:04,450 --> 00:03:08,380
Unsure what changes are made to file permissions.

30
00:03:41,650 --> 00:03:45,690
Do remember how I told you about three permissions categories.

31
00:03:45,940 --> 00:03:52,300
We can't of course change permissions only for specific category but start with the file owner by typing

32
00:03:52,380 --> 00:03:54,980
changement you plus x.

33
00:03:55,000 --> 00:03:59,800
I will change permissions only for the file owner.

34
00:03:59,830 --> 00:04:07,960
Here we can see that execute permissions for file owner is present.

35
00:04:08,110 --> 00:04:12,680
Now we also change permissions for a group file owner.

36
00:04:12,760 --> 00:04:16,570
We will do that by typing changement

37
00:04:19,880 --> 00:04:21,620
G plus X

38
00:04:25,820 --> 00:04:35,960
by typing ls command we can see that execute permission is present here to change permission for others

39
00:04:36,190 --> 00:04:44,150
we'll use changement all plus X by typing ls command.

40
00:04:44,370 --> 00:04:51,650
We can see that ex-secret permission is also valid for others.

41
00:04:53,880 --> 00:04:59,580
It is also possible to change permission using numeric value Rait permission represents.

42
00:04:59,580 --> 00:05:01,830
Number four write permission.

43
00:05:01,950 --> 00:05:02,760
Represent.

44
00:05:02,820 --> 00:05:07,530
Number two execute permission represents value 1.

45
00:05:07,800 --> 00:05:14,690
For example if you want to put forth file only the maximum permissions it voodoo represents number 7.

46
00:05:15,090 --> 00:05:22,330
And if you want to give someone only three permissions it would be the number for number six would then

47
00:05:22,340 --> 00:05:24,590
I represent possibility to read.

48
00:05:24,630 --> 00:05:32,160
And right now by typing Chaiyaphum thought 644.

49
00:05:32,460 --> 00:05:41,150
I am removing execute permissions from our script and we can see it right now

50
00:05:46,060 --> 00:05:53,720
if I want to grant back exec with permission I would type change mode 7 5.

51
00:05:54,550 --> 00:06:00,180
And by that I am granting again exec permission.

52
00:06:01,120 --> 00:06:07,810
Throughout the course I will be mostly using changement a class X which is granting execute permission

53
00:06:07,810 --> 00:06:08,850
for everyone.

54
00:06:09,040 --> 00:06:14,780
So if you remember only that it is enough for you and you are good to go.

55
00:06:14,800 --> 00:06:22,270
We have now said the permissions so we can finally run the script to do so type dot slash followed by

56
00:06:22,280 --> 00:06:31,720
the script name and it's running great but what does dot slash means by typing that we are telling that

57
00:06:31,750 --> 00:06:36,660
we will invoke descript in current directory.

58
00:06:36,700 --> 00:06:42,570
This is the most common way to run the script but there is another option to use or pop.

59
00:06:42,790 --> 00:06:53,240
We just prepend the output of B W D command before our script name.

60
00:06:53,260 --> 00:06:58,940
Another option how to run the script is by editing and vitamine variable called Pop.

61
00:06:58,950 --> 00:07:03,990
We can display content of Foth variable using echo command.

62
00:07:04,230 --> 00:07:10,530
If the directory that the script is located is included in the variable path we can invoke the script

63
00:07:10,620 --> 00:07:15,250
only by typing its name to add something to pop.

64
00:07:15,360 --> 00:07:17,340
The use command export

65
00:07:20,810 --> 00:07:24,080
Export pop echo

66
00:07:27,500 --> 00:07:37,040
Dallara pop call on and for part two directory that the is located.

67
00:07:37,040 --> 00:07:45,000
If we are now at the directory where script is located we can use command B W D instead.

68
00:07:45,050 --> 00:07:49,250
Now I can see that home Richard was added to pop.

69
00:07:49,250 --> 00:07:53,540
Great now I can run the script only by calling it name.

70
00:07:53,560 --> 00:08:00,990
I check it and it's working perfectly to check that it is working from everywhere.

71
00:08:01,010 --> 00:08:05,190
I will switch to another directory and call script again.

72
00:08:11,630 --> 00:08:12,680
It is working.

73
00:08:12,950 --> 00:08:17,960
But here I can see that output of our command is not to display.

74
00:08:18,080 --> 00:08:22,220
It's because in my current directory there is nothing to display.

75
00:08:22,220 --> 00:08:26,980
So switching to some not empty directory should be enough

76
00:08:30,960 --> 00:08:36,370
so I will go once the back and switch to another directory.

77
00:08:48,760 --> 00:08:52,520
Now I can see also the output of ls command.
