On Thu, Jun 27, 2002 at 12:29:56PM +0000, Tyler Durdin wrote:
> 
> 2 questions. First, how do I change permissions on a file to make it 
> writable by everone? Second, how do i chage permission on a file to have it 
> writeable only by me (or root user)? Thanks.

If you run the command "ls -l filename", you'll see the file in question
with a row of letters and dashes on the left-hand side, something like:
-rw-r--r--

The first symbol is the type of file (directory, link, etc).
The next 3 tell you what the owner of the file can do with it.
The next 3 tell you what the group members of the file can do with it.
The next 3 tell you what all other users of the file can do with it.

The rights are:
        r: ability to read
        w: ability to write
        x: ability to execute

To make a file writable by anyone, you just give the "w" permission
to everybody:
chmod ugo+w filename

To make a file writable only by its owner, you take permission away
from everybody else:
chmod go-w filename

You can shorthen this by using numbers to represent the permissions.
r = 4
w = 2
x = 1
r+w = 4+2 = 6
r+w+x = 4+2+1 =7
etc...

So, to make a file readable and writeable by anyone, you could just type:
chmod 666 filename

There's a lot more to file permissions than this and I'ld recommend
reading the man page to chmod to learn more.

Emmanuel



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to