WEBVTT - This file was automatically generated by VIMEO

0
00:00:05.400 --> 00:00:06.100
Hi, everyone.

1
00:00:06.800 --> 00:00:09.800
So in this lesson, we are going to understand the

2
00:00:09.800 --> 00:00:12.600
 command which is CH group. So CH

3
00:00:12.600 --> 00:00:15.600
 group command is used to change the group ownership of

4
00:00:15.600 --> 00:00:17.600
 any file or directory.

5
00:00:18.600 --> 00:00:21.800
As we know in Linux we have users

6
00:00:21.800 --> 00:00:24.500
 and groups that have been given to any specific

7
00:00:24.500 --> 00:00:27.100
 file or folder, which is directory.

8
00:00:28.800 --> 00:00:32.000
The command is very simple. You can just simplify CH

9
00:00:31.400 --> 00:00:34.200
 group the group name that you want

10
00:00:34.200 --> 00:00:37.700
 to give to any specific file name or the directory

11
00:00:37.700 --> 00:00:37.900
 name.

12
00:00:39.300 --> 00:00:42.500
We will also see how you can use CH group to

13
00:00:42.500 --> 00:00:45.600
 recursively give ownership to

14
00:00:45.600 --> 00:00:48.600
 a new group to any specific files in

15
00:00:48.600 --> 00:00:49.700
 a directory.

16
00:00:51.700 --> 00:00:54.800
So it's the Practical time and let's see the practical.

17
00:00:56.900 --> 00:00:59.400
I want to my terminal right now. I have created

18
00:00:59.400 --> 00:01:01.900
 a folder called a CH group.

19
00:01:03.400 --> 00:01:06.800
inside you can see there is one directory called

20
00:01:06.800 --> 00:01:09.400
 as di are one and two files

21
00:01:09.400 --> 00:01:11.000
 called as file one file to

22
00:01:12.300 --> 00:01:15.600
So for the file one, you can see the group is root. I'm

23
00:01:15.600 --> 00:01:18.400
 changing the group to hackedify for file 1.

24
00:01:19.400 --> 00:01:22.000
Let us see the permissions once again and you can

25
00:01:22.300 --> 00:01:25.400
 see the group has successfully changed from root

26
00:01:25.400 --> 00:01:26.600
 to hacktify.

27
00:01:28.200 --> 00:01:31.500
Let us do the same thing for directory 1 this time.

28
00:01:32.200 --> 00:01:35.200
I'm changing the group to Kali for directory 1.

29
00:01:36.100 --> 00:01:40.000
Let's again see the permissions and we can see successfully

30
00:01:39.300 --> 00:01:42.300
 for directory one. The group has

31
00:01:42.300 --> 00:01:44.100
 been changed to Kali.

32
00:01:45.500 --> 00:01:48.800
Let's go inside the directory and let's see files.

33
00:01:49.500 --> 00:01:52.200
There are two files called as file 1 and file 2

34
00:01:53.900 --> 00:01:56.400
Unfortunately, the group has not been changed for

35
00:01:56.400 --> 00:01:59.300
 these files. Which means whenever we

36
00:01:59.300 --> 00:02:02.000
 give any change group command.

37
00:02:02.900 --> 00:02:05.500
To a new ownership group. It will

38
00:02:05.500 --> 00:02:09.300
 not recursively change the group

39
00:02:08.300 --> 00:02:10.600
 for the files.

40
00:02:11.500 --> 00:02:15.000
So for this we are going to use hyphen R which

41
00:02:14.300 --> 00:02:17.500
 stands for recursive and let's change

42
00:02:17.500 --> 00:02:20.100
 group Kali for all the files.

43
00:02:21.100 --> 00:02:24.600
Let's run the command and see and you can see successfully we

44
00:02:24.600 --> 00:02:27.700
 are able to change the group ownership for

45
00:02:27.700 --> 00:02:31.200
 all the files inside any directory recursively.

46
00:02:30.200 --> 00:02:32.200
 Thank you.
