Solved

chmod explain

Posted on 2002-07-04
4
795 Views
Last Modified: 2013-12-27
Hi...i don't really understand how this work.

 i've seen command like ;

  chmod 777 file1
  chmod 666 file1

 i know that the command will
 set certain permission on the file1.
how to use the numbers (654,666,777, etc)?

 tq.

 Sun newbie.
0
Comment
Question by:ismahwati
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 

Author Comment

by:ismahwati
ID: 7130543
i also have seen command ;

 $ stty erase

 what it do actually.

 tq

0
 
LVL 3

Accepted Solution

by:
UkWizard earned 20 total points
ID: 7130609
Right, firstly chmod;

chmod changes the permissions as you said, it works out to numbers by numbers representing the r ( read ) w ( write ) and x (execute ).
For example; if "ls -al" displays the following;

-rwxr-xrw-  owner  group  size date filename

ignore the first -, this means its a file.
break it down into pairs of three ( rwx ) ie;

rwx r-x rw-  

Where the first block is the file owners permissions.
second is the groups permissions
third is the 'other' permissions

So, The owner ( whatever owner is set to ) has read,write and execute permissions.

Anyone who is in the group ( what the group is set too) has read and execute permissions.

Any other person has read and write permissions.


So, now the numbers thing, each r, w and x represent a number. where r =4, w=2 and x=1.
Now you simpy add the numbers together of the permissions that you require.
So the command "chmod 756 filename" would give the permissions as above ( rwx r-x rw- ) because;

rwx = 4+2+1 = 7   ( owner permissions )
r-x = 4+1   = 5   ( group permissions )
rw- = 4+2   = 6   ( other permissions )

Hope thats clear now, now the 'stty' command

Stty sets/displays the current terminals line settings;

stty erase - sets the erase charactor, see "man stty" for more info.

Enjoy,

UkWizard.

0
 

Author Comment

by:ismahwati
ID: 7136746
tq..that helps
0
 

Author Comment

by:ismahwati
ID: 7136842
sorry ..i forgot to accept the anhwer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question