This entry will show you how to change the file permission using terminal.
First of all you need to run "ls -l" to see the file attribute.
notice that the first lining of the list.
drwxr-xr-x 2 soap soap 4096 2011-11-21 20:01 Dictionary
-rw-r--r-- 1 soap soap 0 2011-11-21 20:00 toor
actually the result is divided by 3 part.But we will focused on drwxr-xr-x first.
d------>this mean that the item is directory
rwx----->this indicate for read and write permission.
notice that the sequence.
drwxr-xr-x is actually (type)(root)(user)(other)
the root got full permission thus it marked as "rwx" while user got read and execute permission and marked as "r-x".Other user got same permission as the user and marked as "r-x".If you combine all of them and then drwxr-xr-x is formed.Actually r,w and x each of them carry their own value.
r=4
w=2
x=1
lets consider this table.
see that.The trick here is very simple.consider the root got all permission,user got read and execute permission while other got read permission.Now root have the value as 7,user got 5 and other got 4.
how to change it?we simply type this command.
"chmod [root value][user value][other value] [file name]"
as an example regard to the table is "chmod 754 [file name]".since the first ls running,it will show drwxr-xr-x,but when you change the mode and you run ls again,it will show as "drwxr-xr--".Now the permission for the file is changed.Here i show some example.
----click to enlarge-----
see.now the permission was changed.Try this and you will feel like you are now controlling your system :)
---p/s=sorry for my bad english.any ambiguous you can drop at comment.Thanks----
if you want to see all sorts of bash command line for linux,click here.
First of all you need to run "ls -l" to see the file attribute.
notice that the first lining of the list.
drwxr-xr-x 2 soap soap 4096 2011-11-21 20:01 Dictionary
-rw-r--r-- 1 soap soap 0 2011-11-21 20:00 toor
actually the result is divided by 3 part.But we will focused on drwxr-xr-x first.
d------>this mean that the item is directory
rwx----->this indicate for read and write permission.
notice that the sequence.
drwxr-xr-x is actually (type)(root)(user)(other)
the root got full permission thus it marked as "rwx" while user got read and execute permission and marked as "r-x".Other user got same permission as the user and marked as "r-x".If you combine all of them and then drwxr-xr-x is formed.Actually r,w and x each of them carry their own value.
r=4
w=2
x=1
lets consider this table.
see that.The trick here is very simple.consider the root got all permission,user got read and execute permission while other got read permission.Now root have the value as 7,user got 5 and other got 4.
how to change it?we simply type this command.
"chmod [root value][user value][other value] [file name]"
as an example regard to the table is "chmod 754 [file name]".since the first ls running,it will show drwxr-xr-x,but when you change the mode and you run ls again,it will show as "drwxr-xr--".Now the permission for the file is changed.Here i show some example.
----click to enlarge-----
see.now the permission was changed.Try this and you will feel like you are now controlling your system :)
---p/s=sorry for my bad english.any ambiguous you can drop at comment.Thanks----
if you want to see all sorts of bash command line for linux,click here.
No comments:
Post a Comment