On Sunday 03 November 2002 6:56 pm, Eric Richards wrote:
> how would one change the Properties, permissions of a file in a KDE
> "text window" by changing from a home user to root user by logging on a
> root user with "su" & password.
>
> From Eric

Each file has 3 sets of properties, owner,group and everyone else, with each 
set having the possibility of read, write and executable permissions
eg, ls -l somefile might show;

-rw-rw-r--    1 robin    work         391 Oct 10 00:05 somefile

The first (-) shows it is a normal file and not a directory(d) or link(l).
The next 3, (rw-) relate to the owner, robin, and show that he can read and 
write to the file, but it is not an executable like a bash script.
The middle 3, (rw-) relate to the group work and show that anyone who belongs 
to the work group can also read and write to this file.
The last 3, (r--) relate to everyone else with access to the directory where 
this file is stored and shows that they can only read this file but are not 
able to write to it.

Each of the values of read,write and executable can also be represented 
respectively by the numbers, 4,2 and 1 (or 0 if the value is not set) which 
can be added up to represent a shorthand version of the properties (I think 
its called an "octal number").

eg -rw-rw-r-- is equal to 664 (that is 4+2+0,4+2+0,4+0+0)
or -rwxr-xr-x is equal to 755 (that is 4+2+1,4+0+1,4+0+1)
or -rw-r--r-- is equal to 644 (that is 4+2+0,4+0+0,4+0+0)
or -rwxrwxrwx is equal to 777 (that is 4+2+1,4+2+1,4+2+1) Usually dangerous!

If you want to change the properties of a file that you own you can do so with 
the chmod command;
eg, chmod 644 somefile would change its properties to -rw-r--r--
or perhaps if you were writing a bash script just for yourself;
   chmod 700 somefile would equal -rwx------ giving you read,write and 
executable properties with no one else having access to it(except root of 
course)
If you want to change the ownership of a file then use the chown command;
eg,  chown bob somefile would make bob the new owner of somefile. You will 
probably need to be root to do this.
If you want to change which group a file belongs to then use the chgrp command
eg, chgrp games somefile would make it part of the games group.

                        Robin 

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to