Hello and welcome back to this video.
So we have seen about Linux formations, the three people, which is the user group and others to whom
the permissions are given.
Now, let us see in case we want to give some permission to someone.
How do we do that?
So let's quickly see over here.
This is the file, which is X, Y, Z.
And we have seen the permissions which are given to the user, which is read.
Right.
The group which is read and others the permission is given, which is only read.
So let's now give the permission to others of right as well.
So we have to give a permission to others.
So for that we are going to use the command C mod and we need to give the permission to whom?
To others.
So for that we have to press all because we need to give permission to others and we are giving permissions.
So we are going to write a plus in case we need to remove the permission.
Then what should we write?
Right.
We need to add a minus, but in this case we are giving permission.
So we are going to add plus and what permission we need to give of.
Right.
So we are going to use W perfect.
So now this is a very, very simple to understand.
C mode is something that you have to write.
You need to give permission to others.
So all you have to give permission.
So we are adding a permission which is denoted by plus and which permission you are giving.
It is right permission.
So W and the name of the file to which these changes need to be done.
Now this looks perfect.
Now, after we type this command, what is going to happen?
Let's see it onto the terminal.
So see mod and we need to give a permission.
So O plus w and to the file z set and hit enter and the command got executed without any error.
Let's quickly see the permissions now.
And here we can see extra w has been added which cannot be seen over here.
Now this means the permission has been successfully added to the file X, Y, Z, and now the users,
the other users can edit the file as well.
So let's quickly switch user to the user Udemy and now we are Udemy.
Let's verify that.
Who am I?
I'm the user Udemy.
And now we have the right permission as well.
So let's really read first.
So read, get x, y, z and we can see we are able to read it.
Let's quickly modify it using Nano and let's write.
This is modified by Udemy, let's try to save it and we are successfully able to save it.
Let's see if our changes are successfully saved.
And you can see this is modified by Jeremy.
Let's verify again.
Let's try to read this file by the user route.
And yes, we are able to successfully see the changes that has been done into the file by the other
user, which is Udemy.
Perfect.
So now we know how to give permissions.
So I hope you guys understood how you can give permissions to any user.
So in case you want to give permission to a group for that, you're using the symbol G plus which permission
you need to give, read, write, execute and the file name.
Similarly, you want to give some permission to the user who has created the file.
So let's say you plus RW, X and x, y, z.
Let's try to see it over here.
Let's try to see the first the permissions, and let's give all the permissions to the user.
So you plus RW X and the file name, let's see the permission now and you can see, read, write, execute
is the permission which is given to the user.
So now all the permissions are being given to the user.
The group has the right permission and others have RE-ITERATE permission.
Now, in case you want to give all the permissions to everyone, all the three categories of people,
which is the user group and others, for that you simply need to write c mod a a means all and what
permission.
You need to give all the permissions.
So you can do it this way.
Let's try to see the permissions now and you can see RW X, RW X and RW X.
Now all the permissions are given to the user group and others.
Perfect.
Now you must be wondering, what does this hyphen represent?
This basically represents, in this case, nothing that this is a file in case it is a directory.
There would have been a D over there which represents that.
This is a directory and it is not a file.
That's it.
So I hope you guys understood this.
How you can add permissions in the next lesson, we are going to see how you can remove permissions.
Thank you.