Sparkles

that were shone when I got tempered!

File Permission with chmod

leave a comment »

This is the format

chmod [owner permission][group permission][other permission] [file name]

This is how these permissions are represented.
read = 4
write = 2
execute = 1

Altogether
owner = read | write = 6
group = read = 4
other = read = 4

Generally used permission levels : 

# Permission rwx
7 read, write and execute rwx
6 read and write rw-
5 read and execute r-x
4 read only r–
3 write and execute -wx
2 write only -w-
1 execute only –x
0 none

 

Examplarary modes :

rwx rwx rwx = 111 111 111
rw- rw- rw- = 110 110 110
rwx --- --- = 111 000 000

and so on…

rwx = 111 in binary = 7
rw- = 110 in binary = 6
r-x = 101 in binary = 5
r-- = 100 in binary = 4

So, the basic syntax of the command to set the mode is

chmod 644 [file name]

View the permission.

ls -l some_file

Reference :

Advertisements

Written by Namal Fernando

August 30, 2013 at 8:02 am

Posted in Linux

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Ruth's Reflections

Contemplations from quakey quirky Christchurch

TED Blog

The TED Blog shares interesting news about TED, TED Talks video, the TED Prize and more.

Ziplok

Learn and discover simple things

Meihta Dwiguna Saputra's Knowledge Base

~In learning you will teach and in teaching you will (re)learn~

The Java Blog

Thoughts, tips and tricks about the Java programming language

Sparkles

that were shone when I got tempered!

%d bloggers like this: