Search This Blog

Sunday, 5 October 2014

File/Directory Permissions

To Change the Permissions using chmod

We can change the permissions of a directory using chmod command.
For Read Write Delete access to all.

chmod -R 777 path/*
For giving Read access alone to all.

chmod -R 444 path/*
For Read Write access to all.

chmod -R 666 path/

Other permissions are given below

Symbolic Notation
Octal Notation
Description
----------
000
no permissions
---x--x--x
111
execute
--w--w--w-
222
write
--wx-wx-wx
333
write & execute
-r--r--r--
444
read
-r-xr-xr-x
555
read & execute
-rw-rw-rw-
666
read & write
-rwxrwxrwx
777
read, write, & execute

Legend:
CODE
DESCRIPTION
0
No Permission
1
Execute
2
Write
3
write & execute
4
Read
5
Read & execute
6
Read and Write, no execute
7
Full Access

First one is Owner, Second is Group and third is others.

Common ones:
 
PERMISSION
COMMAND
rwxrwxrwx
chmod 777 filename
rwxrwxr-x
chmod 775 filename
rwxr-xr-x
chmod 755 filename
rw-rw-rw-
chmod 666 filename
rw-rw-r--
chmod 664 filename
rw-r--r--
chmod 644 filename


No comments:

Post a Comment