Hi, everyone.
So in this lesson we are going to understand the command, which is c h group.
So C, H group command is used to change the group ownership of any file or directory.
As we know in Linux, we have users and groups that have been given to any specific file or folder with
this directory.
The command is very simple.
You can just simplify C group, the group name that you want to give to any specific file name or the
directory name.
We will also see how you can use C group to recursively give ownership to a new group to any specific
files in a directory.
So it's the practical time.
And let's see the practical.
I'm onto my terminal right now.
I have created a folder called a C Group.
Inside.
You can see there is one directory called s, d, r one and two files called S file one, file two.
So for the file one, you can see the group is root.
I'm changing the group to hack to file for file one.
Let us see the permissions once again.
And you can see the group has successfully changed from root to hack to file.
Let us do the same thing for directory one.
This time I'm changing the group to Curly for directory one.
Let's again see the permissions and we can see successfully for directory one.
The group has been changed to Curly.
Let's go inside the directory and let's see files.
There are two files called this.
File one and file two.
Unfortunately, the group has not been changed for these files, which means whenever we give any change
group command to a new ownership group, it will not recursively change the group for the files.
So for this we are going to use hyphen R, which stands for recursive and let's change group Kali for
all the files.
Let's run the command and see and you can see successfully.
We are able to change the group ownership for all the files inside any directory recursively.
Thank you.