Solved

chmod explain

Posted on 2002-07-04
4
776 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
  • 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
how to check for shares on aix 1 50
Parsing a file using ksh 10 48
How to clone solaris 10 machine 33 73
Image not there 4 34
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded‚Ķ
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now