File/Directory Access modes:
Read(r) = 4
Write(w) = 2
Execute(x) = 1
You can see, above access modes can be interpreted with numbers.
Let's say for a file we give permissions like
Owner --> rwx
group --> r-x (no write)
others--> r-- (only read)
touch TEST
ls -l --> long listing of current directory properties.
It will show file permissions also.
The output will be like
-rw-rw-r-- 1 user user 0 Feb 2 14:18 TEST
Output details:
permissions = -rw-rw-r--
owner = user
group = user
File size = 0
TEST = File or Folder name
So, the complete permission set is shown as
drwxr-xr-x --> 9+1 characters.
First letter represents it as directory.If no d, like (-) then its a file.
From the 2nd letter on-wards, group them into 3 letters each for the permissions of owner,group and others respectively.
Read(r) = 4
Write(w) = 2
Execute(x) = 1
You can see, above access modes can be interpreted with numbers.
Let's say for a file we give permissions like
Owner --> rwx
group --> r-x (no write)
others--> r-- (only read)
touch TEST
ls -l --> long listing of current directory properties.
It will show file permissions also.
The output will be like
-rw-rw-r-- 1 user user 0 Feb 2 14:18 TEST
Output details:
permissions = -rw-rw-r--
owner = user
group = user
File size = 0
TEST = File or Folder name
So, the complete permission set is shown as
drwxr-xr-x --> 9+1 characters.
First letter represents it as directory.If no d, like (-) then its a file.
From the 2nd letter on-wards, group them into 3 letters each for the permissions of owner,group and others respectively.
No comments:
Post a Comment