On 22/03/07, Volker Kuhlmann <[EMAIL PROTECTED]> wrote:
On Thu 22 Mar 2007 19:41:36 NZST +1200, Kerry wrote:
> Not that I need it but a few parts I don't quite understand... In the
> second line what does the "0" do?
Absolutely nothing. It is a decimal number on the command line which is
interpreted in octal by the chmod command.
To expand a little on that - as far as I can tell from chmod, the
leading zero *doesn't* indicate octal in this case, because octal is
already mandated. The leading zero *could* act as an explicit reminder
to the person typing that they want to zero any of the suid,sgid and
sticky attributes - except that the *default* for chmod is to zero
these attributes (i.e. it pads out the digits you provide with leading
zeros - "chmod 1" == "chmod 0001".
So, it's definately doing "nothing" except reminding you about the
absence of extra attributes.
<quote "man chmod" on Ubuntu 6.10>
A numeric mode is from one to four octal digits (0-7), derived by
adding up the bits with values 4, 2, and 1. Any omitted digits are
assumed to be leading zeros. The first digit selects the set user ID
(4) and set group ID (2) and sticky (1) attributes. The second digit
selects permissions for the user who owns the file: read (4), write
(2), and execute (1); the third selects permissions for other users in
the file's group, with the same values; and the fourth for other users
not in the file's group, with the same values.
</quote>
-jim