1 00:00:01,380 --> 00:00:02,400 Hi, everyone. 2 00:00:02,670 --> 00:00:07,920 So in this lesson we are going to understand the command, which is c h group. 3 00:00:07,920 --> 00:00:13,710 So C, H group command is used to change the group ownership of any file or directory. 4 00:00:14,580 --> 00:00:22,380 As we know in Linux, we have users and groups that have been given to any specific file or folder with 5 00:00:22,380 --> 00:00:23,400 this directory. 6 00:00:24,810 --> 00:00:26,250 The command is very simple. 7 00:00:26,250 --> 00:00:33,000 You can just simplify C group, the group name that you want to give to any specific file name or the 8 00:00:33,000 --> 00:00:33,990 directory name. 9 00:00:34,920 --> 00:00:43,860 We will also see how you can use C group to recursively give ownership to a new group to any specific 10 00:00:43,860 --> 00:00:45,750 files in a directory. 11 00:00:47,730 --> 00:00:49,260 So it's the practical time. 12 00:00:49,260 --> 00:00:51,060 And let's see the practical. 13 00:00:52,860 --> 00:00:54,610 I'm onto my terminal right now. 14 00:00:54,630 --> 00:00:58,050 I have created a folder called a C Group. 15 00:00:59,330 --> 00:01:00,080 Inside. 16 00:01:00,080 --> 00:01:07,100 You can see there is one directory called s, d, r one and two files called S file one, file two. 17 00:01:08,120 --> 00:01:11,130 So for the file one, you can see the group is root. 18 00:01:11,150 --> 00:01:14,480 I'm changing the group to hack to file for file one. 19 00:01:15,440 --> 00:01:17,390 Let us see the permissions once again. 20 00:01:17,390 --> 00:01:22,610 And you can see the group has successfully changed from root to hack to file. 21 00:01:23,990 --> 00:01:26,810 Let us do the same thing for directory one. 22 00:01:26,810 --> 00:01:31,400 This time I'm changing the group to Curly for directory one. 23 00:01:32,090 --> 00:01:37,310 Let's again see the permissions and we can see successfully for directory one. 24 00:01:37,310 --> 00:01:40,070 The group has been changed to Curly. 25 00:01:41,480 --> 00:01:44,960 Let's go inside the directory and let's see files. 26 00:01:45,410 --> 00:01:46,790 There are two files called this. 27 00:01:46,790 --> 00:01:48,410 File one and file two. 28 00:01:48,980 --> 00:01:56,930 Unfortunately, the group has not been changed for these files, which means whenever we give any change 29 00:01:56,930 --> 00:02:06,920 group command to a new ownership group, it will not recursively change the group for the files. 30 00:02:07,430 --> 00:02:15,020 So for this we are going to use hyphen R, which stands for recursive and let's change group Kali for 31 00:02:15,020 --> 00:02:16,370 all the files. 32 00:02:17,120 --> 00:02:20,270 Let's run the command and see and you can see successfully. 33 00:02:20,270 --> 00:02:27,440 We are able to change the group ownership for all the files inside any directory recursively. 34 00:02:27,890 --> 00:02:28,580 Thank you.