Hey, welcome back.
So now we are going to see how we can remove permissions in Linux.
All right.
So in the previous lesson, we have seen how to add permissions.
Removing permissions is exactly the same way.
It's very, very simple.
So as we can see over here, what are the permissions given to the file?
X, Y, Z.
We can see we have given all the permissions to everyone.
So let's quickly now remove the permissions for others, which is.
Oh, right.
So for that, we are going to write C mod and O minus because we need to remove permissions this time
for others and which permissions.
So let's try to remove all the permissions.
So minus W, X and for the file X, Y, Z.
So let's quickly write this C mod or minus r w, x for x, y, z.
And let's quickly see the permissions now.
And you can see there are three dots or three hyphens, which basically means that there is no permission
which has been given to the file X, Y, Z.
And we have successfully removed all the permissions of read, write and execute.
Now let's quickly verify this.
So let me switch user to Udemy and we have switched the user.
Now let's try to read this file.
So Cat X, Y, Z, and according to the permissions that we have given, we should not be able to read
the file.
So let's try and verify this.
So let me just press enter and let's see what is the output that we get and correct.
It says permission denied because there is no read permission which has been given to this file.
Perfect.
Let's try to write it.
And for obvious reasons, we are going to get the same error, which is permission denied.
Let's verify this and you can see the error, which is permission denied.
We can neither read or write.
Also, we cannot execute it.
Perfect.
Let's go back and let's try to read the file with the root user.
And we are able to read the file because the root user currently has all the permissions, as we can
see over here.
So I hope you guys understood how you can remove permissions for user group and others.
Thank you.