Linux - Set file permissions using symbolic
559 views
Nov 28, 2024
Linux - Set file permissions using symbolic
View Video Transcript
0:00
so into our previous video we have
0:02
discussed that chmod uses two type of
0:04
permission settings very first we can
0:08
set or change the permissions by using a
0:10
symbolic method that we are going to see
0:13
over here so if I'm using a symbolic
0:15
method for changing the permission I'll
0:17
be using some characters though this
0:20
particular characters are this
0:21
particular operators we shall be using
0:23
we can be used with chmod command where
0:26
I'll be using one that is my plus symbol
0:29
for adding affirmation to a file
0:31
now for example I want to add execute
0:34
permission so I'm just giving the plus X
0:37
if I want to add a write permission I'll
0:40
be using plus R or if I want to add an
0:43
read permission I will be using plus R
0:46
here we have subtract formation subtract
0:50
symbol will be used for removing a
0:52
certain formation like if already I have
0:54
some read/write/execute for my group if
0:57
I want to remove it I'll be using minus
1:00
R for everything if I want to remove
1:03
only write permission from it I'll be
1:05
using minus W that means you are just
1:08
removing a write formation if I want
1:10
remove a read permission I'll be using -
1:13
are so same way we have is equals to
1:16
equals the sign is for replacing the
1:19
complete formation now as we have seen
1:21
like plus and minus can be used for
1:24
adding or removing the formation but
1:26
what if I want to change the complete
1:28
formation at a time
1:29
in spite of adding or removing it I can
1:31
directly use equals to symbol for
1:34
changing the complete permissions at
1:36
time so let us see into the terminal how
1:40
we can use the symbolic method for
1:42
change in the formation of a file into
1:44
our Linux Shawn dekstop we have multiple
1:48
files and we can give a I'll come on to
1:50
check the formations of the files and
1:52
directory now as discussed you can see
1:55
there is a first bit when I've created a
1:57
firm they're showing me - come on even
2:01
if I create a new file
2:05
it will show me - in front of the
2:08
filename right
2:10
that means this is of a but if I create
2:12
a directory now if I am creating to
2:14
create a directory with folder - and
2:17
rest check the directory has be in front
2:22
of it right that means the first bit is
2:24
clear - means of a B means a directory
2:32
now we are going to talk about
2:34
deformations so as discussed we have the
2:37
groups of three of the spits so three
2:39
bits group we will have for the owner
2:41
permission three bits group we will have
2:43
deformation for the group
2:45
while the three bits will be assigned
2:47
for the others so basically the sequence
2:50
is fixed first free then right then
2:53
execute if you do not have execute it
2:55
will remain blank that means it will be
2:57
a -
3:02
so here in document one we have
3:06
readwrite formation to affirm that means
3:09
the trainer this is the owner of the
3:12
directory has only read and write
3:14
permission no execute now if I want to
3:17
use or if I want to add execute
3:19
permission using a symbolic way I'll be
3:21
using in such a way chmod now here you
3:26
means owner Njemanze group and omens
3:30
others
3:31
now give CH more you I want to add so
3:35
plus sign execute permissions or X so
3:39
I'm going to add owner and execute
3:42
permission for a file called as document
3:46
one let us check whether this change has
3:49
been done or not again check we have
3:52
added it right so now if suppose I want
3:56
to the write permission from here
3:59
execute has already been removed so if I
4:01
want to just remove the write permission
4:04
so I just want to define my group that
4:06
they can only read the content of home
4:08
file so I can give CH more G that is for
4:14
group - for removing a permission and
4:17
here I'm going to remove the write
4:19
formation from the same file document 1
4:22
and just have a look we have just
4:25
removed the write permission from here
4:28
right so it access only read and other
4:34
two are like that means if the group has
4:36
only read permission now same way we can
4:42
also set permissions for others now for
4:45
others if I suppose I want to define
4:47
read and execute formation so again I'll
4:49
be giving the same command chmod or for
4:54
others I want to add execute formation
4:58
for the same file document one let us
5:03
have a list and you can see if we have
5:05
just started the execute permission now
5:07
if I want to keep the all the
5:09
permissions together now for example I
5:11
want to remove write permission from the
5:14
owner
5:16
and I want to add execute permission to
5:19
the group simultaneously
5:22
I'll give the command chmod u minus W so
5:27
I'm going to remove the write permission
5:29
from the owner basically we don't do but
5:32
here I am doing for showing the
5:33
practical then into the group we are
5:36
going to add the execute permission
5:39
right so plus X and for other see I
5:42
don't want to make any changes to leave
5:44
it as this and to the file called as
5:48
document one let us check the changes it
5:51
happened now the owner has written
5:53
execute group has written execute while
5:56
we haven't made any changes into the
5:58
document though we have read an execute
6:01
now same way if I want to remove this
6:04
both read and execute from the others
6:07
let us check again we have read an
6:10
execute I want to remove both read and
6:12
execute at a time from the others I will
6:14
be giving me come on CH more o minus R
6:18
minus X from or minor are my egg ads
6:23
from document one just give and check
6:29
there is no permission to my document
6:34
one for the other users who are not into
6:37
my group as well as who is not owner
6:39
right so this is where how we can change
6:41
the directory permissions by using plus
6:44
and minus signs now also we have an
6:46
operator called as equals two we can
6:49
also use equals two to replace the
6:51
content of a file now for example I want
6:55
my user permission to set as read write
7:00
execute group formation as read and
7:04
execute so without looking to your
7:06
existing permission we can replace the
7:08
permission completely and for others I
7:11
want to set only read permission for the
7:14
same firm document one and rest check
7:18
it's changed read write execute for the
7:23
owner read and execute for the group
7:27
while others has
7:29
only read formation so this is how to
7:32
leave is a deformation using the
7:34
parameters and one more we can see if
7:37
suppose I want to set three your owner
7:40
group and others the same formation so
7:43
we can also use chmod II a means all all
7:47
means user group and others I want to
7:49
set all read write and execute formation
7:52
that to I want to give full control to
7:54
everyone so I will giving the command
7:57
document one just let us have a look on
8:01
this particular document I can see read
8:04
and execute for owner read and execute
8:06
for your crop and again read and execute
8:08
for the others so simultaneously we can
8:12
check the same permission to all three
8:14
groups so this is how we have seen how
8:17
we can use the symbolic method to change
8:20
the formation of the you know document
8:23
or a particular directory we have
8:25
created now into next video we are going
8:28
to see how we can do it by using the
8:30
octal way
#Computer Education
#Programming