[PLUG] Chmod Usage

Seth Heckard sdh@purdue.edu
Mon, 23 Apr 2001 14:09:06 -0500


Clinton Ecker wrote:
> I am just wondering here.  FYI I've read the chmod Man
> page and found it a little confusing.  
> 
> Now I know that there are two ways you can change permissions
> (ie. Chmod a+rx file and chmod 755 <file>)
> 
> I use the "letters" format of chmod almost exclusivly and I know
> that the numeric method has something to do with octal.  I am
> just wondering how many people use the numeric vs. the letters 
> Method of chmod'ing; And perhaps someone could try to explain 
> the numeric method so its easier to understand?

Basically, 1 = x, 2 = w, and 4 = r, and you just add them to get the
permissions you want.  If you want to set UID, GID, or make the file sticky,
then you mess with the first digit (which is assumed to be 0 when you pass
chmod only 3 digits.)

For example, chmod 755 file would give you -rwxr-xr-x.

Seth Heckard / sdh@purdue.edu